|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
WebServiceRtService.java | - | 0% | 0% | 0% |
|
1 | /** | |
2 | * JTRunner is free software; you can redistribute it and/or modify it under the | |
3 | * terms of the GNU General Public License as published by the Free Software | |
4 | * Foundation; either version 2, or (at your option) any later version. | |
5 | */ | |
6 | ||
7 | package jtr.ws.wsif; | |
8 | ||
9 | import java.util.HashMap; | |
10 | ||
11 | import javax.xml.namespace.QName; | |
12 | ||
13 | import org.apache.wsif.WSIFService; | |
14 | ||
15 | /** | |
16 | * This is the WSIF-based representation of a typical service definition.<br> | |
17 | * As you might infer from the WSDL formal definition, a service may expose | |
18 | * both multiple <code>portType</code>s and multiple <code>port</code>s. | |
19 | * This is reflected by the <code>WebServiceRtService</code> class. | |
20 | * | |
21 | * @author Francesco Russo (frusso@dev.java.net) | |
22 | * @version 4.0 | |
23 | * @since 3.0 | |
24 | */ | |
25 | public class WebServiceRtService { | |
26 | /** | |
27 | * Default constructor. | |
28 | */ | |
29 | 0 | public WebServiceRtService() { |
30 | 0 | ports = new HashMap<String,WebServiceRtPort>(); |
31 | } | |
32 | ||
33 | /** | |
34 | * Returns the qualified name of the service. | |
35 | * @return QName The qualifie nName | |
36 | */ | |
37 | 0 | public QName getQualifiedName() { |
38 | 0 | return qualifiedName; |
39 | } | |
40 | ||
41 | /** | |
42 | * Set the qualified name of the service. | |
43 | * @param qualifiedName | |
44 | * The qualified name to set. | |
45 | */ | |
46 | 0 | public void setQualifiedName(QName qualifiedName) { |
47 | 0 | this.qualifiedName = qualifiedName; |
48 | } | |
49 | ||
50 | /** | |
51 | * Returns the configured <code>port</code>'s | |
52 | * @return HashMap<String, WebServiceRtPort> The ports. | |
53 | */ | |
54 | 0 | public HashMap<String, WebServiceRtPort> getPorts() { |
55 | 0 | return ports; |
56 | } | |
57 | ||
58 | /** | |
59 | * Set the configured <code>port</code>'s of the service. | |
60 | * @param ports | |
61 | * The ports to set. | |
62 | */ | |
63 | 0 | public void setPorts(HashMap<String, WebServiceRtPort> ports) { |
64 | 0 | this.ports = ports; |
65 | } | |
66 | ||
67 | /** | |
68 | * Add a simgle <code>port</code> to the set of configured onse. | |
69 | * @param portName The logical name of the <code>port</code> | |
70 | * @param port The <code>port</code> | |
71 | */ | |
72 | 0 | public void addPort(String portName, WebServiceRtPort port) { |
73 | 0 | ports.put(portName, port); |
74 | } | |
75 | ||
76 | /** | |
77 | * Retrieve the <code>WebServiceRtPort</code> registered with the | |
78 | * provided name. | |
79 | * @param portName The port's logical name | |
80 | * @return WebServiceRtPort The associated port if it exists, null otherwise | |
81 | */ | |
82 | 0 | public WebServiceRtPort getPort(String portName) { |
83 | 0 | return ports.get(portName); |
84 | } | |
85 | ||
86 | /** | |
87 | * Get all the configured <code>portType</code>s. | |
88 | * @return HashMap<QName, WebServiceRtPortType> The <code>portType</code>s. | |
89 | */ | |
90 | 0 | public HashMap<QName, WebServiceRtPortType> getPortTypes() { |
91 | 0 | return portTypes; |
92 | } | |
93 | ||
94 | /** | |
95 | * Set the available <code>portType</code>s. | |
96 | * @param portTypes | |
97 | * The portTypes to set. | |
98 | */ | |
99 | 0 | public void setPortTypes(HashMap<QName, WebServiceRtPortType> portTypes) { |
100 | 0 | this.portTypes = portTypes; |
101 | } | |
102 | ||
103 | /** | |
104 | * Add a single <code>portType</code> to the set of configured ones. | |
105 | * @param qName The qualified name | |
106 | * @param portType the <code>WebServiceRtPortType</code> instance | |
107 | */ | |
108 | 0 | public void addPortType(QName qName, WebServiceRtPortType portType) { |
109 | 0 | portTypes.put(qName, portType); |
110 | } | |
111 | ||
112 | /** | |
113 | * Retrieve a <code>portType</code> by name. | |
114 | * @param qName The qualified name | |
115 | * @return WebServiceRtPortType The <code>WebServiceRtPortType</code> if registered, null otherwise. | |
116 | */ | |
117 | 0 | public WebServiceRtPortType getPortType(QName qName) { |
118 | 0 | return portTypes.get(qName); |
119 | } | |
120 | ||
121 | /** | |
122 | * Returns the service as a <code>WSIFService</code> instance. | |
123 | * @return WSIFService Returns the service. | |
124 | */ | |
125 | 0 | public WSIFService getService() { |
126 | 0 | return service; |
127 | } | |
128 | ||
129 | /** | |
130 | * Sets the service. | |
131 | * @param service | |
132 | * The service to set. | |
133 | */ | |
134 | 0 | public void setService(WSIFService service) { |
135 | 0 | this.service = service; |
136 | } | |
137 | ||
138 | private WSIFService service; | |
139 | ||
140 | private QName qualifiedName; | |
141 | ||
142 | private HashMap<QName, WebServiceRtPortType> portTypes; | |
143 | ||
144 | private HashMap<String, WebServiceRtPort> ports; | |
145 | } |
|