From 1ef210e5d19a0a9bcee9701573732eb199bea5f1 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> Date: Wed, 24 Dec 2003 10:49:19 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'Build-1_2_0_D02'. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build-1_2_0_D02@92 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../gv/egovernment/moa/id/data/CookieManager.java | 114 --------------------- 1 file changed, 114 deletions(-) delete mode 100644 id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java (limited to 'id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java') diff --git a/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java b/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java deleted file mode 100644 index 98f84c429..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java +++ /dev/null @@ -1,114 +0,0 @@ -package at.gv.egovernment.moa.id.data; - -import java.util.HashMap; - -/** - * The CookieManager is a singleton to manage a Cookie-Object for - * each session - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class CookieManager { - /** the singleton instance of the CookieManager */ - private static CookieManager instance; - /** a HashMap to bind a Cookie-object to every single session*/ - private static HashMap cookies = new HashMap(); - - /** - * Create a singleton of the CookieManager - * @return CookieManager - */ - public static CookieManager getInstance() - { - if(instance==null) instance=new CookieManager(); - return instance; - } - - /** - * Save a cookie to a specified session-id - * @param String id the session id - * @param String cookie_string - the complete 'Set-Cookie' String from the OnlineApplication - */ - public void saveCookie(String id,String cookie_string) - { - getCookieWithID(id).setCookie(cookie_string); - } - - /** - * Method saveOldCookies. - * @param id - * @param cookie_string - */ - public void saveOldCookies(String id,String cookie_string) - { - getCookieWithID(id).saveOldCookies(cookie_string); - } - - /** - * Get a Cookie-Object for a specified session-id - * @param String id the session id - * @return Cookie object containing all saved cookies for this session - */ - public Cookie getCookieWithID(String id) - { - Cookie c = null; - if(cookies.containsKey(id)) - c = (Cookie)cookies.get(id); - else - { - c = new Cookie(); - cookies.put(id,c); - } - return c; - } - - - /** - * Get a String containing all cookies of a specified session-id - * saved in that session seperated by '; ' to be sent back to - * the Online-Application - * @param id the session-id - * @return String containing all cookies saved in that session seperated by '; ' - */ - public String getCookie(String id) - { - Cookie result = (Cookie)cookies.get((String)id); - if (result==null) - return null; - return result.getCookies(); - - } - - /** - * Adds a Cookie for a special session from a response with - * response-code 401 to the cookie-pool for sending it back - * to the browser / client - * @param id the session-id - * @param String: the complete 'Set-Cookie' - String - */ - public void add401(String id,String value) - { - getCookieWithID(id).add401(value); - } - - /** - * Clear the 401 cookie-pool of a session - * @param id the session-id - */ - public void clear401(String id) - { - getCookieWithID(id).clear401(); - } - - /** - * Get the HashMap containing all cookies of a session to be sent to the browser / client - * @param id the session-id - * @return HashMap with all cookies - */ - public HashMap get401(String id) - { - return getCookieWithID(id).get401(); - } - -} -- cgit v1.2.3