KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > vfs > webdav > DAVSessionStore


1 /*
2  */

3 package com.sslexplorer.vfs.webdav;
4
5 import java.util.HashMap JavaDoc;
6
7 /**
8  * @author magicthize
9  *
10  * To change the template for this generated type comment go to
11  * Window - Preferences - Java - Code Generation - Code and Comments
12  */

13 public class DAVSessionStore {
14   private HashMap JavaDoc sessions;
15   private static DAVSessionStore instance;
16   
17   private DAVSessionStore() {
18     sessions = new HashMap JavaDoc();
19   }
20   
21   public DAVSession getSession(String JavaDoc id) {
22     return (DAVSession)sessions.get(id);
23   }
24   
25   public void addSession(DAVSession session) {
26     sessions.put(session.getId(), session);
27   }
28   
29   public void removeSession(String JavaDoc id) {
30     sessions.remove(id);
31   }
32   
33   public static DAVSessionStore getInstance() {
34     if(instance == null) {
35       instance = new DAVSessionStore();
36     }
37     return instance;
38   }
39
40 }
41
Popular Tags