org.abstracthorizon.danube.http.session
Interface HTTPSessionManager

All Superinterfaces:
SessionManager
All Known Implementing Classes:
SimpleCookieSessionManager, SimpleSessionManager

public interface HTTPSessionManager
extends SessionManager

This interface defines simple session handling interface. It defines a factory that keeps track of sessions. This interface adds new utility method that obtains session id from HTTPConnection. Also, it adds method to rewrite URLs if needed.

Author:
Daniel Sendula

Method Summary
 Object findSession(HTTPConnection connection, boolean create)
          Finds existing session or creates new one if there is no existing session and create parameter is set to true.
 void removeSession(HTTPConnection connection)
          Removes session from connection
 String rewriteURL(HTTPConnection connection, String url)
          This method should take care session ids kept in the url.
 
Methods inherited from interface org.abstracthorizon.danube.session.SessionManager
findSession, removeSession
 

Method Detail

findSession

Object findSession(HTTPConnection connection,
                   boolean create)
Finds existing session or creates new one if there is no existing session and create parameter is set to true. This method should call SessionManager.findSession(Object, boolean) when session id is found.

Parameters:
connection - http connection for session id to be extracted from
create - should new session be created if there is no existing session
Returns:
existing session object, new session if existing session is not there and create param is set to true or null otherwise.

rewriteURL

String rewriteURL(HTTPConnection connection,
                  String url)
This method should take care session ids kept in the url. If such thing is not used then it shouold return url parameter unchanged.

Parameters:
connection - http connection object
url - url to be updated
Returns:
updated url

removeSession

void removeSession(HTTPConnection connection)
Removes session from connection

Parameters:
connection - connection


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.