|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.http.Selector org.abstracthorizon.danube.http.HTTPContext org.abstracthorizon.danube.http.auth.JAASAuthenticatedHTTPContext
public class JAASAuthenticatedHTTPContext
This class marks start of "web application" by setting context path. All, potential, session handling will be done using context path - path this component is defined on.
Nested Class Summary | |
---|---|
protected class |
JAASAuthenticatedHTTPContext.AuthData
Class holding cached authorisation data |
Field Summary | |
---|---|
static String |
AUTHORIZATION_DATA_ATTRIBUTE
Authorisation data session attribute |
static String |
AUTHORIZATION_REQUEST_HEADER
Client request header for authorisation |
static String |
AUTHORIZATION_RESPONSE_HEADER
Server response header for authorisation |
protected Map<String,JAASAuthenticatedHTTPContext.AuthData> |
cachedAuth
Cache to hold authorisation information for a while |
protected int |
cacheTimeout
Cache timeout |
static int |
DEFAULT_CACHE_TIMEOUT
Default cache timeout |
static int |
DEFAULT_MINIMUM_SCAN_PERIOD
Default minimum scan period |
protected boolean |
forceAuthorisation
Force authorisation |
protected long |
lastScan
When was cache scanned last time for expired entries |
protected org.slf4j.Logger |
logger
Logger |
protected LoginContext |
loginContext
Login context |
protected String |
loginContextName
Login context name |
protected int |
minScanPeriod
Minimum scan period |
protected String |
realm
Realm name |
protected HTTPSessionManager |
sessionManager
Session manager |
Fields inherited from class org.abstracthorizon.danube.http.Selector |
---|
components, errorResponse |
Constructor Summary | |
---|---|
JAASAuthenticatedHTTPContext()
Constructor |
Method Summary | |
---|---|
protected Subject |
authorise(String base64)
Obtains subject object from base 64 encoded username and password |
int |
getCacheTimeout()
Returns cache timeout |
boolean |
getForceAuthorisation()
|
LoginContext |
getLoginContext()
Returns login context |
String |
getLoginContextName()
Returns login context name |
int |
getMinimumScanPeriod()
Return minimum scan period |
String |
getRealm()
Returns realm to be used. |
HTTPSessionManager |
getSessionManager()
Returns session manaager |
void |
handleConnection(Connection connection)
This method creates sets context path to be same as context path up to here plus this component's path. |
void |
setCacheTimeout(int cacheTimeout)
Sets cache timeout |
void |
setForceAuthorisation(boolean forceAuthorisation)
|
void |
setLoginContext(LoginContext loginContext)
Sets login context |
void |
setLoginContextName(String loginContextName)
Sets login context name |
void |
setMinimumScanPeriod(int minScanPeriod)
Sets minimum scan period |
void |
setRealm(String realm)
Sets realm. |
void |
setSessionManager(HTTPSessionManager sessionManager)
Sets session manager |
protected void |
superHandleConnection(Connection connection)
Calls super class handle connection method. |
Methods inherited from class org.abstracthorizon.danube.http.Selector |
---|
getComponents, getErrorResponse, setComponents, setErrorResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.slf4j.Logger logger
public static final String AUTHORIZATION_DATA_ATTRIBUTE
public static final String AUTHORIZATION_REQUEST_HEADER
public static final String AUTHORIZATION_RESPONSE_HEADER
public static final int DEFAULT_CACHE_TIMEOUT
public static final int DEFAULT_MINIMUM_SCAN_PERIOD
protected HTTPSessionManager sessionManager
protected String realm
protected String loginContextName
protected LoginContext loginContext
protected Map<String,JAASAuthenticatedHTTPContext.AuthData> cachedAuth
protected int cacheTimeout
protected int minScanPeriod
protected long lastScan
protected boolean forceAuthorisation
Constructor Detail |
---|
public JAASAuthenticatedHTTPContext()
Method Detail |
---|
public void handleConnection(Connection connection) throws ConnectionException
/"
- Specified by:
handleConnection
in interface ConnectionHandler
- Overrides:
handleConnection
in class HTTPContext
- Parameters:
connection
- socket connection
- Throws:
ConnectionException
protected void superHandleConnection(Connection connection) throws IOException
connection
- connection
IOException
- if thrown by super handleConnection(Connection)
protected Subject authorise(String base64)
base64
- base 64 encoded username and password
null
public HTTPSessionManager getSessionManager()
public void setSessionManager(HTTPSessionManager sessionManager)
sessionManager
- http session managerpublic String getRealm()
public void setRealm(String realm)
realm
- realmpublic String getLoginContextName()
public void setLoginContextName(String loginContextName)
loginContextName
- login context namepublic LoginContext getLoginContext()
public void setLoginContext(LoginContext loginContext)
loginContext
- login contextpublic int getCacheTimeout()
public void setCacheTimeout(int cacheTimeout)
cacheTimeout
- cache timeoutpublic int getMinimumScanPeriod()
public void setMinimumScanPeriod(int minScanPeriod)
minScanPeriod
- minimum scan periodpublic boolean getForceAuthorisation()
public void setForceAuthorisation(boolean forceAuthorisation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |