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.asdc.beans;
\r
23 import java.util.Collection;
\r
24 import java.util.UUID;
\r
26 * The Class Service.
\r
28 public class Service {
\r
31 * The Enum DistributionStatus.
\r
33 public enum DistributionStatus {
\r
35 /** The distribution not approved. */
\r
36 DISTRIBUTION_NOT_APPROVED,
\r
38 /** The distribution approved. */
\r
39 DISTRIBUTION_APPROVED,
\r
41 /** The distributed. */
\r
44 /** The distribution rejected. */
\r
45 DISTRIBUTION_REJECTED
\r
49 * The Enum LifecycleState.
\r
51 public enum LifecycleState {
\r
53 /** The not certified checkout. */
\r
54 NOT_CERTIFIED_CHECKOUT,
\r
56 /** The not certified checkin. */
\r
57 NOT_CERTIFIED_CHECKIN,
\r
59 /** The ready for certification. */
\r
60 READY_FOR_CERTIFICATION,
\r
62 /** The certification in progress. */
\r
63 CERTIFICATION_IN_PROGRESS,
\r
65 /** The certified. */
\r
70 private String uuid;
\r
72 /** The invariant UUID. */
\r
73 private String invariantUUID;
\r
76 private String name;
\r
79 private String version;
\r
81 /** The tosca model URL. */
\r
82 private String toscaModelURL;
\r
84 /** The category. */
\r
85 private String category;
\r
87 /** The lifecycle state. */
\r
88 private Service.LifecycleState lifecycleState;
\r
90 /** The last updater user uid. */
\r
91 private String lastUpdaterUserId;
\r
93 /** The last updater full name. */
\r
94 private String lastUpdaterFullName;
\r
96 /** The distribution status. */
\r
97 private Service.DistributionStatus distributionStatus;
\r
99 /** The artifacts. */
\r
100 private Collection<Artifact> artifacts;
\r
102 /** The resources. */
\r
103 private Collection<SubResource> resources;
\r
110 public String getUuid() {
\r
115 * Gets the invariant UUID.
\r
117 * @return the invariant UUID
\r
119 public String getInvariantUUID() {
\r
120 return invariantUUID;
\r
128 public String getName() {
\r
133 * Gets the version.
\r
135 * @return the version
\r
137 public String getVersion() {
\r
142 * Gets the tosca model URL.
\r
144 * @return the tosca model URL
\r
146 public String getToscaModelURL() {
\r
147 return toscaModelURL;
\r
151 * Gets the category.
\r
153 * @return the category
\r
155 public String getCategory() {
\r
160 * Gets the lifecycle state.
\r
162 * @return the lifecycle state
\r
164 public Service.LifecycleState getLifecycleState() {
\r
165 return lifecycleState;
\r
169 * Gets the last updater user uid.
\r
171 * @return the last updater user uid
\r
173 public String getLastUpdaterUserId() {
\r
174 return lastUpdaterUserId;
\r
178 * Gets the last updater full name.
\r
180 * @return the last updater full name
\r
182 public String getLastUpdaterFullName() {
\r
183 return lastUpdaterFullName;
\r
187 * Gets the distribution status.
\r
189 * @return the distribution status
\r
191 public Service.DistributionStatus getDistributionStatus() {
\r
192 return distributionStatus;
\r
196 * Gets the artifacts.
\r
198 * @return the artifacts
\r
200 public Collection<Artifact> getArtifacts() {
\r
205 * Gets the resources.
\r
207 * @return the resources
\r
209 public Collection<SubResource> getResources() {
\r
216 * @param uuid the new uuid
\r
218 public void setUuid(String uuid) {
\r
223 * Sets the invariant UUID.
\r
225 * @param invariantUUID the new invariant UUID
\r
227 public void setInvariantUUID(String invariantUUID) {
\r
228 this.invariantUUID = invariantUUID;
\r
234 * @param name the new name
\r
236 public void setName(String name) {
\r
241 * Sets the version.
\r
243 * @param version the new version
\r
245 public void setVersion(String version) {
\r
246 this.version = version;
\r
250 * Sets the tosca model URL.
\r
252 * @param toscaModelURL the new tosca model URL
\r
254 public void setToscaModelURL(String toscaModelURL) {
\r
255 this.toscaModelURL = toscaModelURL;
\r
259 * Sets the category.
\r
261 * @param category the new category
\r
263 public void setCategory(String category) {
\r
264 this.category = category;
\r
268 * Sets the lifecycle state.
\r
270 * @param lifecycleState the new lifecycle state
\r
272 public void setLifecycleState(Service.LifecycleState lifecycleState) {
\r
273 this.lifecycleState = lifecycleState;
\r
277 * Sets the last updater user uid.
\r
279 * @param lastUpdaterUserId the new last updater user uid
\r
281 public void set(String lastUpdaterUserId) {
\r
282 this.lastUpdaterUserId = lastUpdaterUserId;
\r
286 * Sets the last updater full name.
\r
288 * @param lastUpdaterFullName the new last updater full name
\r
290 public void setLastUpdaterFullName(String lastUpdaterFullName) {
\r
291 this.lastUpdaterFullName = lastUpdaterFullName;
\r
295 * Sets the distribution status.
\r
297 * @param distributionStatus the new distribution status
\r
299 public void setDistributionStatus(Service.DistributionStatus distributionStatus) {
\r
300 this.distributionStatus = distributionStatus;
\r
304 * Sets the artifacts.
\r
306 * @param artifacts the new artifacts
\r
308 public void setArtifacts(Collection<Artifact> artifacts) {
\r
309 this.artifacts = artifacts;
\r
313 * Sets the resources.
\r
315 * @param resources the new resources
\r
317 public void setResources(Collection<SubResource> resources) {
\r
318 this.resources = resources;
\r
322 * @see java.lang.Object#toString()
\r
325 public String toString() {
\r
330 * @see java.lang.Object#hashCode()
\r
333 public int hashCode() {
\r
334 final UUID uuid = UUID.fromString(getUuid());
\r
336 return uuid.hashCode();
\r
340 * @see java.lang.Object#equals(java.lang.Object)
\r
343 public boolean equals(Object o) {
\r
344 if (o == this) return true;
\r
345 if (!(o instanceof Service)) return false;
\r
347 final Service service = (Service) o;
\r
349 return (service.getUuid().equals(getUuid()));
\r