Apache CXF API

org.apache.cxf.sts.cache
Class MemoryIdentityCache

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

@ManagedResource
public class MemoryIdentityCache
extends Object
implements IdentityCache, IdentityMapper, ManagedComponent

A simple in-memory HashMap based cache to cache identities in different realms where the relationship is of type FederateIdentity.


Constructor Summary
protected MemoryIdentityCache()
           
  MemoryIdentityCache(Bus bus, IdentityMapper identityMapper)
           
  MemoryIdentityCache(IdentityMapper identityMapper)
           
 
Method Summary
 void add(String user, String realm, Map<String,String> identities)
           
 void clear()
           
 Map<String,String> get(String user, String realm)
           
 String getContent()
           
 long getMaxCacheItems()
           
 ObjectName getObjectName()
           
 MemoryIdentityCacheStatistics getStatistics()
           
 Principal mapPrincipal(String sourceRealm, Principal sourcePrincipal, String targetRealm)
          Map a principal in the source realm to the target realm
 void remove(String user, String realm)
           
 void setMaxCacheItems(long maxCacheItems)
           
 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

MemoryIdentityCache

protected MemoryIdentityCache()

MemoryIdentityCache

public MemoryIdentityCache(IdentityMapper identityMapper)

MemoryIdentityCache

public MemoryIdentityCache(Bus bus,
                           IdentityMapper identityMapper)
Method Detail

getStatistics

public MemoryIdentityCacheStatistics getStatistics()

setStatistics

public void setStatistics(MemoryIdentityCacheStatistics stats)

getMaxCacheItems

public long getMaxCacheItems()

setMaxCacheItems

public void setMaxCacheItems(long maxCacheItems)

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

getObjectName

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

Apache CXF API

Apache CXF