Advertisement
Guest User

Untitled

a guest
May 1st, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import java.util.HashMap;
  2. import java.util.Map;
  3.  
  4. public class SessionCache {
  5.  
  6. public SessionCache() {
  7. }
  8.  
  9.  
  10. /*
  11. * Create object to store sessions
  12. */
  13. Map<String, ActiveSessionsObj> cache = new HashMap<String, ActiveSessionsObj>();
  14.  
  15.  
  16.  
  17. public static class ActiveSessionsObj {
  18.  
  19. public ActiveSessionsObj() {
  20. }
  21.  
  22. }
  23.  
  24. public void addCache(String key, String user, String password) {
  25. /* For storing sessions */
  26. Map<Object,String> cacheData = new HashMap<Object, String>();
  27.  
  28.  
  29. cacheData.put("username", user);
  30. cacheData.put("password", password);
  31.  
  32. cache.put(key, cacheData);
  33.  
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement