| java.lang.Object org.josso.jb42.agent.SessionMappingCachePolicy
SessionMappingCachePolicy | public class SessionMappingCachePolicy implements CachePolicy(Code) | | Security Manager JBoss Cache Policy proxy.
Its used inside JBoss's JaasSecurityManager class to cache authenticated user entries.
This class replaces, in the JaasSecurityManager, the default CachePolicy to allow
handling cache entry lookups using SSO Session Identifier Principals as keys.
author: Gianluca Brigandi version: CVS $Id: SessionMappingCachePolicy.java 338 2006-02-09 16:53:07Z sgonzalez $ |
Constructor Summary | |
public | SessionMappingCachePolicy(CachePolicy cachePolicy) Constructs a SessionMappingCachePolicy instance which acts as a proxy
of the supplied CachePolicy instance. |
Method Summary | |
public void | attachSessionToUser(Principal session, Principal user) Used to associate a Session Principal with a SSOUser Principal. | public void | create() | public void | destroy() | public void | flush() Flushes the cached objects from the cache.
All user-to-session mapping are removed as well. | public Object | get(Object key) Returns the object paired with the specified key if it's
present in the cache, otherwise must return null. | public void | insert(Object key, Object object) Inserts the specified object into the cache following the
implemented policy. | public Object | peek(Object key) Returns the object paired with the specified key if it's
present in the cache, otherwise must return null. | public void | remove(Object key) Remove the cached object paired with the specified key. | public int | size() Get the size of the cache. | public void | start() | public void | stop() |
SessionMappingCachePolicy | public SessionMappingCachePolicy(CachePolicy cachePolicy)(Code) | | Constructs a SessionMappingCachePolicy instance which acts as a proxy
of the supplied CachePolicy instance.
Parameters: cachePolicy - the cache policy to be proxyed |
attachSessionToUser | public void attachSessionToUser(Principal session, Principal user)(Code) | | Used to associate a Session Principal with a SSOUser Principal.
This method is invoked by the JBossCatalinaRealm on successful
authentication against the SecurityManager.
Everytime an entry is requested given a user Principal key, before
calling the proxyed CachePolicy, it will map such key to the
session key used for storing cache entries.
Parameters: session - Parameters: user - |
create | public void create() throws Exception(Code) | | create the service, do expensive operations etc
|
destroy | public void destroy()(Code) | | destroy the service, tear down
|
flush | public void flush()(Code) | | Flushes the cached objects from the cache.
All user-to-session mapping are removed as well.
|
get | public Object get(Object key)(Code) | | Returns the object paired with the specified key if it's
present in the cache, otherwise must return null.
If the supplied key is a user session principal, it will be
mapped to the associated user.
Parameters: key - the key paired with the object See Also: SessionMappingCachePolicy.peek |
insert | public void insert(Object key, Object object)(Code) | | Inserts the specified object into the cache following the
implemented policy.
Parameters: key - the key paired with the object Parameters: object - the object to cache See Also: SessionMappingCachePolicy.remove |
peek | public Object peek(Object key)(Code) | | Returns the object paired with the specified key if it's
present in the cache, otherwise must return null.
If the supplied key is a user session principal, it will be
mapped to the associated user.
Parameters: key - the key paired with the object See Also: SessionMappingCachePolicy.get |
remove | public void remove(Object key)(Code) | | Remove the cached object paired with the specified key.
In case the supplied key is a user principal mapped to a session principal, it will
be removed.
Parameters: key - the key paired with the object See Also: SessionMappingCachePolicy.insert |
size | public int size()(Code) | | Get the size of the cache.
|
start | public void start() throws Exception(Code) | | start the service, create is already called
|
stop | public void stop()(Code) | | stop the service
|
|
|