Apache CXF API

org.apache.cxf.sts.cache
Class EHCacheIdentityCache

java.lang.Object
  extended by org.apache.cxf.sts.cache.EHCacheIdentityCache
All Implemented Interfaces:
Closeable, BusLifeCycleListener, ManagedComponent, IdentityCache, IdentityMapper

@ManagedResource
public class EHCacheIdentityCache
extends Object
implements IdentityCache, IdentityMapper, Closeable, BusLifeCycleListener, ManagedComponent

A EH-Cache based cache to cache identities in different realms where the relationship is of type FederateIdentity.


Constructor Summary
EHCacheIdentityCache(IdentityMapper identityMapper, Bus b)
           
EHCacheIdentityCache(IdentityMapper identityMapper, String key, Bus b, URL configFileURL)
           
 
Method Summary
 void add(String user, String realm, Map<String,String> identities)
           
 void clear()
           
 void close()
           
 Map<String,String> get(String user, String realm)
           
 String getContent()
           
 ObjectName getObjectName()
           
 MemoryIdentityCacheStatistics getStatistics()
           
 void initComplete()
          Invoked when the Bus has been initialized.
 Principal mapPrincipal(String sourceRealm, Principal sourcePrincipal, String targetRealm)
          Map a principal in the source realm to the target realm
 void postShutdown()
          Invoked after the Bus is shutdown.
 void preShutdown()
          Invoked before the Bus is shutdown.
 void remove(String user, String realm)
           
 void setStatistics(MemoryIdentityCacheStatistics stats)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EHCacheIdentityCache

public EHCacheIdentityCache(IdentityMapper identityMapper,
                            Bus b)

EHCacheIdentityCache

public EHCacheIdentityCache(IdentityMapper identityMapper,
                            String key,
                            Bus b,
                            URL configFileURL)
Method Detail

getStatistics

public MemoryIdentityCacheStatistics getStatistics()

setStatistics

public void setStatistics(MemoryIdentityCacheStatistics stats)

add

public void add(String user,
                String realm,
                Map<String,String> identities)
Specified by:
add in interface IdentityCache

get

@ManagedOperation
public Map<String,String> get(String user,
                                               String realm)
Specified by:
get in interface IdentityCache

remove

public void remove(String user,
                   String realm)
Specified by:
remove in interface IdentityCache

clear

@ManagedOperation
public void clear()
Specified by:
clear in interface IdentityCache

size

@ManagedOperation
public int size()
Specified by:
size in interface IdentityCache

getContent

@ManagedOperation
public String getContent()

mapPrincipal

public Principal mapPrincipal(String sourceRealm,
                              Principal sourcePrincipal,
                              String targetRealm)
Description copied from interface: IdentityMapper
Map a principal in the source realm to the target realm

Specified by:
mapPrincipal in interface IdentityMapper
Parameters:
sourceRealm - the source realm of the Principal
sourcePrincipal - the principal in the source realm
targetRealm - the target realm of the Principal
Returns:
the principal in the target realm

close

public void close()
Specified by:
close in interface Closeable

initComplete

public void initComplete()
Description copied from interface: BusLifeCycleListener
Invoked when the Bus has been initialized.

Specified by:
initComplete in interface BusLifeCycleListener

preShutdown

public void preShutdown()
Description copied from interface: BusLifeCycleListener
Invoked before the Bus is shutdown.

Specified by:
preShutdown in interface BusLifeCycleListener

postShutdown

public void postShutdown()
Description copied from interface: BusLifeCycleListener
Invoked after the Bus is shutdown.

Specified by:
postShutdown in interface BusLifeCycleListener

getObjectName

public ObjectName getObjectName()
                         throws JMException
Specified by:
getObjectName in interface ManagedComponent
Throws:
JMException

Apache CXF API

Apache CXF