1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.impl.registry;
17
18 import org.kuali.rice.ksb.api.registry.ServiceEndpointStatus;
19 import org.kuali.rice.ksb.api.registry.ServiceInfo;
20 import org.kuali.rice.ksb.api.registry.ServiceInfoContract;
21
22 import javax.xml.namespace.QName;
23 import java.io.Serializable;
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 public class ServiceInfoBo implements ServiceInfoContract, Serializable {
43
44 private static final long serialVersionUID = -4244884858494208070L;
45
46
47
48
49
50
51
52
53 @javax.persistence.Column(name="SVC_DEF_ID")
54 private String serviceId;
55
56 @javax.persistence.Column(name="SVC_NM")
57 private String serviceName;
58
59 @javax.persistence.Column(name="SVC_URL", length=500)
60 private String endpointUrl;
61
62 @javax.persistence.Column(name="INSTN_ID")
63 private String instanceId;
64
65 @javax.persistence.Column(name="APPL_ID")
66 private String applicationId;
67
68 @javax.persistence.Column(name="SRVR_IP")
69 private String serverIpAddress;
70
71 @javax.persistence.Column(name="TYP_CD")
72 private String type;
73
74 @javax.persistence.Column(name="SVC_VER")
75 private String serviceVersion;
76
77 @javax.persistence.Column(name="STAT_CD")
78 private String statusCode;
79
80 @javax.persistence.Column(name="SVC_DSCRPTR_ID")
81 private String serviceDescriptorId;
82
83 @javax.persistence.Column(name="CHKSM", length=30)
84 private String checksum;
85
86 @javax.persistence.Version
87 @javax.persistence.Column(name="VER_NBR")
88 private Long versionNumber;
89
90 public String getServiceId() {
91 return serviceId;
92 }
93
94 public void setServiceId(String serviceId) {
95 this.serviceId = serviceId;
96 }
97
98 @Override
99 public QName getServiceName() {
100 if (this.serviceName == null) {
101 return null;
102 }
103 return QName.valueOf(this.serviceName);
104 }
105
106 public void setServiceName(String serviceName) {
107 this.serviceName = serviceName;
108 }
109
110 public String getEndpointUrl() {
111 return endpointUrl;
112 }
113
114 public void setEndpointUrl(String endpointUrl) {
115 this.endpointUrl = endpointUrl;
116 }
117
118 public String getInstanceId() {
119 return instanceId;
120 }
121
122 public void setInstanceId(String instanceId) {
123 this.instanceId = instanceId;
124 }
125
126 public String getApplicationId() {
127 return applicationId;
128 }
129
130 public void setApplicationId(String applicationId) {
131 this.applicationId = applicationId;
132 }
133
134 public String getServerIpAddress() {
135 return serverIpAddress;
136 }
137
138 public void setServerIpAddress(String serverIpAddress) {
139 this.serverIpAddress = serverIpAddress;
140 }
141
142 public String getType() {
143 return type;
144 }
145
146 public void setType(String type) {
147 this.type = type;
148 }
149
150 public String getServiceVersion() {
151 return serviceVersion;
152 }
153
154 public void setServiceVersion(String serviceVersion) {
155 this.serviceVersion = serviceVersion;
156 }
157
158 public String getStatusCode() {
159 return statusCode;
160 }
161
162 public void setStatusCode(String statusCode) {
163 this.statusCode = statusCode;
164 }
165
166 public String getServiceDescriptorId() {
167 return serviceDescriptorId;
168 }
169
170 public void setServiceDescriptorId(String serviceDescriptorId) {
171 this.serviceDescriptorId = serviceDescriptorId;
172 }
173
174 public String getChecksum() {
175 return checksum;
176 }
177
178 public void setChecksum(String checksum) {
179 this.checksum = checksum;
180 }
181
182 public Long getVersionNumber() {
183 return versionNumber;
184 }
185
186 public void setVersionNumber(Long versionNumber) {
187 this.versionNumber = versionNumber;
188 }
189
190 @Override
191 public ServiceEndpointStatus getStatus() {
192 if (getStatusCode() == null) {
193 return null;
194 }
195 return ServiceEndpointStatus.fromCode(getStatusCode());
196 }
197
198 static ServiceInfo to(ServiceInfoBo bo) {
199 if (bo == null) {
200 return null;
201 }
202 return ServiceInfo.Builder.create(bo).build();
203 }
204
205 static ServiceInfoBo from(ServiceInfo im) {
206 if (im == null) {
207 return null;
208 }
209 ServiceInfoBo bo = new ServiceInfoBo();
210 bo.serviceId = im.getServiceId();
211 bo.serviceName = im.getServiceName().toString();
212 bo.endpointUrl = im.getEndpointUrl();
213 bo.instanceId = im.getInstanceId();
214 bo.applicationId = im.getApplicationId();
215 bo.serverIpAddress = im.getServerIpAddress();
216 bo.type = im.getType();
217 bo.serviceVersion = im.getServiceVersion();
218 bo.statusCode = im.getStatus().getCode();
219 bo.serviceDescriptorId = im.getServiceDescriptorId();
220 bo.checksum = im.getChecksum();
221 bo.versionNumber = im.getVersionNumber();
222 return bo;
223 }
224
225
226
227
228 }