1   /*
2    * Copyright 2000-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  
17  /* 
18  
19   */
20  
21  package org.apache.wsrp4j.producer;
22  
23  import java.util.Iterator;
24  
25  import oasis.names.tc.wsrp.v1.types.RegistrationData;
26  
27  import org.apache.wsrp4j.exception.WSRPException;
28  
29  /**
30   * This interface provides access to the ConsumerRegistry. The ConsumerRegistry
31   * keeps all Consumer registrations with this Producer. All registrations are
32   * identified by a registration handle.
33   *
34   * @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
35   */
36  public interface ConsumerRegistry {
37  
38      /**
39       * Provides information about whether this producer requires
40       * registration or not.
41       *
42       * @return A boolean indicating whether registration is required or not.
43       */
44      public boolean isRegistrationRequired();
45  
46      /**
47       * Creates a new registration-object for a certain consumer,
48       * adds it to the consumer registry and returns it.
49       *
50       * @param  registrationData RegistrationData-object
51       *
52       * @return new registration-object
53       */
54      public Registration register(RegistrationData registrationData)
55              throws WSRPException;
56  
57      /**
58       * Returns a certain registration identified by regHandle.
59       *
60       * @param  regHandle    String representing the regHandle.
61       *
62       * @return registration-object identified by regHandle.
63       */
64      public Registration get(String regHandle);
65  
66      /**
67       * Returns all registrations (of all consumers) currently stored
68       * in the consumer registry.
69       *
70       * @return Iterator of a registration collection containing all
71       *         registrations.
72       */
73      public Iterator getAll();
74  
75      /**
76       * Deletes the registration of a certain consumer (identified by regHandle).
77       *
78       * @param regHandle  String representing the regHandle.
79       */
80      public void deregister(String regHandle);
81  
82      /**
83       * Evaluates whether a consumer identified by regHandle is registered or not.
84       *
85       * @param regHandle  String representing the regHandle.
86       *
87       * @returns A boolean indicating whether registration exists or not.
88       *          Returns true if registration exists, else false.
89       */
90      public boolean check(String regHandle);
91  
92  }