KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > AbstractRegistry


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;
17
18 import java.util.Vector JavaDoc;
19
20 import org.apache.juddi.datatype.CategoryBag;
21 import org.apache.juddi.datatype.DiscoveryURLs;
22 import org.apache.juddi.datatype.IdentifierBag;
23 import org.apache.juddi.datatype.KeyedReference;
24 import org.apache.juddi.datatype.TModelBag;
25 import org.apache.juddi.datatype.request.AddPublisherAssertions;
26 import org.apache.juddi.datatype.request.AuthInfo;
27 import org.apache.juddi.datatype.request.DeleteBinding;
28 import org.apache.juddi.datatype.request.DeleteBusiness;
29 import org.apache.juddi.datatype.request.DeletePublisher;
30 import org.apache.juddi.datatype.request.DeletePublisherAssertions;
31 import org.apache.juddi.datatype.request.DeleteService;
32 import org.apache.juddi.datatype.request.DeleteTModel;
33 import org.apache.juddi.datatype.request.DiscardAuthToken;
34 import org.apache.juddi.datatype.request.FindBinding;
35 import org.apache.juddi.datatype.request.FindBusiness;
36 import org.apache.juddi.datatype.request.FindPublisher;
37 import org.apache.juddi.datatype.request.FindQualifiers;
38 import org.apache.juddi.datatype.request.FindRelatedBusinesses;
39 import org.apache.juddi.datatype.request.FindService;
40 import org.apache.juddi.datatype.request.FindTModel;
41 import org.apache.juddi.datatype.request.GetAssertionStatusReport;
42 import org.apache.juddi.datatype.request.GetAuthToken;
43 import org.apache.juddi.datatype.request.GetBindingDetail;
44 import org.apache.juddi.datatype.request.GetBusinessDetail;
45 import org.apache.juddi.datatype.request.GetBusinessDetailExt;
46 import org.apache.juddi.datatype.request.GetPublisherAssertions;
47 import org.apache.juddi.datatype.request.GetPublisherDetail;
48 import org.apache.juddi.datatype.request.GetRegisteredInfo;
49 import org.apache.juddi.datatype.request.GetRegistryInfo;
50 import org.apache.juddi.datatype.request.GetServiceDetail;
51 import org.apache.juddi.datatype.request.GetTModelDetail;
52 import org.apache.juddi.datatype.request.SaveBinding;
53 import org.apache.juddi.datatype.request.SaveBusiness;
54 import org.apache.juddi.datatype.request.SavePublisher;
55 import org.apache.juddi.datatype.request.SaveService;
56 import org.apache.juddi.datatype.request.SaveTModel;
57 import org.apache.juddi.datatype.request.SetPublisherAssertions;
58 import org.apache.juddi.datatype.request.ValidateValues;
59 import org.apache.juddi.datatype.response.AssertionStatusReport;
60 import org.apache.juddi.datatype.response.AuthToken;
61 import org.apache.juddi.datatype.response.BindingDetail;
62 import org.apache.juddi.datatype.response.BusinessDetail;
63 import org.apache.juddi.datatype.response.BusinessDetailExt;
64 import org.apache.juddi.datatype.response.BusinessList;
65 import org.apache.juddi.datatype.response.DispositionReport;
66 import org.apache.juddi.datatype.response.PublisherAssertions;
67 import org.apache.juddi.datatype.response.PublisherDetail;
68 import org.apache.juddi.datatype.response.PublisherList;
69 import org.apache.juddi.datatype.response.RegisteredInfo;
70 import org.apache.juddi.datatype.response.RegistryInfo;
71 import org.apache.juddi.datatype.response.RelatedBusinessesList;
72 import org.apache.juddi.datatype.response.ServiceDetail;
73 import org.apache.juddi.datatype.response.ServiceList;
74 import org.apache.juddi.datatype.response.TModelDetail;
75 import org.apache.juddi.datatype.response.TModelList;
76 import org.apache.juddi.error.RegistryException;
77
78 /**
79  * Represents a vesion 2.0 UDDI registry and implements all
80  * services as specified in the UDDI version 2.0 specification.
81  *
82  * @author Steve Viens (sviens@apache.org)
83  */

