1
2
3
4
5
6
7
8
9
10 package it.imolinfo.jbi4cics.webservices.descriptor;
11
12 import it.imolinfo.jbi4cics.connection.InteractionDescription;
13 import it.imolinfo.jbi4cics.locator.ServiceLocation;
14 import it.imolinfo.jbi4cics.messageformat.MappingDescriptor;
15 import it.imolinfo.jbi4cics.security.Account;
16
17 public final class ServiceDescriptor {
18
19
20
21
22
23 private String serviceName;
24 private String operationName;
25 private String serviceNameSpace;
26
27
28
29
30
31 private String serviceInterfaceName;
32 private String inputBeanClassName;
33 private String outputBeanClassName;
34 private String serviceInterfacePackageName;
35 private Class serviceInterface;
36
37
38
39
40
41 private MappingDescriptor inputMappingDescriptor;
42 private MappingDescriptor outputMappingDescriptor;
43 private ServiceLocation serviceLocation;
44 private Account account;
45 private InteractionDescription interactionDescription;
46
47 private String codePage;
48
49
50
51
52 public ServiceDescriptor() {
53 }
54
55
56
57
58 public Class getInputBean() {
59 return inputMappingDescriptor.getBeanClass();
60 }
61
62
63
64
65 public void setInputBean(Class inputBean) {
66 inputMappingDescriptor.setBeanClass(inputBean);
67 }
68
69
70
71
72 public String getOperationName() {
73 return operationName;
74 }
75
76
77
78
79 public void setOperationName(String operationName) {
80 this.operationName = operationName;
81 }
82
83
84
85
86 public Class getOutputBean() {
87 return outputMappingDescriptor.getBeanClass();
88 }
89
90
91
92
93 public void setOutputBean(Class outputBean) {
94 outputMappingDescriptor.setBeanClass(outputBean);
95 }
96
97
98
99
100 public String getServiceName() {
101 return serviceName;
102 }
103
104
105
106
107 public void setServiceName(String serviceName) {
108 this.serviceName = serviceName;
109 }
110
111
112
113
114 public Account getAccount() {
115 return account;
116 }
117
118
119
120
121 public void setAccount(Account account) {
122 this.account = account;
123 }
124
125
126
127
128 public MappingDescriptor getInputMappingDescriptor() {
129 return inputMappingDescriptor;
130 }
131
132
133
134
135 public void setInputMappingDescriptor(MappingDescriptor inputMappingDescriptor) {
136 this.inputMappingDescriptor = inputMappingDescriptor;
137 }
138
139
140
141
142 public InteractionDescription getInteractionDescription() {
143 return interactionDescription;
144 }
145
146
147
148
149 public void setInteractionDescription(InteractionDescription interactionDescription) {
150 this.interactionDescription = interactionDescription;
151 }
152
153
154
155
156 public MappingDescriptor getOutputMappingDescriptor() {
157 return outputMappingDescriptor;
158 }
159
160
161
162
163 public void setOutputMappingDescriptor(MappingDescriptor outputMappingDescriptor) {
164 this.outputMappingDescriptor = outputMappingDescriptor;
165 }
166
167
168
169
170 public ServiceLocation getServiceLocation() {
171 return serviceLocation;
172 }
173
174
175
176
177 public void setServiceLocation(ServiceLocation serviceLocation) {
178 this.serviceLocation = serviceLocation;
179 }
180
181
182
183
184 public Class getServiceInterface() {
185 return serviceInterface;
186 }
187
188
189
190
191 public void setServiceInterface(Class serviceInterface) {
192 this.serviceInterface = serviceInterface;
193 }
194
195
196
197
198 public String getServiceInterfaceName() {
199 return serviceInterfaceName;
200 }
201
202
203
204
205 public void setServiceInterfaceName(String serviceInterfaceName) {
206 this.serviceInterfaceName = serviceInterfaceName;
207 }
208
209
210
211
212 public String getServiceInterfacePackageName() {
213 return serviceInterfacePackageName;
214 }
215
216
217
218
219 public void setServiceInterfacePackageName(String serviceInterfacePackageName) {
220 this.serviceInterfacePackageName = serviceInterfacePackageName;
221 }
222
223
224
225
226 public String getServiceNameSpace() {
227 return serviceNameSpace;
228 }
229
230
231
232
233 public void setServiceNameSpace(String serviceNameSpace) {
234 this.serviceNameSpace = serviceNameSpace;
235 }
236
237
238
239
240 public String getInputBeanClassName() {
241 return inputBeanClassName;
242 }
243
244
245
246
247 public void setInputBeanClassName(String inputBeanClassName) {
248 this.inputBeanClassName = inputBeanClassName;
249 }
250
251
252
253
254 public String getOutputBeanClassName() {
255 return outputBeanClassName;
256 }
257
258
259
260
261 public void setOutputBeanClassName(String outputBeanClassName) {
262 this.outputBeanClassName = outputBeanClassName;
263 }
264
265 public void setCodePage(String codePage){
266 this.codePage=codePage;
267 inputMappingDescriptor.setCodePage(codePage);
268 outputMappingDescriptor.setCodePage(codePage);
269 }
270
271 public String getCodePage(){
272 return codePage;
273 }
274
275
276
277
278
279
280
281
282
283
284 public void setDefaultValuesIfNecessary() {
285 if (getOperationName() == null) {
286 setOperationName("execute");
287 }
288 if (getServiceInterfaceName() == null) {
289 setServiceInterfaceName(getServiceName().concat("Interface"));
290 }
291 if (getInputBeanClassName() == null) {
292 setInputBeanClassName(getServiceName().concat("InputBean"));
293 }
294 if (getOutputBeanClassName() == null) {
295 setOutputBeanClassName(getServiceName().concat("OutputBean"));
296 }
297 }
298 }