2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.vid.model;
23 import org.onap.vid.asdc.beans.tosca.Input;
26 import java.util.UUID;
31 public class Service {
36 /** The invariant uuid. */
37 private String invariantUuid;
43 private String version;
45 /** The tosca model URL. */
46 private String toscaModelURL;
49 private String category;
51 /** The Service Type. */
52 private String serviceType;
54 /** The Service Role */
55 private String serviceRole;
57 /** The description. */
58 private String description;
60 /** The service ecomp naming flag */
61 private String serviceEcompNaming;
63 private String instantiationType;
67 private Map<String, Input> inputs;
74 public String getUuid() {
79 * Gets the invariant uuid.
81 * @return the invariant uuid
83 public String getInvariantUuid() {
92 public String getName() {
101 public String getVersion() {
106 * Gets the tosca model URL.
108 * @return the tosca model URL
110 public String getToscaModelURL() {
111 return toscaModelURL;
117 * @return the category
119 public String getCategory() {
124 * Gets the description.
126 * @return the description
128 public String getDescription() {
137 public Map<String, Input> getInputs() {
141 * Get the serviceEcompNaming value
143 * @return serviceEcompNaming
145 public String getServiceEcompNaming() {
146 return serviceEcompNaming;
150 public String getInstantiationType() { return instantiationType; }
152 public void setInstantiationType(String instantiationType) { this.instantiationType = instantiationType; }
156 * @param uuid the new uuid
158 public void setUuid(String uuid) {
163 * Sets the invariant uuid.
165 * @param invariantUuid the new invariant uuid
167 public void setInvariantUuid(String invariantUuid) {
168 this.invariantUuid = invariantUuid;
174 * @param name the new name
176 public void setName(String name) {
183 * @param version the new version
185 public void setVersion(String version) {
186 this.version = version;
190 * Sets the tosca model URL.
192 * @param toscaModelURL the new tosca model URL
194 public void setToscaModelURL(String toscaModelURL) {
195 this.toscaModelURL = toscaModelURL;
201 * @param category the new category
203 public void setCategory(String category) {
204 this.category = category;
208 * Sets the description.
210 * @param description the new description
212 public void setDescription(String description) {
213 this.description = description;
219 * @param inputs the inputs
221 public void setInputs(Map<String, Input> inputs) {
222 this.inputs = inputs;
225 * Sets the service ecomp naming.
227 * @param serviceEcompNaming the new service ecomp naming
229 public void setServiceEcompNaming(String serviceEcompNaming) {
230 this.serviceEcompNaming = serviceEcompNaming;
233 * @see java.lang.Object#hashCode()
236 public int hashCode() {
237 final UUID uuid = UUID.fromString(getUuid());
239 return uuid.hashCode();
243 * @see java.lang.Object#equals(java.lang.Object)
246 public boolean equals(Object o) {
247 if (o == this) return true;
248 if (!(o instanceof Service)) return false;
250 final Service service = (Service) o;
252 return (service.getUuid().equals(getUuid()));
255 public String getServiceType() {
259 public void setServiceType(String serviceType) {
260 this.serviceType = serviceType;
263 public String getServiceRole() {
267 public void setServiceRole(String serviceRole) {
268 this.serviceRole = serviceRole;
271 /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
273 //Look for vnfCustomizationName..vfModuleCustomizationName
274 String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
275 for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
276 VfModule xMod = vfModuleComponent.getValue();
277 if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
278 vfMod.setCustomizationUuid( xMod.getCustomizationUuid());