1 17 package org.alfresco.filesys.server; 18 19 import java.util.Enumeration ; 20 import java.util.Hashtable ; 21 22 25 public class SrvSessionList 26 { 27 28 30 private Hashtable <Integer , SrvSession> m_sessions; 31 32 35 public SrvSessionList() 36 { 37 m_sessions = new Hashtable <Integer , SrvSession>(); 38 } 39 40 45 public final int numberOfSessions() 46 { 47 return m_sessions.size(); 48 } 49 50 55 public final void addSession(SrvSession sess) 56 { 57 m_sessions.put(sess.getSessionId(), sess); 58 } 59 60 66 public final SrvSession findSession(int id) 67 { 68 return findSession(id); 69 } 70 71 77 public final SrvSession findSession(Integer id) 78 { 79 return m_sessions.get(id); 80 } 81 82 88 public final SrvSession removeSession(int id) 89 { 90 return removeSession(new Integer (id)); 91 } 92 93 99 public final SrvSession removeSession(SrvSession sess) 100 { 101 return removeSession(sess.getSessionId()); 102 } 103 104 110 public final SrvSession removeSession(Integer id) 111 { 112 113 115 SrvSession sess = findSession(id); 116 117 119 m_sessions.remove(id); 120 return sess; 121 } 122 123 128 public final Enumeration <Integer > enumerate() 129 { 130 return m_sessions.keys(); 131 } 132 } 133 | Popular Tags |