View Javadoc

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.datastore;
17  
18  import java.util.Vector;
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.binding.BindingTemplate;
26  import org.apache.juddi.datatype.business.BusinessEntity;
27  import org.apache.juddi.datatype.publisher.Publisher;
28  import org.apache.juddi.datatype.request.FindQualifiers;
29  import org.apache.juddi.datatype.response.BusinessInfo;
30  import org.apache.juddi.datatype.response.PublisherInfo;
31  import org.apache.juddi.datatype.response.ServiceInfo;
32  import org.apache.juddi.datatype.response.TModelInfo;
33  import org.apache.juddi.datatype.service.BusinessService;
34  import org.apache.juddi.datatype.tmodel.TModel;
35  import org.apache.juddi.error.RegistryException;
36  
37  /***
38   * @author Steve Viens (sviens@apache.org)
39   */
40  public interface DataStore
41  {
42    /***
43     * release this DataStore
44     */
45    void release();
46  
47    /***
48     * begin transaction
49     */
50    void beginTrans()
51      throws RegistryException;
52  
53    /***
54     * commit transaction
55     */
56    void commit()
57      throws RegistryException;
58  
59    /***
60     * rollback transaction
61     */
62    void rollback()
63      throws RegistryException;
64  
65    /***
66     * verify that the individual or system identified by the 'userID'
67     * is using the correct password and has the 'authority' to publish
68     * to the UDDI registry.
69     *
70     * @param publisherID
71     * @return publisher
72     * @throws RegistryException
73     */
74    Publisher getPublisher(String publisherID)
75      throws RegistryException;
76  
77    /***
78     *
79     * @param publisherID
80     * @return boolean
81     * @throws RegistryException
82     */
83    boolean isAdministrator(String publisherID)
84      throws RegistryException;
85  
86    /***
87     *
88     * @param publisher
89     * @return a secure Token
90     * @throws RegistryException
91     */
92    String generateToken(Publisher publisher)
93      throws RegistryException;
94  
95    /***
96     *
97     */
98    void storeAuthToken(String token,Publisher publisher)
99      throws RegistryException;
100 
101   /***
102    *
103    */
104   void retireAuthToken(String token)
105     throws RegistryException;
106 
107   /***
108    *
109    */
110   Publisher getAuthTokenPublisher(String token)
111     throws RegistryException;
112 
113   /***
114    *
115    */
116   boolean isAuthTokenExpired(String token)
117     throws RegistryException;
118 
119   /***
120    *
121    */
122   void touchAuthToken(String token)
123     throws RegistryException;
124 
125   /***
126    *
127    */
128   void saveBusiness(BusinessEntity business,String publisherID)
129     throws RegistryException;
130 
131   /***
132    *
133    */
134   BusinessEntity fetchBusiness(String businessKey)
135     throws RegistryException;
136 
137   /***
138    *
139    */
140   void deleteBusiness(String businessKey)
141     throws RegistryException;
142 
143   /***
144    *
145    */
146   boolean isBusinessPublisher(String businessKey,String publisherID)
147     throws RegistryException;
148 
149   /***
150    *
151    */
152   boolean isValidBusinessKey(String businessKey)
153     throws RegistryException;
154 
155   /***
156    *
157    */
158   void saveService(BusinessService service)
159     throws RegistryException;
160 
161   /***
162    *
163    */
164   BusinessService fetchService(String serviceKey)
165     throws RegistryException;
166 
167   /***
168    *
169    */
170   void deleteService(String serviceKey)
171     throws RegistryException;
172 
173   /***
174    *
175    */
176   boolean isValidServiceKey(String serviceKey)
177     throws RegistryException;
178 
179   /***
180    *
181    */
182   boolean isServicePublisher(String serviceKey,String publisherID)
183     throws RegistryException;
184 
185   /***
186    *
187    */
188   void saveBinding(BindingTemplate binding)
189     throws RegistryException;
190 
191   /***
192    *
193    */
194   BindingTemplate fetchBinding(String bindingKey)
195     throws RegistryException;
196 
197   /***
198    *
199    */
200   void deleteBinding(String bindingKey)
201     throws RegistryException;
202 
203   /***
204    *
205    */
206   boolean isValidBindingKey(String bindingKey)
207     throws RegistryException;
208 
209   /***
210    *
211    */
212   boolean isBindingPublisher(String bindingKey,String publisherID)
213     throws RegistryException;
214 
215   /***
216    *
217    */
218   void saveTModel(TModel tModel,String publisherID)
219     throws RegistryException;
220 
221   /***
222    *
223    */
224   TModel fetchTModel(String tModelKey)
225     throws RegistryException;
226 
227   /***
228    *
229    */
230   void deleteTModel(String tModelKey)
231     throws RegistryException;
232 
233   /***
234    *
235    */
236   void markTModelAsDeleted(String tModelKey)
237    throws RegistryException;
238 
239   /***
240    *
241    */
242   boolean isValidTModelKey(String tModelKey)
243     throws RegistryException;
244 
245   /***
246    *
247    */
248   boolean isTModelPublisher(String tModelKey,String publisherID)
249     throws RegistryException;
250 
251   /***
252    *
253    */
254   BusinessInfo fetchBusinessInfo(String businessKey)
255     throws RegistryException;
256 
257   /***
258    *
259    */
260   ServiceInfo fetchServiceInfo(String serviceKey)
261     throws RegistryException;
262 
263   /***
264    *
265    */
266   TModelInfo fetchTModelInfo(String tModelKey)
267     throws RegistryException;
268 
269   /***
270    *
271    */
272   Vector findBusiness(Vector nameVector,
273                       DiscoveryURLs discoveryURLs,
274                       IdentifierBag identifierBag,
275                       CategoryBag categoryBag,
276                       TModelBag tModelBag,
277                       FindQualifiers findQualifiers)
278     throws RegistryException;
279 
280   /***
281    *
282    */
283   Vector findService(String businessKey,
284                      Vector names,
285                      CategoryBag categoryBag,
286                      TModelBag tModelBag,
287                      FindQualifiers findQualifiers)
288     throws RegistryException;
289 
290   /***
291    *
292    */
293   Vector findBinding(String serviceKey,
294                      CategoryBag categoryBag,
295                      TModelBag tModelbag,
296                      FindQualifiers findQualifiers)
297     throws RegistryException;
298 
299   /***
300    *
301    */
302   Vector findTModel(String name,
303                     CategoryBag categoryBag,
304                     IdentifierBag identifierBag,
305                     FindQualifiers findQualifiers)
306     throws RegistryException;
307 
308   /***
309    *
310    */
311   Vector findRelatedBusinesses(String businessKey,
312                                KeyedReference keyedReference,
313                                FindQualifiers findQualifiers)
314     throws RegistryException;
315 
316   /***
317    *
318    */
319   Vector findRegisteredBusinesses(String publisherID)
320     throws RegistryException;
321 
322   /***
323    *
324    */
325   Vector findRegisteredTModels(String publisherID)
326     throws RegistryException;
327 
328   /***
329    *
330    */
331   void saveAssertions(String publisherID,Vector assertionVector)
332     throws RegistryException;
333 
334   /***
335    *
336    */
337   void deleteAssertions(String publisherID,Vector assertionVector)
338     throws RegistryException;
339 
340   /***
341    *
342    */
343   Vector getAssertions(String publisherID)
344     throws RegistryException;
345 
346   /***
347    *
348    */
349   Vector setAssertions(String publisherID,Vector assertionVector)
350     throws RegistryException;
351 
352   /***
353    *
354    */
355   Vector getAssertionStatusItems(String publisherID,
356                                  String completionStatus)
357     throws RegistryException;
358 
359   /***
360    *
361    */
362   void savePublisher(Publisher publisher)
363     throws RegistryException;
364 
365   /***
366    *
367    */
368   void deletePublisher(String publisherID)
369     throws RegistryException;
370 
371   /***
372    *
373    */
374   PublisherInfo fetchPublisherInfo(String publisherID)
375     throws RegistryException;
376 
377   /***
378    *
379    */
380   Vector findPublisher(String name,FindQualifiers findQualifiers)
381     throws RegistryException;
382 }