Fix gvnfm juju compile problem
[vfc/nfvo/driver/vnfm/gvnfm.git] / juju / juju-vnfmadapter / Juju-vnfmadapterService / service / src / main / java / org / onap / vfc / nfvo / vnfm / gvnfm / jujuvnfmadapter / service / entity / MSBRequestEntity.java
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity;
18
19 import java.io.Serializable;
20 import java.util.List;
21
22 import org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.common.EntityUtils;
23
24 /**
25  * <br/>
26  * <p>
27  * The request parameters of Register service to the Microservice Bus
28  * URL-path: /openoapi/microservices/v1/services
29  * example:
30  * {
31  * "serviceName": "catalog",
32  * "version": "v1",
33  * "url": "/openoapi/catalog/v1",
34  * "protocol": "REST",
35  * "visualRange": ["1"],
36  * "nodes": [
37  * {
38  * "ip": "10.74.56.36",
39  * "port": "8988",
40  * "ttl": 0
41  * }
42  * ]
43  * }
44  * </p>
45  * <p>
46  * the response example:
47  * {
48  * "serviceName": "catalog",
49  * "version": "v1",
50  * "url": "/openoapi/catalog/v1",
51  * "protocol": "REST",
52  * "visualRange": ["1"],
53  * "nodes": [
54  * {
55  * "ip": "10.74.55.66",
56  * "port": "6666",
57  * "ttl": 0,
58  * "expiration": "2016-02-18T16:19:40+08:00",
59  * "created_at": "2016-02-18T16:03:00+08:00",
60  * "updated_at": "2016-02-18T16:03:00+08:00"
61  * },
62  * {
63  * "ip": "10.74.56.37",
64  * "port": "8989",
65  * "ttl": 0,
66  * "expiration": "2016-02-18T16:13:00+08:00",
67  * "created_at": "2016-02-18T16:03:00+08:00",
68  * "updated_at": "2016-02-18T16:03:00+08:00"
69  * },
70  * {
71  * "ip": "10.74.56.36",
72  * "port": "8988",
73  * "ttl": 0,
74  * "expiration": "2016-02-18T17:04:36+08:00",
75  * "created_at": "2016-02-18T16:03:00+08:00",
76  * "updated_at": "2016-02-18T16:03:00+08:00"
77  * }
78  * ],
79  * "status": "1"
80  * }
81  * the params description:
82  * serviceName: service name
83  * version: version
84  * url: url of the created service instance
85  * protocol: supported protocols: 'REST', 'UI'
86  * nodes: the service instance nodes list to register
87  * ip: the ip of the service instance node, it could also be a hostname like catalog.openo.org
88  * port: the port of the service instance node
89  * ttl: time to live, this parameter is reserved for later use
90  * status: service status, 1: eanbled, 0:disabled
91  * </p>
92  * 
93  * @author
94  * @version NFVO 0.5 Aug 18, 2016
95  */
96 public class MSBRequestEntity implements Serializable {
97
98     /**
99      * 
100      */
101     private static final long serialVersionUID = -4548158998952436572L;
102
103     private String serviceName;
104
105     private String version;
106
107     /**
108      * the actual URL of the service to be registered
109      */
110     private String url;
111
112     /**
113      * supported protocols: 'REST', 'UI'
114      */
115     private String protocol = "REST";
116
117     /**
118      * Visibility of the service.
119      * External(can be accessed by external systems):0
120      * Internal(can only be accessed by OPEN-O consumers):1
121      */
122     private String visualRange = "1";
123
124     /**
125      * only exist in response;
126      * status: service status, 1: eanbled, 0:disabled
127      */
128     private String status;
129
130     /**
131      * ip: the ip of the service instance node, it could also be a hostname like catalog.openo.org
132      * port: the port of the service instance node
133      * ttl: time to live, this parameter is reserved for later use
134      */
135     private List<Node> nodes;
136
137     /**
138      * @return Returns the serviceName.
139      */
140     public String getServiceName() {
141         return serviceName;
142     }
143
144     /**
145      * @param serviceName The serviceName to set.
146      */
147     public void setServiceName(String serviceName) {
148         this.serviceName = serviceName;
149     }
150
151     /**
152      * @return Returns the version.
153      */
154     public String getVersion() {
155         return version;
156     }
157
158     /**
159      * @param version The version to set.
160      */
161     public void setVersion(String version) {
162         this.version = version;
163     }
164
165     /**
166      * @return Returns the url.
167      */
168     public String getUrl() {
169         return url;
170     }
171
172     /**
173      * @param url The url to set.
174      */
175     public void setUrl(String url) {
176         this.url = url;
177     }
178
179     /**
180      * @return Returns the protocol.
181      */
182     public String getProtocol() {
183         return protocol;
184     }
185
186     /**
187      * @param protocol The protocol to set.
188      */
189     public void setProtocol(String protocol) {
190         this.protocol = protocol;
191     }
192
193     /**
194      * @return Returns the visualRange.
195      */
196     public String getVisualRange() {
197         return visualRange;
198     }
199
200     /**
201      * @param visualRange The visualRange to set.
202      */
203     public void setVisualRange(String visualRange) {
204         this.visualRange = visualRange;
205     }
206
207     /**
208      * @return Returns the status.
209      */
210     public String getStatus() {
211         return status;
212     }
213
214     /**
215      * @param status The status to set.
216      */
217     public void setStatus(String status) {
218         this.status = status;
219     }
220
221     /**
222      * @return Returns the nodes.
223      */
224     public List<Node> getNodes() {
225         return nodes;
226     }
227
228     /**
229      * @param nodes The nodes to set.
230      */
231     public void setNodes(List<Node> nodes) {
232         this.nodes = nodes;
233     }
234
235     /**
236      * <br/>
237      * <p>
238      * </p>
239      * 
240      * @author
241      * @version NFVO 0.5 Aug 18, 2016
242      */
243     public static class Node implements Serializable {
244
245         /**
246          * 
247          */
248         private static final long serialVersionUID = 7618395945064516270L;
249
250         private String ip;
251
252         private String port;
253
254         private String ttl;
255
256         private String expiration;
257
258         private String createdAt;
259
260         private String updatedAt;
261
262         /**
263          * @return Returns the ip.
264          */
265         public String getIp() {
266             return ip;
267         }
268
269         /**
270          * @param ip The ip to set.
271          */
272         public void setIp(String ip) {
273             this.ip = ip;
274         }
275
276         /**
277          * @return Returns the port.
278          */
279         public String getPort() {
280             return port;
281         }
282
283         /**
284          * @param port The port to set.
285          */
286         public void setPort(String port) {
287             this.port = port;
288         }
289
290         /**
291          * @return Returns the ttl.
292          */
293         public String getTtl() {
294             return ttl;
295         }
296
297         /**
298          * @param ttl The ttl to set.
299          */
300         public void setTtl(String ttl) {
301             this.ttl = ttl;
302         }
303
304         /**
305          * @return Returns the expiration.
306          */
307         public String getExpiration() {
308             return expiration;
309         }
310
311         /**
312          * @param expiration The expiration to set.
313          */
314         public void setExpiration(String expiration) {
315             this.expiration = expiration;
316         }
317
318         /**
319          * @return Returns the created_at.
320          */
321         public String getCreatedAt() {
322             return createdAt;
323         }
324
325         /**
326          * @param createdAt The created_at to set.
327          */
328         public void setCreatedAt(String createdAt) {
329             this.createdAt = createdAt;
330         }
331
332         /**
333          * @return Returns the updated_at.
334          */
335         public String getUpdatedAt() {
336             return updatedAt;
337         }
338
339         /**
340          * @param updatedAt The updated_at to set.
341          */
342         public void setUpdatedAt(String updatedAt) {
343             this.updatedAt = updatedAt;
344         }
345
346         /**
347          * <br/>
348          * 
349          * @return
350          * @since NFVO 0.5
351          */
352         @Override
353         public String toString() {
354             return EntityUtils.toString(this, Node.class);
355         }
356
357     }
358
359     /**
360      * <br/>
361      * 
362      * @return
363      * @since NFVO 0.5
364      */
365     @Override
366     public String toString() {
367         return EntityUtils.toString(this, MSBRequestEntity.class);
368     }
369
370 }