[VID-6] Initial rebase push
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / asdc / beans / Service.java
1 /*-\r
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
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
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \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.
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.vid.asdc.beans;\r
22 \r
23 import java.util.Collection;\r
24 import java.util.UUID;\r
25 /**\r
26  * The Class Service.\r
27  */\r
28 public class Service {\r
29 \r
30         /**\r
31          * The Enum DistributionStatus.\r
32          */\r
33         public enum DistributionStatus { \r
34                 \r
35                 /** The distribution not approved. */\r
36                 DISTRIBUTION_NOT_APPROVED,\r
37                 \r
38                 /** The distribution approved. */\r
39                 DISTRIBUTION_APPROVED,\r
40                 \r
41                 /** The distributed. */\r
42                 DISTRIBUTED,\r
43                 \r
44                 /** The distribution rejected. */\r
45                 DISTRIBUTION_REJECTED\r
46         }\r
47         \r
48         /**\r
49          * The Enum LifecycleState.\r
50          */\r
51         public enum LifecycleState {\r
52                 \r
53                 /** The not certified checkout. */\r
54                 NOT_CERTIFIED_CHECKOUT,\r
55                 \r
56                 /** The not certified checkin. */\r
57                 NOT_CERTIFIED_CHECKIN,\r
58                 \r
59                 /** The ready for certification. */\r
60                 READY_FOR_CERTIFICATION,\r
61                 \r
62                 /** The certification in progress. */\r
63                 CERTIFICATION_IN_PROGRESS,\r
64                 \r
65                 /** The certified. */\r
66                 CERTIFIED\r
67         }\r
68         \r
69         /** The uuid. */\r
70         private String uuid;\r
71         \r
72         /** The invariant UUID. */\r
73         private String invariantUUID;\r
74         \r
75         /** The name. */\r
76         private String name;\r
77         \r
78         /** The version. */\r
79         private String version;\r
80         \r
81         /** The tosca model URL. */\r
82         private String toscaModelURL;\r
83         \r
84         /** The category. */\r
85         private String category;\r
86         \r
87         /** The lifecycle state. */\r
88         private Service.LifecycleState lifecycleState;\r
89         \r
90         /** The last updater user uid. */\r
91         private String lastUpdaterUserId;\r
92         \r
93         /** The last updater full name. */\r
94         private String lastUpdaterFullName;\r
95         \r
96         /** The distribution status. */\r
97         private Service.DistributionStatus distributionStatus;\r
98         \r
99         /** The artifacts. */\r
100         private Collection<Artifact> artifacts;\r
101         \r
102         /** The resources. */\r
103         private Collection<SubResource> resources;\r
104         \r
105         /**\r
106          * Gets the uuid.\r
107          *\r
108          * @return the uuid\r
109          */\r
110         public String getUuid() {\r
111                 return uuid;\r
112         }\r
113         \r
114         /**\r
115          * Gets the invariant UUID.\r
116          *\r
117          * @return the invariant UUID\r
118          */\r
119         public String getInvariantUUID() {\r
120                 return invariantUUID;\r
121         }\r
122         \r
123         /**\r
124          * Gets the name.\r
125          *\r
126          * @return the name\r
127          */\r
128         public String getName() {\r
129                 return name;\r
130         }\r
131         \r
132         /**\r
133          * Gets the version.\r
134          *\r
135          * @return the version\r
136          */\r
137         public String getVersion() {\r
138                 return version;\r
139         }\r
140         \r
141         /**\r
142          * Gets the tosca model URL.\r
143          *\r
144          * @return the tosca model URL\r
145          */\r
146         public String getToscaModelURL() {\r
147                 return toscaModelURL;\r
148         }\r
149         \r
150         /**\r
151          * Gets the category.\r
152          *\r
153          * @return the category\r
154          */\r
155         public String getCategory() {\r
156                 return category;\r
157         }\r
158         \r
159         /**\r
160          * Gets the lifecycle state.\r
161          *\r
162          * @return the lifecycle state\r
163          */\r
164         public Service.LifecycleState getLifecycleState() {\r
165                 return lifecycleState;\r
166         }\r
167         \r
168         /**\r
169          * Gets the last updater user uid.\r
170          *\r
171          * @return the last updater user uid\r
172          */\r
173         public String getLastUpdaterUserId() {\r
174                 return lastUpdaterUserId;\r
175         }\r
176         \r
177         /**\r
178          * Gets the last updater full name.\r
179          *\r
180          * @return the last updater full name\r
181          */\r
182         public String getLastUpdaterFullName() {\r
183                 return lastUpdaterFullName;\r
184         }\r
185         \r
186         /**\r
187          * Gets the distribution status.\r
188          *\r
189          * @return the distribution status\r
190          */\r
191         public Service.DistributionStatus getDistributionStatus() {\r
192                 return distributionStatus;\r
193         }\r
194         \r
195         /**\r
196          * Gets the artifacts.\r
197          *\r
198          * @return the artifacts\r
199          */\r
200         public Collection<Artifact> getArtifacts() {\r
201                 return artifacts;\r
202         }\r
203         \r
204         /**\r
205          * Gets the resources.\r
206          *\r
207          * @return the resources\r
208          */\r
209         public Collection<SubResource> getResources() {\r
210                 return resources;\r
211         }\r
212         \r
213         /**\r
214          * Sets the uuid.\r
215          *\r
216          * @param uuid the new uuid\r
217          */\r
218         public void setUuid(String uuid) {\r
219                 this.uuid = uuid;\r
220         }\r
221         \r
222         /**\r
223          * Sets the invariant UUID.\r
224          *\r
225          * @param invariantUUID the new invariant UUID\r
226          */\r
227         public void setInvariantUUID(String invariantUUID) {\r
228                 this.invariantUUID = invariantUUID;\r
229         }\r
230         \r
231         /**\r
232          * Sets the name.\r
233          *\r
234          * @param name the new name\r
235          */\r
236         public void setName(String name) {\r
237                 this.name = name;\r
238         }\r
239         \r
240         /**\r
241          * Sets the version.\r
242          *\r
243          * @param version the new version\r
244          */\r
245         public void setVersion(String version) {\r
246                 this.version = version;\r
247         }\r
248         \r
249         /**\r
250          * Sets the tosca model URL.\r
251          *\r
252          * @param toscaModelURL the new tosca model URL\r
253          */\r
254         public void setToscaModelURL(String toscaModelURL) {\r
255                 this.toscaModelURL = toscaModelURL;\r
256         }\r
257         \r
258         /**\r
259          * Sets the category.\r
260          *\r
261          * @param category the new category\r
262          */\r
263         public void setCategory(String category) {\r
264                 this.category = category;\r
265         }\r
266         \r
267         /**\r
268          * Sets the lifecycle state.\r
269          *\r
270          * @param lifecycleState the new lifecycle state\r
271          */\r
272         public void setLifecycleState(Service.LifecycleState lifecycleState) {\r
273                 this.lifecycleState = lifecycleState;\r
274         }\r
275         \r
276         /**\r
277          * Sets the last updater user uid.\r
278          *\r
279          * @param lastUpdaterUserId the new last updater user uid\r
280          */\r
281         public void set(String lastUpdaterUserId) {\r
282                 this.lastUpdaterUserId = lastUpdaterUserId;\r
283         }\r
284         \r
285         /**\r
286          * Sets the last updater full name.\r
287          *\r
288          * @param lastUpdaterFullName the new last updater full name\r
289          */\r
290         public void setLastUpdaterFullName(String lastUpdaterFullName) {\r
291                 this.lastUpdaterFullName = lastUpdaterFullName;\r
292         }\r
293         \r
294         /**\r
295          * Sets the distribution status.\r
296          *\r
297          * @param distributionStatus the new distribution status\r
298          */\r
299         public void setDistributionStatus(Service.DistributionStatus distributionStatus) {\r
300                 this.distributionStatus = distributionStatus;\r
301         }\r
302         \r
303         /**\r
304          * Sets the artifacts.\r
305          *\r
306          * @param artifacts the new artifacts\r
307          */\r
308         public void setArtifacts(Collection<Artifact> artifacts) {\r
309                 this.artifacts = artifacts;\r
310         }\r
311         \r
312         /**\r
313          * Sets the resources.\r
314          *\r
315          * @param resources the new resources\r
316          */\r
317         public void setResources(Collection<SubResource> resources) {\r
318                 this.resources = resources;\r
319         }\r
320 \r
321         /* (non-Javadoc)\r
322          * @see java.lang.Object#toString()\r
323          */\r
324         @Override\r
325         public String toString() {\r
326                 return uuid;\r
327         }\r
328         \r
329         /* (non-Javadoc)\r
330          * @see java.lang.Object#hashCode()\r
331          */\r
332         @Override\r
333         public int hashCode() {\r
334                 final UUID uuid = UUID.fromString(getUuid());\r
335                 \r
336                 return uuid.hashCode();\r
337         }\r
338         \r
339         /* (non-Javadoc)\r
340          * @see java.lang.Object#equals(java.lang.Object)\r
341          */\r
342         @Override\r
343         public boolean equals(Object o) {\r
344                 if (o == this) return true;\r
345                 if (!(o instanceof Service)) return false;\r
346                 \r
347                 final Service service = (Service) o;\r
348                 \r
349                 return (service.getUuid().equals(getUuid()));\r
350         }\r
351 }\r