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.asdc.beans;
23 import java.util.Collection;
24 import java.util.UUID;
28 public class Service {
31 * The Enum DistributionStatus.
33 public enum DistributionStatus {
35 /** The distribution not approved. */
36 DISTRIBUTION_NOT_APPROVED,
38 /** The distribution approved. */
39 DISTRIBUTION_APPROVED,
41 /** The distributed. */
44 /** The distribution rejected. */
45 DISTRIBUTION_REJECTED,
47 /** The destributed for tenant isolation. */
48 DISTRIBUTION_COMPLETE_OK
52 * The Enum LifecycleState.
54 public enum LifecycleState {
56 /** The not certified checkout. */
57 NOT_CERTIFIED_CHECKOUT,
59 /** The not certified checkin. */
60 NOT_CERTIFIED_CHECKIN,
62 /** The ready for certification. */
63 READY_FOR_CERTIFICATION,
65 /** The certification in progress. */
66 CERTIFICATION_IN_PROGRESS,
75 /** The invariant UUID. */
76 private String invariantUUID;
82 private String version;
84 /** The tosca model URL. */
85 private String toscaModelURL;
88 private String category;
90 /** The lifecycle state. */
91 private Service.LifecycleState lifecycleState;
93 /** The last updater user uid. */
94 private String lastUpdaterUserId;
96 /** The last updater full name. */
97 private String lastUpdaterFullName;
99 /** The distribution status. */
100 private Service.DistributionStatus distributionStatus;
102 /** The artifacts. */
103 private Collection<Artifact> artifacts;
105 /** The resources. */
106 private Collection<SubResource> resources;
113 public String getUuid() {
118 * Gets the invariant UUID.
120 * @return the invariant UUID
122 public String getInvariantUUID() {
123 return invariantUUID;
131 public String getName() {
138 * @return the version
140 public String getVersion() {
145 * Gets the tosca model URL.
147 * @return the tosca model URL
149 public String getToscaModelURL() {
150 return toscaModelURL;
156 * @return the category
158 public String getCategory() {
163 * Gets the lifecycle state.
165 * @return the lifecycle state
167 public Service.LifecycleState getLifecycleState() {
168 return lifecycleState;
172 * Gets the last updater user uid.
174 * @return the last updater user uid
176 public String getLastUpdaterUserId() {
177 return lastUpdaterUserId;
181 * Gets the last updater full name.
183 * @return the last updater full name
185 public String getLastUpdaterFullName() {
186 return lastUpdaterFullName;
190 * Gets the distribution status.
192 * @return the distribution status
194 public Service.DistributionStatus getDistributionStatus() {
195 return distributionStatus;
199 * Gets the artifacts.
201 * @return the artifacts
203 public Collection<Artifact> getArtifacts() {
208 * Gets the resources.
210 * @return the resources
212 public Collection<SubResource> getResources() {
219 * @param uuid the new uuid
221 public void setUuid(String uuid) {
226 * Sets the invariant UUID.
228 * @param invariantUUID the new invariant UUID
230 public void setInvariantUUID(String invariantUUID) {
231 this.invariantUUID = invariantUUID;
237 * @param name the new name
239 public void setName(String name) {
246 * @param version the new version
248 public void setVersion(String version) {
249 this.version = version;
253 * Sets the tosca model URL.
255 * @param toscaModelURL the new tosca model URL
257 public void setToscaModelURL(String toscaModelURL) {
258 this.toscaModelURL = toscaModelURL;
264 * @param category the new category
266 public void setCategory(String category) {
267 this.category = category;
271 * Sets the lifecycle state.
273 * @param lifecycleState the new lifecycle state
275 public void setLifecycleState(Service.LifecycleState lifecycleState) {
276 this.lifecycleState = lifecycleState;
280 * Sets the last updater user uid.
282 * @param lastUpdaterUserId the new last updater user uid
284 public void set(String lastUpdaterUserId) {
285 this.lastUpdaterUserId = lastUpdaterUserId;
289 * Sets the last updater full name.
291 * @param lastUpdaterFullName the new last updater full name
293 public void setLastUpdaterFullName(String lastUpdaterFullName) {
294 this.lastUpdaterFullName = lastUpdaterFullName;
298 * Sets the distribution status.
300 * @param distributionStatus the new distribution status
302 public void setDistributionStatus(Service.DistributionStatus distributionStatus) {
303 this.distributionStatus = distributionStatus;
307 * Sets the artifacts.
309 * @param artifacts the new artifacts
311 public void setArtifacts(Collection<Artifact> artifacts) {
312 this.artifacts = artifacts;
316 * Sets the resources.
318 * @param resources the new resources
320 public void setResources(Collection<SubResource> resources) {
321 this.resources = resources;
325 * @see java.lang.Object#toString()
328 public String toString() {
333 * @see java.lang.Object#hashCode()
336 public int hashCode() {
337 final UUID uuid = UUID.fromString(getUuid());
339 return uuid.hashCode();
343 * @see java.lang.Object#equals(java.lang.Object)
346 public boolean equals(Object o) {
347 if (o == this) return true;
348 if (!(o instanceof Service)) return false;
350 final Service service = (Service) o;
352 return (service.getUuid().equals(getUuid()));