1 5 6 package org.exoplatform.services.wsrp.consumer.impl; 7 8 9 import java.util.Iterator ; 10 import java.util.Map ; 11 import java.util.HashMap ; 12 import org.exoplatform.services.wsrp.consumer.User; 13 import org.exoplatform.services.wsrp.consumer.UserRegistry; 14 15 21 22 public class UserRegistryImpl implements UserRegistry{ 23 24 private Map users = new HashMap (); 25 26 public User addUser(User user) { 27 return (User) users.put(user.getUserID(), user); 28 } 29 30 public User getUser(String userID) { 31 return (User) users.get(userID); 32 } 33 34 public User removeUser(String userID) { 35 return (User) users.remove(userID); 36 } 37 38 public void removeAllUsers() { 39 users.clear(); 40 } 41 42 public Iterator getAllUsers() { 43 return users.values().iterator(); 44 } 45 } | Popular Tags |