Modify powermock version to 1.6.6
[msb/discovery.git] / sdclient / discovery-service / src / main / java / org / onap / msb / sdclient / core / Service.java
1 /**
2  * Copyright 2016-2017 ZTE, Inc. and others.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14 package org.onap.msb.sdclient.core;
15
16 import java.io.Serializable;
17 import java.util.List;
18 import java.util.Set;
19
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21
22 import io.swagger.annotations.ApiModelProperty;
23
24
25 @JsonIgnoreProperties(ignoreUnknown = true)
26 public class Service<T> implements Serializable {
27     private static final long serialVersionUID = 1L;
28     // 服务名
29     @ApiModelProperty(example = "test", required = true)
30     private String serviceName;
31     // 版本号
32     @ApiModelProperty(example = "v1", required = true)
33     private String version = "";
34     // 服务url
35     @ApiModelProperty(value = "Target Service URL,start with /", example = "/api/serviceName/v1", required = true)
36     private String url = "";
37
38     // 服务对应协议,比如REST、UI、MQ、FTP、SNMP、TCP、UDP
39     @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, HTTP, TCP,UDP", example = "HTTP",
40                     required = true)
41     private String protocol = "";
42
43     // 服务的可见范围 0:系统间 1:系统内 ,可配置多个,以 |分隔
44     @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
45     private String visualRange = "1";
46
47     // 负载均衡策略类型
48     @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,ip_hash", example = "ip_hash")
49     private String lb_policy;
50
51     // TCP/UDP协议监听端口
52     @ApiModelProperty(hidden = true)
53     private String publish_port;
54
55     // 命名空间
56     private String namespace = "";
57
58     // 网络平面
59     @ApiModelProperty(hidden = true)
60     private String network_plane_type;
61
62     @ApiModelProperty(hidden = true)
63     private String host = "";
64
65     @ApiModelProperty(hidden = true)
66     private String path = "";
67
68
69
70     @ApiModelProperty(required = true)
71     private Set<T> nodes;
72
73     // 服务自身属性的键值对
74     private List<KeyVaulePair> metadata;
75
76     // 自定义标签
77     @ApiModelProperty(value = "custom labels", example = "key1:value1")
78     private List<String> labels;
79
80
81
82     public String getHost() {
83         return host;
84     }
85
86     public void setHost(String host) {
87         this.host = host;
88     }
89
90     public String getPath() {
91         return path;
92     }
93
94     public void setPath(String path) {
95         this.path = path;
96     }
97
98     public List<String> getLabels() {
99         return labels;
100     }
101
102     public void setLabels(List<String> labels) {
103         this.labels = labels;
104     }
105
106     public Set<T> getNodes() {
107         return nodes;
108     }
109
110     public void setNodes(Set<T> nodes) {
111         this.nodes = nodes;
112     }
113
114     public String getServiceName() {
115         return serviceName;
116     }
117
118     public void setServiceName(String serviceName) {
119         this.serviceName = serviceName;
120     }
121
122     public String getVersion() {
123         return version;
124     }
125
126     public void setVersion(String version) {
127         this.version = version;
128     }
129
130     public String getUrl() {
131         return url;
132     }
133
134     public void setUrl(String url) {
135         this.url = url;
136     }
137
138     public String getProtocol() {
139         return protocol;
140     }
141
142     public void setProtocol(String protocol) {
143         this.protocol = protocol;
144     }
145
146
147
148     public List<KeyVaulePair> getMetadata() {
149         return metadata;
150     }
151
152     public void setMetadata(List<KeyVaulePair> metadata) {
153         this.metadata = metadata;
154     }
155
156
157     public String getVisualRange() {
158         return visualRange;
159     }
160
161     public void setVisualRange(String visualRange) {
162         this.visualRange = visualRange;
163     }
164
165     public String getLb_policy() {
166         return lb_policy;
167     }
168
169     public void setLb_policy(String lb_policy) {
170         this.lb_policy = lb_policy;
171     }
172
173     public String getPublish_port() {
174         return publish_port;
175     }
176
177     public void setPublish_port(String publish_port) {
178         this.publish_port = publish_port;
179     }
180
181     public String getNamespace() {
182         return namespace;
183     }
184
185     public void setNamespace(String namespace) {
186         this.namespace = namespace;
187     }
188
189     public String getNetwork_plane_type() {
190         return network_plane_type;
191     }
192
193     public void setNetwork_plane_type(String network_plane_type) {
194         this.network_plane_type = network_plane_type;
195     }
196 }