1 | |
package org.kuali.rice.ksb.api.bus.support; |
2 | |
|
3 | |
import javax.xml.bind.annotation.XmlAccessType; |
4 | |
import javax.xml.bind.annotation.XmlAccessorType; |
5 | |
import javax.xml.bind.annotation.XmlElement; |
6 | |
import javax.xml.bind.annotation.XmlRootElement; |
7 | |
import javax.xml.bind.annotation.XmlType; |
8 | |
|
9 | |
@XmlRootElement(name = SoapServiceConfiguration.Constants.ROOT_ELEMENT_NAME) |
10 | |
@XmlAccessorType(XmlAccessType.NONE) |
11 | |
@XmlType(name = SoapServiceConfiguration.Constants.TYPE_NAME, propOrder = { |
12 | |
SoapServiceConfiguration.Elements.SERVICE_INTERFACE, |
13 | |
SoapServiceConfiguration.Elements.JAX_WS_SERVICE |
14 | |
}) |
15 | 3 | public class SoapServiceConfiguration extends AbstractServiceConfiguration { |
16 | |
|
17 | |
private static final long serialVersionUID = -4226512121638441108L; |
18 | |
|
19 | |
@XmlElement(name = Elements.SERVICE_INTERFACE, required = true) |
20 | |
private final String serviceInterface; |
21 | |
|
22 | |
@XmlElement(name = Elements.JAX_WS_SERVICE, required = true) |
23 | |
private final boolean jaxWsService; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
private SoapServiceConfiguration() { |
29 | 7 | super(); |
30 | 7 | this.serviceInterface = null; |
31 | 7 | this.jaxWsService = false; |
32 | 7 | } |
33 | |
|
34 | |
private SoapServiceConfiguration(Builder builder) { |
35 | 3 | super(builder); |
36 | 3 | this.serviceInterface = builder.getServiceInterface(); |
37 | 3 | this.jaxWsService = builder.isJaxWsService(); |
38 | 3 | } |
39 | |
|
40 | |
public static SoapServiceConfiguration fromServiceDefinition(SoapServiceDefinition soapServiceDefinition) { |
41 | 3 | return Builder.create(soapServiceDefinition).build(); |
42 | |
} |
43 | |
|
44 | |
public String getServiceInterface() { |
45 | 0 | return serviceInterface; |
46 | |
} |
47 | |
|
48 | |
public boolean isJaxWsService() { |
49 | 0 | return jaxWsService; |
50 | |
} |
51 | |
|
52 | 72 | public static final class Builder extends AbstractServiceConfiguration.Builder<SoapServiceConfiguration> { |
53 | |
|
54 | |
private static final long serialVersionUID = 722267174667364588L; |
55 | |
|
56 | |
private String serviceInterface; |
57 | 3 | private boolean jaxWsService = false; |
58 | |
|
59 | |
public String getServiceInterface() { |
60 | 3 | return serviceInterface; |
61 | |
} |
62 | |
|
63 | |
public void setServiceInterface(String serviceInterface) { |
64 | 3 | this.serviceInterface = serviceInterface; |
65 | 3 | } |
66 | |
|
67 | |
public boolean isJaxWsService() { |
68 | 3 | return jaxWsService; |
69 | |
} |
70 | |
|
71 | |
public void setJaxWsService(boolean jaxWsService) { |
72 | 3 | this.jaxWsService = jaxWsService; |
73 | 3 | } |
74 | |
|
75 | 6 | private Builder() {} |
76 | |
|
77 | |
public static Builder create() { |
78 | 3 | return new Builder(); |
79 | |
} |
80 | |
|
81 | |
public static Builder create(SoapServiceDefinition soapServiceDefinition) { |
82 | 3 | Builder builder = create(); |
83 | 3 | builder.copyServiceDefinitionProperties(soapServiceDefinition); |
84 | 3 | builder.setServiceInterface(soapServiceDefinition.getServiceInterface()); |
85 | 3 | builder.setJaxWsService(soapServiceDefinition.isJaxWsService()); |
86 | 3 | return builder; |
87 | |
} |
88 | |
|
89 | |
@Override |
90 | |
public SoapServiceConfiguration build() { |
91 | 3 | return new SoapServiceConfiguration(this); |
92 | |
} |
93 | |
|
94 | |
} |
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | 0 | static class Constants { |
100 | |
final static String ROOT_ELEMENT_NAME = "soapServiceConfiguration"; |
101 | |
final static String TYPE_NAME = "SoapServiceConfigurationType"; |
102 | |
} |
103 | |
|
104 | |
|
105 | |
|
106 | |
|
107 | |
|
108 | 0 | static class Elements { |
109 | |
protected final static String SERVICE_INTERFACE = "serviceInterface"; |
110 | |
protected final static String JAX_WS_SERVICE = "jaxWsService"; |
111 | |
} |
112 | |
|
113 | |
} |