2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.vid.model;
\r
23 import java.util.Map;
\r
24 import java.util.UUID;
\r
25 import java.util.Map.Entry;
\r
27 import org.openecomp.vid.asdc.beans.tosca.Input;
\r
30 * The Class Service.
\r
32 public class Service {
\r
35 private String uuid;
\r
37 /** The invariant uuid. */
\r
38 private String invariantUuid;
\r
41 private String name;
\r
44 private String version;
\r
46 /** The tosca model URL. */
\r
47 private String toscaModelURL;
\r
49 /** The category. */
\r
50 private String category;
\r
52 /** The description. */
\r
53 private String description;
\r
55 /** The service ecomp naming flag */
\r
56 private String serviceEcompNaming;
\r
59 private Map<String, Input> inputs;
\r
66 public String getUuid() {
\r
71 * Gets the invariant uuid.
\r
73 * @return the invariant uuid
\r
75 public String getInvariantUuid() {
\r
76 return invariantUuid;
\r
84 public String getName() {
\r
91 * @return the version
\r
93 public String getVersion() {
\r
98 * Gets the tosca model URL.
\r
100 * @return the tosca model URL
\r
102 public String getToscaModelURL() {
\r
103 return toscaModelURL;
\r
107 * Gets the category.
\r
109 * @return the category
\r
111 public String getCategory() {
\r
116 * Gets the description.
\r
118 * @return the description
\r
120 public String getDescription() {
\r
121 return description;
\r
127 * @return the inputs
\r
129 public Map<String, Input> getInputs() {
\r
133 * Get the serviceEcompNaming value
\r
135 * @return serviceEcompNaming
\r
137 public String getServiceEcompNaming() {
\r
138 return serviceEcompNaming;
\r
143 * @param uuid the new uuid
\r
145 public void setUuid(String uuid) {
\r
150 * Sets the invariant uuid.
\r
152 * @param invariantUuid the new invariant uuid
\r
154 public void setInvariantUuid(String invariantUuid) {
\r
155 this.invariantUuid = invariantUuid;
\r
161 * @param name the new name
\r
163 public void setName(String name) {
\r
168 * Sets the version.
\r
170 * @param version the new version
\r
172 public void setVersion(String version) {
\r
173 this.version = version;
\r
177 * Sets the tosca model URL.
\r
179 * @param toscaModelURL the new tosca model URL
\r
181 public void setToscaModelURL(String toscaModelURL) {
\r
182 this.toscaModelURL = toscaModelURL;
\r
186 * Sets the category.
\r
188 * @param category the new category
\r
190 public void setCategory(String category) {
\r
191 this.category = category;
\r
195 * Sets the description.
\r
197 * @param description the new description
\r
199 public void setDescription(String description) {
\r
200 this.description = description;
\r
206 * @param inputs the inputs
\r
208 public void setInputs(Map<String, Input> inputs) {
\r
209 this.inputs = inputs;
\r
212 * Sets the service ecomp naming.
\r
214 * @param serviceEcompNaming the new service ecomp naming
\r
216 public void setServiceEcompNaming(String serviceEcompNaming) {
\r
217 this.serviceEcompNaming = serviceEcompNaming;
\r
220 * @see java.lang.Object#hashCode()
\r
223 public int hashCode() {
\r
224 final UUID uuid = UUID.fromString(getUuid());
\r
226 return uuid.hashCode();
\r
230 * @see java.lang.Object#equals(java.lang.Object)
\r
233 public boolean equals(Object o) {
\r
234 if (o == this) return true;
\r
235 if (!(o instanceof Service)) return false;
\r
237 final Service service = (Service) o;
\r
239 return (service.getUuid().equals(getUuid()));
\r
241 /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
\r
243 //Look for vnfCustomizationName..vfModuleCustomizationName
\r
244 String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
\r
245 for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
\r
246 VfModule xMod = vfModuleComponent.getValue();
\r
247 if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
\r
248 vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
\r