KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > tmodel > TModel


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.juddi.datatype.tmodel;
17
18 import java.util.Vector JavaDoc;
19
20 import org.apache.juddi.datatype.CategoryBag;
21 import org.apache.juddi.datatype.Description;
22 import org.apache.juddi.datatype.IdentifierBag;
23 import org.apache.juddi.datatype.KeyedReference;
24 import org.apache.juddi.datatype.Name;
25 import org.apache.juddi.datatype.OverviewDoc;
26 import org.apache.juddi.datatype.RegistryObject;
27
28 /**
29  * "Descriptions of specifications for services or taxonomies. Basis for
30  * technical fingerprints" - XML Structure Reference
31  *
32  * The primary role that the tModel plays is to represent a technical
33  * spec. Implementors of that spec reference the tModel with a tModelKey in
34  * a bindingTemplate in the service definition.
35  *
36  * The other place that a tModel reference is used is in the identifierBag and
37  * categoryBag structures. Used in this context the tModel reference represents
38  * a relationship between the keyed name-value pairs to the namespace within
39  * which they are meaningful. Eg, a tModel named "US tax codes". The tModel
40  * is still a specific concept but instead of being a technical specification
41  * it represents a unique namespace within which tax code IDs have meaning.
42  * Once this meaning is established a business can use the tModelKey for the
43  * tax code tModel as a unique reference that qualifies the entry in the
44  * identifierBag. UDDI has already defined a number of tModels including US tax
45  * codes, NAICS, UNSPC, and an unnamed geographic taxonomy.
46  * (See also KeyedReference).
47  *
48  * @author Steve Viens (sviens@apache.org)
49  */

