| ProducerRegistry.java |
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.consumer;
22
23 import java.util.Iterator;
24
25 /**
26 * Defines a registry which can be used to administer
27 * producer objects.
28 *
29 * @author Stephan Laertz
30 **/
31 public interface ProducerRegistry {
32
33 /**
34 * Add a producer to the registry
35 *
36 * @param producer The producer to add
37 */
38 public void addProducer(Producer producer);
39
40 /**
41 * Get the producer for the given URL
42 *
43 * @param id The ID of the producer
44 *
45 * @return The producer with the given ID
46 **/
47 public Producer getProducer(String id);
48
49 /**
50 * Get all producer in the registry
51 *
52 * @return Iterator with all producers
53 **/
54 public Iterator getAllProducers();
55
56 /**
57 * Remove the producer with the given ID from the registry
58 *
59 * @param id The ID of the producer
60 *
61 * @return The producer which had been mapped to this id or
62 * null if no producer was found with this id
63 **/
64 public Producer removeProducer(String id);
65
66 /**
67 * Remove all producer objects from the registry
68 **/
69 public void removeAllProducers();
70
71 /**
72 * Check if a producer with the given ID exists in the registry.
73 *
74 * @param id The ID of the producer
75 *
76 * @return True if producer exists with this ID
77 **/
78 public boolean existsProducer(String id);
79 }