aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java
diff options
context:
space:
mode:
authormcentner <mcentner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-08-08 07:25:32 +0000
committermcentner <mcentner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-08-08 07:25:32 +0000
commit43e57a42832ea8b4ceb0317f3c9028a4174ffa7b (patch)
treef5ed9074b8d7b89b2dd5b22d326f63be103e7551 /id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java
parent10889e9dea2cc2f70b475e6ff7af37fdba1621d9 (diff)
downloadmoa-id-spss-43e57a42832ea8b4ceb0317f3c9028a4174ffa7b.tar.gz
moa-id-spss-43e57a42832ea8b4ceb0317f3c9028a4174ffa7b.tar.bz2
moa-id-spss-43e57a42832ea8b4ceb0317f3c9028a4174ffa7b.zip
Adapted project directory structure to suit the new maven based build process.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@909 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java114
1 files changed, 0 insertions, 114 deletions
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 1762a52b7..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 id The session id
- * @param 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 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 value 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();
- }
-
-}