1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.datatype.binding;
17
18 import java.util.Vector;
19
20 import org.apache.juddi.datatype.CategoryBag;
21 import org.apache.juddi.datatype.Description;
22 import org.apache.juddi.datatype.KeyedReference;
23 import org.apache.juddi.datatype.RegistryObject;
24
25 /***
26 * Technical web service description. Contains "information relevant for
27 * application programs that need to connect to and then communicate with a
28 * remote Web Service. This information includes the address to make contact
29 * with a Web Service, as well as support for option information that can be
30 * used to describe both hosted services and services that require additional
31 * values to be discovered prior to invoking a service" - technical
32 * whitepaper
33 *
34 * "Technical information about a service entry point and construction
35 * specs" - XML Structure Reference
36 *
37 * @author Steve Viens (sviens@apache.org)
38 */
39 public class BindingTemplate implements RegistryObject
40 {
41
42 String bindingKey;
43
44
45
46 String serviceKey;
47
48
49
50 Vector descVector;
51
52
53
54
55 AccessPoint accessPoint;
56
57
58
59
60
61
62 HostingRedirector hostingRedirector;
63
64
65
66
67 TModelInstanceDetails tModelInstanceDetails;
68
69
70
71
72
73
74 CategoryBag categoryBag;
75
76 /***
77 * Constructs a new empty BindingTemplate.
78 */
79 public BindingTemplate()
80 {
81 }
82
83 /***
84 * Sets the bindingkey of this bindingtemplate to the given key.
85 *
86 * @param key The new bindingkey of this bindingtemplate.
87 */
88 public void setBindingKey(String key)
89 {
90 this.bindingKey = key;
91 }
92
93 /***
94 * Returns the bindingkey of this binding template.
95 * @return The bindingkey of this binding template.
96 */
97 public String getBindingKey()
98 {
99 return this.bindingKey;
100 }
101
102 /***
103 * Sets the servicekey of this bindingtemplate.
104 *
105 * @param key The new service key.
106 */
107 public void setServiceKey(String key)
108 {
109 this.serviceKey = key;
110 }
111
112 /***
113 * Returns the servicekey of this bindingtemplate. This method can return null
114 * if the business service for this binding template has been set and if the
115 * service key for this binding template has not been set.
116 *
117 * @return The servicekey of this bindingtemplate.
118 */
119 public String getServiceKey()
120 {
121 return this.serviceKey;
122 }
123
124 /***
125 * Adds the given description. If there was already a description with the
126 * same language-code as the new description, an exception will be thrown.
127 *
128 * @param desc The description to add.
129 */
130 public void addDescription(Description desc)
131 {
132 if (this.descVector == null)
133 this.descVector = new Vector();
134 this.descVector.add(desc);
135 }
136
137 /***
138 * Sets the description list to the current one. Ignores any object in the
139 * collection that is not an "instanceof" the Description class.
140 *
141 * @param descs Descriptions of Description objects to set
142 */
143 public void setDescriptionVector(Vector descs)
144 {
145 this.descVector = descs;
146 }
147
148 /***
149 * Returns the descriptions.
150 *
151 * @return the descriptions. If the aren't any descriptions, an empty
152 * enumeration is returned.
153 */
154 public Vector getDescriptionVector()
155 {
156 return this.descVector;
157 }
158
159 /***
160 * Sets the AccessPoint of this BindingTemplate. If the new AccessPoint is
161 * not null and if this BindingTemplate also contains a HostingRedirector,
162 * that HostingRedirector is set to null.
163 *
164 * @param point The new AccessPoint of this BindingTemplate.
165 */
166 public void setAccessPoint(AccessPoint point)
167 {
168 this.accessPoint = point;
169 }
170
171 /***
172 * Returns the accesspoint of this binding template.
173 *
174 * @return The accesspoint of this binding template, or null if the hosting
175 * redirector of this binding template has been set.
176 */
177 public AccessPoint getAccessPoint()
178 {
179 return this.accessPoint;
180 }
181
182 /***
183 * Sets the hosting redirector of this BindingTemplate. If the new
184 * HostingRedirector is not null and if this BindingTemplate also contains
185 * an AccessPoint, that AccessPoint is set to null.
186 *
187 * @param director The new HostingRedirector of this BindingTemplate.
188 */
189 public void setHostingRedirector(HostingRedirector director)
190 {
191 this.hostingRedirector = director;
192 }
193
194 /***
195 * Returns the hosting redirector of this binding template.
196 *
197 * @return The hosting redirector of this BindingTemplate, or null if the
198 * AccessPoint of this BindingTemplate has been set.
199 */
200 public HostingRedirector getHostingRedirector()
201 {
202 return this.hostingRedirector;
203 }
204
205
206 /***
207 * Returns the tModelInstanceDetails of this binding template.
208 *
209 * @return The tModelInstanceDetails of this binding template. If this binding
210 * template doesn't contain any tModelInstanceDetails, an empty enumeration is returned.
211 */
212 public TModelInstanceDetails getTModelInstanceDetails()
213 {
214 return this.tModelInstanceDetails;
215 }
216
217 /***
218 * Sets the tModelInstanceDetails of this binding template.
219 */
220 public void setTModelInstanceDetails(TModelInstanceDetails details)
221 {
222 this.tModelInstanceDetails = details;
223 }
224
225 /***
226 * Add a category to the categorybag of this binding template.
227 * @param ref The category to add.
228 */
229 public void addCategory(KeyedReference ref)
230 {
231
232 if (ref == null)
233 return;
234
235
236 if (this.categoryBag == null)
237 this.categoryBag = new CategoryBag();
238
239 this.categoryBag.addKeyedReference(ref);
240 }
241
242 /***
243 * Returns the categorybag of this binding template. If this binding
244 * template doesn't contain any categories, an empty enumeration is
245 * returned.
246 *
247 * @return The categorybag of this binding template.
248 */
249 public CategoryBag getCategoryBag()
250 {
251 return this.categoryBag;
252 }
253
254 /***
255 * Set the categorybag of this binding template to the given one.
256 *
257 * @param bag The new categorybag.
258 */
259 public void setCategoryBag(CategoryBag bag)
260 {
261 this.categoryBag = bag;
262 }
263 }