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 manage users.
27   * 
28   * @author Stephan Laertz
29   **/
30  public interface UserRegistry {
31  
32      /**
33       * Add a user to the registry
34       *
35       * @param user The user to add
36       *
37       * @return The user added or null
38       **/
39      public User addUser(User user);
40  
41      /**
42       * Get the user with the given id
43       * 
44       * @param userID The ID of the user
45       * 
46       * @return The user object with the given user id
47       **/
48      public User getUser(String userID);
49  
50      /**
51       * Remove a user from the list of known user
52       * 
53       * @param userID The ID of the user 
54       * @return The user which has been removed or null
55       **/
56      public User removeUser(String userID);
57  
58      /**
59       * Remove all users from the registry     
60       **/
61      public void removeAllUsers();
62  
63      /**
64       * Get an iterator with all known users
65       * 
66       * @return All known user objects in an iterator
67       **/
68      public Iterator getAllUsers();
69  }