KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > wsrp > consumer > impl > UserRegistryImpl


1 /*
2 * Copyright 2001-2004 The eXo platform SARL All rights reserved.
3 * Please look at license.txt in info directory for more license detail.
4 */

5
6 package org.exoplatform.services.wsrp.consumer.impl;
7
8
9 import java.util.Iterator JavaDoc;
10 import java.util.Map JavaDoc;
11 import java.util.HashMap JavaDoc;
12 import org.exoplatform.services.wsrp.consumer.User;
13 import org.exoplatform.services.wsrp.consumer.UserRegistry;
14
15 /*
16  * @author Mestrallet Benjamin
17  * benjmestrallet@users.sourceforge.net
18  * Date: 5 févr. 2004
19  * Time: 13:47:56
20  */

21
22 public class UserRegistryImpl implements UserRegistry{
23
24   private Map JavaDoc users = new HashMap JavaDoc();
25
26   public User addUser(User user) {
27     return (User) users.put(user.getUserID(), user);
28   }
29
30   public User getUser(String JavaDoc userID) {
31     return (User) users.get(userID);
32   }
33
34   public User removeUser(String JavaDoc userID) {
35     return (User) users.remove(userID);
36   }
37
38   public void removeAllUsers() {
39     users.clear();
40   }
41
42   public Iterator JavaDoc getAllUsers() {
43     return users.values().iterator();
44   }
45 }
Popular Tags