50 public class TModel implements RegistryObject
51 {
52   /**
53    * UDDI Type Taxonomy [uddi-org:types]
54    * This taxonomy assists in general categorization of the tModels themselves.
55    */

56   public static final String JavaDoc TYPES_TMODEL_KEY = "UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4";
57
58   /**
59    * Business Taxonomy: NAICS (1997 Release) [ntis-gov:naics:1997]
60    * This tModel defines the NAICS (North American Industry Classification
61    * System) 1997 Release industry taxonomy.
62    */

63   public static final String JavaDoc NAICS_TMODEL_KEY = "UUID:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2";
64
65   /**
66    * Product Taxonomy: UNSPSC (Version 3.1) [unspsc-org:unspsc:3-1]
67    * This tModel defines the UNSPSC (United Nations Standard Products and
68    * Services Code System) version 3.1 product taxonomy.
69    * <B>This taxonomy has been superceeded by the Universal Standard Products
70    * and Services Classification (see {@link #UNSPSC_73_TMODEL_KEY}) taxonomy.
71    */

72   public static final String JavaDoc UNSPSC_TMODEL_KEY = "UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384";
73
74   /**
75    * Product and Services Taxonomy:UNSPSC (Version 7.3) [unspsc-org:unspsc]
76    * This tModel defines the UNSPSC (Universal Standard Products and Services
77    * Classification) version 7.3 product and services taxonomy.
78    */

79   public static final String JavaDoc UNSPSC_73_TMODEL_KEY = "UUID:CD153257-086A-4237-B336-6BDCBDCC6634";
80
81   /**
82    * ISO 3166 Geographic Taxonomy [uddi-org:iso-ch:3166-1999]
83    * This tModel defines the ISO 3166 geographic classification taxonomy.
84    */

85   public static final String JavaDoc ISO_CH_TMODEL_KEY = "UUID:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88";
86
87   /**
88    * UDDI Other Taxonomy [uddi-org:misc-taxomony]
89    * This tModel defines an unidentified taxonomy.
90    */

91   public static final String JavaDoc GENERAL_KEYWORDS_TMODEL_KEY = "UUID:A035A07C-F362-44dd-8F95-E2B134BF43B4";
92
93   /**
94    * UDDI Owning Business [uddi-org:owningBusiness]
95    * This tModel identifies the businessEntity that published or owns the
96    * tagged information. Used with tModels to establish an 'owned'
97    * relationship with a registered businessEntity.
98    */

99   public static final String JavaDoc OWNING_BUSINESS_TMODEL_KEY = "UUID:4064C064-6D14-4F35-8953-9652106476A9";
100
101   /**
102    * UDDI businessEntity relationship [uddi-org:relationships]
103    * This tModel is used to describe business relationships. Used in the
104    * publisher assertion messages.
105    */

106   public static final String JavaDoc RELATIONSHIPS_TMODEL_KEY = "UUID:807A2C6A-EE22-470D-ADC7-E0424A337C03";
107
108   /**
109    * UDDI Operators [uddi-org:operators]
110    * This checked value set is used to identify UDDI operators.
111    */

112   public static final String JavaDoc OPERATORS_TMODEL_KEY = "UUID:327A56F0-3299-4461-BC23-5CD513E95C55";
113
114   /**
115    * D-U-N-S� Number Identifier System [dnb-com:D-U-N-S]
116    * This tModel is used for the Dun & Bradstreet D-U-N-S� Number identifier.
117    */

118   public static final String JavaDoc D_U_N_S_TMODEL_KEY = "UUID:8609C81E-EE1F-4D5A-B202-3EB13AD01823";
119
120   /**
121    * Thomas Register Supplier Identifier Code System
122    * [thomasregister-com:supplierID]
123    * This tModel is used for the Thomas Register supplier identifier codes.
124    */

125   public static final String JavaDoc THOMAS_REGISTER_TMODEL_KEY = "UUID:B1B1BAF5-2329-43E6-AE13-BA8E97195039";
126
127   /**
128    * UDDI IsReplacedBy [uddi-org:isReplacedBy]
129    * An identifier system used to point (using UDDI keys) to the tModel
130    * (or businessEntity) that is the logical replacement for the one in
131    * which isReplacedBy is used.
132    */

133   public static final String JavaDoc IS_REPLACED_BY_TMODEL_KEY = "UUID:E59AE320-77A5-11D5-B898-0004AC49CC1E";
134
135   /**
136    * Email based web service [uddi-org:smtp]
137    * This tModel is used to describe a web service that is invoked through
138    * SMTP email transmissions. These transmissions may be between people or
139    * applications.
140    */

141   public static final String JavaDoc SMTP_TMODEL_KEY = "UUID:93335D49-3EFB-48A0-ACEA-EA102B60DDC6";
142
143   /**
144    * Fax based web service [uddi-org:fax]
145    * This tModel is used to describe a web service that is invoked through
146    * fax transmissions. These transmissions may be between people or
147    * applications.
148    */

149   public static final String JavaDoc FAX_TMODEL_KEY = "UUID:1A2B00BE-6E2C-42F5-875B-56F32686E0E7";
150
151   /**
152    * FTP based web service [uddi-org:ftp]
153    * This tModel is used to describe a web service that is invoked through
154    * file transfers via the ftp protocol.
155    */

156   public static final String JavaDoc FTP_TMODEL_KEY = "UUID:5FCF5CD0-629A-4C50-8B16-F94E9CF2A674";
157
158   /**
159    * Telephone based web service [uddi-org:telephone]
160    * This tModel is used to describe a web service that is invoked through a
161    * telephone call and interaction by voice and/or touch-tone.
162    */

163   public static final String JavaDoc TELEPHONE_TMODEL_KEY = "UUID:38E12427-5536-4260-A6F9-B5B530E63A07";
164
165   /**
166    * Web browser or HTTP based web service [uddi-org:http]
167    * This tModel is used to describe a web service that is invoked through a
168    * web browser and/or the HTTP protocol.
169    */

170   public static final String JavaDoc HTTP_TMODEL_KEY = "UUID:68DE9E80-AD09-469D-8A37-088422BFBC36";
171
172   /**
173    * HTTP Web Home Page URL [uddi-org:homepage]
174    * This tModel is used as the bindingTemplate fingerprint for a web home
175    * page reference.
176    */

177   public static final String JavaDoc HOMEPAGE_TMODEL_KEY = "UUID:4CEC1CEF-1F68-4B23-8CB7-8BAA763AEB89";
178
179   String JavaDoc tModelKey;
180   String JavaDoc authorizedName;
181   String JavaDoc operator;
182   String JavaDoc nameValue;
183   Vector JavaDoc descVector;
184   OverviewDoc overviewDoc;
185   IdentifierBag identifierBag;
186   CategoryBag categoryBag;
187
188   /**
189    * Construct a new initialized TModel instance.
190    */

191   public TModel()
192   {
193   }
194
195   /**
196    * Construct a brand new TModel with a given name. Assumes this is a brand
197    * new TModel instance and doesn't have a key yet - one is created in the
198    * constructor.
199    *
200    * @param name The name of the tModel.
201    */

202   public TModel(String JavaDoc name)
203   {
204     this.nameValue = name;
205   }
206
207   /**
208    * Construct a new tModel with a given name and key.
209    *
210    * @param name The name of the tModel, given as a string.
211    * @param key The key of the tModel.
212    */

213   public TModel(String JavaDoc name,String JavaDoc key)
214   {
215     this.nameValue = name;
216     this.tModelKey = key;
217   }
218
219   /**
220    * Sets the key of this tModel to the given key.
221    *
222    * @param key The new key of this tModel.
223    */

224   public void setTModelKey(String JavaDoc key)
225   {
226     this.tModelKey = key;
227   }
228
229   /**
230    * Returns the key of this tModel.
231    *
232    * @return The key of this tModel.
233    *
234    */

235   public String JavaDoc getTModelKey()
236   {
237     return this.tModelKey;
238   }
239
240   /**
241    * Sets the authorized name of this tModel to the given name.
242    *
243    * @param name The new authorized name of this tModel.
244    */

245   public void setAuthorizedName(String JavaDoc name)
246   {
247     this.authorizedName = name;
248   }
249
250   /**
251    * Returns the authorized name of this tModel.
252    *
253    * @return The authorized name of this tModel, or null if this tModel
254    * doesn't have an authorized name.
255    */

256   public String JavaDoc getAuthorizedName()
257   {
258     return this.authorizedName;
259   }
260
261   /**
262    * Sets the name of this tModel to the given name.
263    *
264    * @param name The new name of this tModel.
265    */

266   public void setName(String JavaDoc name)
267   {
268     this.nameValue = name;
269   }
270
271   /**
272    * Returns the name of this tModel.
273    *
274    * @return The name of this tModel.
275    */

276   public String JavaDoc getName()
277   {
278     return this.nameValue;
279   }
280
281   /**
282     * Sets the name of this tModel to the given name.
283     *
284     * @param name The new name of this tModel.
285     */

286   public void setName(Name name)
287   {
288     if (name != null)
289       this.nameValue = name.getValue();
290     else
291       this.nameValue = null;
292   }
293
294   /**
295    * Adds the given description.
296    *
297    * @param descr The description to add.
298    */

299   public void addDescription(Description descr)
300   {
301     // just return if the Description parameter is null (nothing to add)
302
if (descr == null)
303       return;
304
305     if (this.descVector == null)
306       this.descVector = new Vector JavaDoc();
307     this.descVector.add(descr);
308   }
309
310   /**
311    * Sets the description list to the current one. Ignores any object in the
312    * collection that is not an "instanceof" the Description class.
313    *
314    * @param descriptions Collection of Description objects to set
315    */

316   public void setDescriptionVector(Vector JavaDoc descriptions)
317   {
318     this.descVector = descriptions;
319   }
320
321   /**
322    * Returns the descriptions.
323    *
324    * @return the descriptions. If the aren't any descriptions, an empty
325    * enumeration is returned.
326    */

327   public Vector JavaDoc getDescriptionVector()
328   {
329     return this.descVector;
330   }
331
332   /**
333    * Sets the overviewDoc of this tModel to the given overviewDoc.
334    *
335    * @param doc The new overviewDoc of this tModel, or null if this tModel
336    * doesn't have an overviewDoc anymore.
337    */

338   public void setOverviewDoc(OverviewDoc doc)
339   {
340     this.overviewDoc = doc;
341   }
342
343   /**
344    * Returns the overviewDoc of this tModel.
345    *
346    * @return The overviewDoc of this tModel, or null if this tModel doesn't have an overviewDoc.
347    */

348   public OverviewDoc getOverviewDoc()
349   {
350     return this.overviewDoc;
351   }
352
353   /**
354    * Sets the operator of this tModel to the given operator.
355    *
356    * @param operator The new operator of this tModel.
357    */

358   public void setOperator(String JavaDoc operator)
359   {
360     this.operator = operator;
361   }
362
363   /**
364    * Returns the operator of this tModel.
365    *
366    * @return The operator of this tModel, or null if this tModel
367    * doesn't have an operator.
368    */

369   public String JavaDoc getOperator()
370   {
371     return this.operator;
372   }
373
374   /**
375    * Add a new identifier to this tModel.
376    *
377    * @param k The identifier to add.
378    */

379   public void addIdentifier(KeyedReference k)
380   {
381     if (this.identifierBag == null)
382       this.identifierBag = new IdentifierBag();
383     this.identifierBag.addKeyedReference(k);
384   }
385
386   /**
387    * Returns the identifierbag of this tModel.
388    *
389    * @return The identifierbag of this tModel. If this tModel doesn't
390    * contain any identifiers, an empty enumeration is returned.
391    */

392   public IdentifierBag getIdentifierBag()
393   {
394     return this.identifierBag;
395   }
396
397   /**
398    * Set the categorybag of this business entity to the given one.
399    *
400    * @param bag The new categorybag.
401    */

402   public void setIdentifierBag(IdentifierBag bag)
403   {
404     this.identifierBag = bag;
405   }
406
407   /**
408    * Add a new category to this tModel.
409    *
410    * @param keyedRef The category to add.
411    */

412   public void addCategory(KeyedReference keyedRef)
413   {
414     if (this.categoryBag == null)
415       this.categoryBag = new CategoryBag();
416     this.categoryBag.addKeyedReference(keyedRef);
417   }
418
419   /**
420    * Returns the categorybag of this tModel.
421    *
422    * @return The categorybag of this tModel. If this tModel doesn't
423    * contain any categories, an empty enumeration is returned.
424    */

425   public CategoryBag getCategoryBag()
426   {
427     return this.categoryBag;
428   }
429
430   /**
431    * Set the categorybag of this business entity to the given one.
432    *
433    * @param bag The new categorybag.
434    */

435   public void setCategoryBag(CategoryBag bag)
436   {
437     this.categoryBag = bag;
438   }
439 }
Popular Tags