This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.77 KB  |  views: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data