84 public abstract class AbstractRegistry implements IRegistry
85 {
86   /**
87    * @exception RegistryException;
88    */

89   public DispositionReport addPublisherAssertions(AuthInfo authInfo,Vector JavaDoc assertionVector)
90     throws RegistryException
91   {
92     AddPublisherAssertions request = new AddPublisherAssertions();
93     request.setAuthInfo(authInfo);
94     request.setPublisherAssertionVector(assertionVector);
95
96     return (DispositionReport)execute(request);
97   }
98
99   /**
100    * "Used to remove an existing bindingTemplate from the bindingTemplates
101    * collection that is part of a specified businessService structure."
102    *
103    * @exception RegistryException;
104    */

105   public DispositionReport deleteBinding(AuthInfo authInfo,Vector JavaDoc bindingKeyVector)
106     throws RegistryException
107   {
108     DeleteBinding request = new DeleteBinding();
109     request.setAuthInfo(authInfo);
110     request.setBindingKeyVector(bindingKeyVector);
111
112     return (DispositionReport)execute(request);
113   }
114
115   /**
116    * "Used to delete registered businessEntity information from the registry."
117    *
118    * @exception RegistryException;
119    */

120   public DispositionReport deleteBusiness(AuthInfo authInfo,Vector JavaDoc businessKeyVector)
121     throws RegistryException
122   {
123     DeleteBusiness request = new DeleteBusiness();
124     request.setAuthInfo(authInfo);
125     request.setBusinessKeyVector(businessKeyVector);
126
127     return (DispositionReport)execute(request);
128   }
129
130   /**
131    * "Used to delete an existing publisher accounts."
132    *
133    * @exception RegistryException;
134    */

135   public DispositionReport deletePublisher(AuthInfo authInfo,Vector JavaDoc publisherIDVector)
136     throws RegistryException
137   {
138     DeletePublisher request = new DeletePublisher();
139     request.setAuthInfo(authInfo);
140     request.setPublisherIDVector(publisherIDVector);
141
142     return (DispositionReport)execute(request);
143   }
144
145   /**
146    * @exception RegistryException;
147    */

148   public DispositionReport deletePublisherAssertions(AuthInfo authInfo,Vector JavaDoc assertionVector)
149     throws RegistryException
150   {
151     DeletePublisherAssertions request = new DeletePublisherAssertions();
152     request.setAuthInfo(authInfo);
153     request.setPublisherAssertionVector(assertionVector);
154
155     return (DispositionReport)execute(request);
156   }
157
158   /**
159    * "Used to delete an existing businessService from the businessServices
160    * collection that is part of a specified businessEntity."
161    *
162    * @exception RegistryException;
163    */

164   public DispositionReport deleteService(AuthInfo authInfo,Vector JavaDoc serviceKeyVector)
165     throws RegistryException
166   {
167     DeleteService request = new DeleteService();
168     request.setAuthInfo(authInfo);
169     request.setServiceKeyVector(serviceKeyVector);
170
171     return (DispositionReport)execute(request);
172   }
173
174   /**
175    * "Used to delete registered information about a tModel. If there
176    * are any references to a tModel when this call is made, the tModel
177    * will be marked deleted instead of being physically removed."
178    *
179    * @exception RegistryException;
180    */

181   public DispositionReport deleteTModel(AuthInfo authInfo,Vector JavaDoc tModelKeyVector)
182     throws RegistryException
183   {
184     DeleteTModel request = new DeleteTModel();
185     request.setAuthInfo(authInfo);
186     request.setTModelKeyVector(tModelKeyVector);
187
188     return (DispositionReport)execute(request);
189   }
190
191   /**
192    * "Used to inform an Operator Site that a previously provided
193    * authentication token is no longer valid. See get_authToken."
194    *
195    * @exception RegistryException;
196    */

197   public DispositionReport discardAuthToken(AuthInfo authInfo)
198     throws RegistryException
199   {
200     DiscardAuthToken request = new DiscardAuthToken();
201     request.setAuthInfo(authInfo);
202
203     return (DispositionReport)execute(request);
204   }
205
206   /**
207    * "Used to locate specific bindings within a registered
208    * businessService. Returns a bindingDetail message."
209    *
210    * @exception RegistryException
211    */

212   public BindingDetail findBinding(String JavaDoc serviceKey,CategoryBag categoryBag,TModelBag tModelBag,FindQualifiers findQualifiers,int maxRows)
213     throws RegistryException
214   {
215     FindBinding request = new FindBinding();
216     request.setServiceKey(serviceKey);
217     request.setCategoryBag(categoryBag);
218     request.setTModelBag(tModelBag);
219     request.setFindQualifiers(findQualifiers);
220     request.setMaxRows(maxRows);
221
222     return (BindingDetail)execute(request);
223   }
224
225   /**
226    * Used to locate information about one or more businesses. Returns a
227    * businessList message that matches the conditions specified.
228    *
229    * @exception RegistryException;
230    */

231   public BusinessList findBusiness(Vector JavaDoc nameVector,DiscoveryURLs discoveryURLs,IdentifierBag identifierBag,CategoryBag categoryBag,TModelBag tModelBag,FindQualifiers findQualifiers,int maxRows)
232     throws RegistryException
233   {
234     FindBusiness request = new FindBusiness();
235     request.setNameVector(nameVector);
236     request.setDiscoveryURLs(discoveryURLs);
237     request.setIdentifierBag(identifierBag);
238     request.setCategoryBag(categoryBag);
239     request.setTModelBag(tModelBag);
240     request.setFindQualifiers(findQualifiers);
241     request.setMaxRows(maxRows);
242
243     return (BusinessList)execute(request);
244   }
245
246   /**
247    * @exception RegistryException;
248    */

249   public PublisherList findPublisher(String JavaDoc publisherID,String JavaDoc name,FindQualifiers findQualifiers,int maxRows)
250     throws RegistryException
251   {
252     FindPublisher request = new FindPublisher();
253     request.setName(name);
254     request.setFindQualifiers(findQualifiers);
255     request.setMaxRows(maxRows);
256
257     return (PublisherList)execute(request);
258   }
259
260   /**
261    * @exception RegistryException;
262    */

263   public RelatedBusinessesList findRelatedBusinesses(String JavaDoc businessKey,KeyedReference keyedReference,FindQualifiers findQualifiers,int maxRows)
264     throws RegistryException
265   {
266     FindRelatedBusinesses request = new FindRelatedBusinesses();
267     request.setBusinessKey(businessKey);
268     request.setKeyedReference(keyedReference);
269     request.setFindQualifiers(findQualifiers);
270     request.setMaxRows(maxRows);
271
272     return (RelatedBusinessesList)execute(request);
273   }
274
275   /**
276    * "Used to locate specific services within a registered
277    * businessEntity. Return a serviceList message." From the
278    * XML spec (API, p18) it appears that the name, categoryBag,
279    * and tModelBag arguments are mutually exclusive.
280    *
281    * @exception RegistryException;
282    */

283   public ServiceList findService(String JavaDoc businessKey,Vector JavaDoc nameVector,CategoryBag categoryBag,TModelBag tModelBag,FindQualifiers findQualifiers,int maxRows)
284     throws RegistryException
285   {
286     FindService request = new FindService();
287     request.setBusinessKey(businessKey);
288     request.setNameVector(nameVector);
289     request.setCategoryBag(categoryBag);
290     request.setTModelBag(tModelBag);
291     request.setFindQualifiers(findQualifiers);
292     request.setMaxRows(maxRows);
293
294     return (ServiceList)execute(request);
295   }
296
297   /**
298    * "Used to locate one or more tModel information structures. Returns a
299    * tModelList structure."
300    *
301    * @exception RegistryException;
302    */

303   public TModelList findTModel(String JavaDoc name,CategoryBag categoryBag,IdentifierBag identifierBag,FindQualifiers findQualifiers,int maxRows)
304     throws RegistryException
305   {
306     FindTModel request = new FindTModel();
307     request.setName(name);
308     request.setCategoryBag(categoryBag);
309     request.setIdentifierBag(identifierBag);
310     request.setFindQualifiers(findQualifiers);
311     request.setMaxRows(maxRows);
312
313     return (TModelList)execute(request);
314   }
315
316   /**
317    * @exception RegistryException;
318    */

319   public AssertionStatusReport getAssertionStatusReport(AuthInfo authInfo,String JavaDoc completionStatus)
320     throws RegistryException
321   {
322     GetAssertionStatusReport request = new GetAssertionStatusReport();
323     request.setAuthInfo(authInfo);
324     request.setCompletionStatus(completionStatus);
325
326     return (AssertionStatusReport)execute(request);
327   }
328
329   /**
330    * "Used to request an authentication token from an Operator Site.
331    * Authentication tokens are required to use all other APIs defined
332    * in the publishers API. This server serves as the program's
333    * equivalent of a login request."
334    *
335    * @exception RegistryException;
336    */

337   public AuthToken getAuthToken(String JavaDoc userID,String JavaDoc cred)
338     throws RegistryException
339   {
340     GetAuthToken request = new GetAuthToken();
341     request.setUserID(userID);
342     request.setCredential(cred);
343
344     return (AuthToken)execute(request);
345   }
346
347   /**
348    * Used to get full bindingTemplate information suitable for a
349    * particular business service. Returns a bindingDetail message.
350    *
351    * @exception RegistryException;
352    */

353   public BindingDetail getBindingDetail(String JavaDoc bindingKey)
354     throws RegistryException
355   {
356     Vector JavaDoc keys = new Vector JavaDoc(1);
357     keys.addElement(bindingKey);
358     
359     return getBindingDetail(keys);
360   }
361
362   /**
363    * "Used to get full bindingTemplate information suitable for make one
364    * or more service requests. Returns a bindingDetail message."
365    *
366    * @exception RegistryException;
367    */

368   public BindingDetail getBindingDetail(Vector JavaDoc bindingKeys)
369     throws RegistryException
370   {
371     GetBindingDetail request = new GetBindingDetail();
372     request.setBindingKeyVector(bindingKeys);
373
374     return (BindingDetail)execute(request);
375   }
376
377   /**
378    * Used to get the full businessEntity information for a
379    * particular business entity. Returns a businessDetail message.
380    *
381    * @exception RegistryException;
382    */

383   public BusinessDetail getBusinessDetail(String JavaDoc businessKey)
384     throws RegistryException
385   {
386     Vector JavaDoc keys = new Vector JavaDoc(1);
387     keys.addElement(businessKey);
388
389     return getBusinessDetail(keys);
390   }
391
392   /**
393    * "Used to get the full businessEntity information for one or more
394    * businesses. Returns a businessDetail message."
395    *
396    * @exception RegistryException;
397    */

398   public BusinessDetail getBusinessDetail(Vector JavaDoc businessKeyVector)
399     throws RegistryException
400   {
401     GetBusinessDetail request = new GetBusinessDetail();
402     request.setBusinessKeyVector(businessKeyVector);
403
404     return (BusinessDetail)execute(request);
405   }
406
407   /**
408    * "Used to get extended businessEntity information. Returns a
409    * businessDetailExt message."
410    *
411    * @exception RegistryException;
412    */

413   public BusinessDetailExt getBusinessDetailExt(String JavaDoc businessKey)
414     throws RegistryException
415   {
416     Vector JavaDoc keys = new Vector JavaDoc(1);
417     keys.addElement(businessKey);
418
419     return getBusinessDetailExt(keys);
420   }
421
422   /**
423    * "Used to get extended businessEntity information. Returns a
424    * businessDetailExt message."
425    *
426    * @exception RegistryException;
427    */

428   public BusinessDetailExt getBusinessDetailExt(Vector JavaDoc businessKeyVector)
429     throws RegistryException
430   {
431     GetBusinessDetailExt request = new GetBusinessDetailExt();
432     request.setBusinessKeyVector(businessKeyVector);
433
434     return (BusinessDetailExt)execute(request);
435   }
436
437   /**
438    * @exception RegistryException;
439    */

440   public PublisherAssertions getPublisherAssertions(AuthInfo authInfo)
441     throws RegistryException
442   {
443     GetPublisherAssertions request = new GetPublisherAssertions();
444     request.setAuthInfo(authInfo);
445
446     return (PublisherAssertions)execute(request);
447   }
448
449   /**
450    * @exception RegistryException;
451    */

452   public PublisherDetail getPublisherDetail(Vector JavaDoc publisherIDVector)
453     throws RegistryException
454   {
455     GetPublisherDetail request = new GetPublisherDetail();
456     request.setPublisherIDVector(publisherIDVector);
457
458     return (PublisherDetail)execute(request);
459   }
460
461   /**
462    * "Used to request an abbreviated synopsis of all information currently
463    * managed by a given individual."
464    *
465    * @exception RegistryException;
466    */

467   public RegisteredInfo getRegisteredInfo(AuthInfo authInfo)
468     throws RegistryException
469   {
470     GetRegisteredInfo request = new GetRegisteredInfo();
471     request.setAuthInfo(authInfo);
472
473     return (RegisteredInfo)execute(request);
474   }
475
476   /**
477    * "Used to request an abbreviated synopsis of all information currently
478    * managed by a given individual."
479    *
480    * @exception RegistryException;
481    */

482   public RegistryInfo getRegistryInfo()
483     throws RegistryException
484   {
485     GetRegistryInfo request = new GetRegistryInfo();
486
487     return (RegistryInfo)execute(request);
488   }
489
490   /**
491    * "Used to get full details for a particular registered
492    * businessService. Returns a serviceDetail message."
493    *
494    * @exception RegistryException;
495    */

496   public ServiceDetail getServiceDetail(String JavaDoc serviceKey)
497     throws RegistryException
498   {
499     Vector JavaDoc keys = new Vector JavaDoc(1);
500     keys.addElement(serviceKey);
501
502     return getServiceDetail(keys);
503   }
504
505   /**
506    * "Used to get full details for a given set of registered
507    * businessService data. Returns a serviceDetail message."
508    *
509    * @exception RegistryException;
510    */

511   public ServiceDetail getServiceDetail(Vector JavaDoc serviceKeyVector)
512     throws RegistryException
513   {
514     GetServiceDetail request = new GetServiceDetail();
515     request.setServiceKeyVector(serviceKeyVector);
516
517     return (ServiceDetail)execute(request);
518   }
519
520   /**
521    * "Used to get full details for a particular registered
522    * TModel. Returns a tModelDetail message."
523    *
524    * @exception RegistryException;
525    */

526   public TModelDetail getTModelDetail(String JavaDoc tModelKey)
527     throws RegistryException
528   {
529     Vector JavaDoc keys = new Vector JavaDoc(1);
530     keys.addElement(tModelKey);
531
532     return getTModelDetail(keys);
533   }
534
535   /**
536    * "Used to get full details for a given set of registered tModel
537    * data. Returns a tModelDetail message."
538    *
539    * @exception RegistryException;
540    */

541   public TModelDetail getTModelDetail(Vector JavaDoc tModelKeyVector)
542     throws RegistryException
543   {
544     GetTModelDetail request = new GetTModelDetail();
545     request.setTModelKeyVector(tModelKeyVector);
546
547     return (TModelDetail)execute(request);
548   }
549
550   /**
551    * "Used to register new bindingTemplate information or update existing
552    * bindingTemplate information. Use this to control information about
553    * technical capabilities exposed by a registered business."
554    *
555    * @exception RegistryException;
556    */

557   public BindingDetail saveBinding(AuthInfo authInfo,Vector JavaDoc bindingVector)
558     throws RegistryException
559   {
560     SaveBinding request = new SaveBinding();
561     request.setAuthInfo(authInfo);
562     request.setBindingTemplateVector(bindingVector);
563
564     return (BindingDetail)execute(request);
565   }
566
567   /**
568    * "Used to register new businessEntity information or update existing
569    * businessEntity information. Use this to control the overall
570    * information about the entire business. Of the save_x APIs this one
571    * has the broadest effect."
572    *
573    * @exception RegistryException;
574    */

575   public BusinessDetail saveBusiness(AuthInfo authInfo,Vector JavaDoc businessVector)
576     throws RegistryException
577   {
578     SaveBusiness request = new SaveBusiness();
579     request.setAuthInfo(authInfo);
580     request.setBusinessEntityVector(businessVector);
581
582     return (BusinessDetail)execute(request);
583   }
584
585   /**
586    * @exception RegistryException;
587    */

588   public PublisherDetail savePublisher(AuthInfo authInfo,Vector JavaDoc publisherVector)
589     throws RegistryException
590   {
591     SavePublisher request = new SavePublisher();
592     request.setAuthInfo(authInfo);
593     request.setPublisherVector(publisherVector);
594
595     return (PublisherDetail)execute(request);
596   }
597
598   /**
599    * "Used to register or update complete information about a businessService
600    * exposed by a specified businessEntity."
601    *
602    * @exception RegistryException;
603    */

604   public ServiceDetail saveService(AuthInfo authInfo,Vector JavaDoc serviceVector)
605     throws RegistryException
606   {
607     SaveService request = new SaveService();
608     request.setAuthInfo(authInfo);
609     request.setServiceVector(serviceVector);
610
611     return (ServiceDetail)execute(request);
612   }
613
614   /**
615    * "Used to register or update complete information about a tModel."
616    *
617    * @exception RegistryException;
618    */

619   public TModelDetail saveTModel(AuthInfo authInfo,Vector JavaDoc tModelVector)
620     throws RegistryException
621   {
622     SaveTModel request = new SaveTModel();
623     request.setAuthInfo(authInfo);
624     request.setTModelVector(tModelVector);
625
626     return (TModelDetail)execute(request);
627   }
628
629   /**
630    * @exception RegistryException;
631    */

632   public PublisherAssertions setPublisherAssertions(AuthInfo authInfo,Vector JavaDoc assertionVector)
633     throws RegistryException
634   {
635     SetPublisherAssertions request = new SetPublisherAssertions();
636     request.setAuthInfo(authInfo);
637     request.setPublisherAssertionVector(assertionVector);
638
639     return (PublisherAssertions)execute(request);
640   }
641
642   /**
643    * @exception RegistryException;
644    */

645   public DispositionReport validateValues(Vector JavaDoc businessVector,Vector JavaDoc serviceVector,Vector JavaDoc tModelVector)
646     throws RegistryException
647   {
648     ValidateValues request = new ValidateValues();
649     request.setBusinessEntityVector(businessVector);
650     request.setBusinessServiceVector(serviceVector);
651     request.setTModelVector(tModelVector);
652
653     return (DispositionReport)execute(request);
654   }
655 }
Popular Tags