Apache CXF API

org.apache.cxf.ws.security.tokenstore
Class MemoryTokenStore

java.lang.Object
  extended by org.apache.cxf.ws.security.tokenstore.MemoryTokenStore
All Implemented Interfaces:
TokenStore

public class MemoryTokenStore
extends Object
implements TokenStore


Constructor Summary
MemoryTokenStore()
           
 
Method Summary
 void add(SecurityToken token)
          Add the given token to the list.
 Collection<SecurityToken> getCancelledTokens()
          Return the list of CANCELLED tokens
 Collection<SecurityToken> getExpiredTokens()
          Return the list of EXPIRED tokens.
 Collection<SecurityToken> getRenewedTokens()
          Return the list of RENEWED tokens.
 SecurityToken getToken(String id)
          Returns the Token of the given id
 SecurityToken getTokenByAssociatedHash(int hashCode)
          Returns the Token by the associated hash.
 Collection<String> getTokenIdentifiers()
          Return the list of all token identifiers.
protected  Collection<SecurityToken> getTokens(SecurityToken.State state)
           
 Collection<SecurityToken> getValidTokens()
          Return the list of ISSUED and RENEWED tokens.
protected  void processTokenExpiry()
           
 void remove(SecurityToken token)
          Remove an existing token.
 void removeCancelledTokens()
          Removes all cancelled tokens.
 void removeExpiredTokens()
          Removes all expired tokens.
 void setAutoRemoveTokens(boolean auto)
          Controls whether the store will automatically remove cancelled and expired tokens.
 void update(SecurityToken token)
          Update an existing token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryTokenStore

public MemoryTokenStore()
Method Detail

add

public void add(SecurityToken token)
Add the given token to the list.

Specified by:
add in interface TokenStore
Parameters:
token - The token to be added

update

public void update(SecurityToken token)
Update an existing token.

Specified by:
update in interface TokenStore

remove

public void remove(SecurityToken token)
Description copied from interface: TokenStore
Remove an existing token.

Specified by:
remove in interface TokenStore

getCancelledTokens

public Collection<SecurityToken> getCancelledTokens()
Description copied from interface: TokenStore
Return the list of CANCELLED tokens

Specified by:
getCancelledTokens in interface TokenStore
Returns:
An array of CANCELLED Tokens

getExpiredTokens

public Collection<SecurityToken> getExpiredTokens()
Description copied from interface: TokenStore
Return the list of EXPIRED tokens. If there are no EXPIRED tokens null will be returned

Specified by:
getExpiredTokens in interface TokenStore
Returns:
An array of expired Tokens

getRenewedTokens

public Collection<SecurityToken> getRenewedTokens()
Description copied from interface: TokenStore
Return the list of RENEWED tokens.

Specified by:
getRenewedTokens in interface TokenStore
Returns:
An array of RENEWED Tokens

getTokenIdentifiers

public Collection<String> getTokenIdentifiers()
Description copied from interface: TokenStore
Return the list of all token identifiers.

Specified by:
getTokenIdentifiers in interface TokenStore
Returns:
As array of token identifiers

getValidTokens

public Collection<SecurityToken> getValidTokens()
Description copied from interface: TokenStore
Return the list of ISSUED and RENEWED tokens.

Specified by:
getValidTokens in interface TokenStore
Returns:
An array of ISSUED and RENEWED Tokens.

getToken

public SecurityToken getToken(String id)
Description copied from interface: TokenStore
Returns the Token of the given id

Specified by:
getToken in interface TokenStore
Returns:
The requested Token identified by the give id

getTokenByAssociatedHash

public SecurityToken getTokenByAssociatedHash(int hashCode)
Description copied from interface: TokenStore
Returns the Token by the associated hash.

Specified by:
getTokenByAssociatedHash in interface TokenStore
Returns:
the Token by the associated hash.

getTokens

protected Collection<SecurityToken> getTokens(SecurityToken.State state)

processTokenExpiry

protected void processTokenExpiry()

removeCancelledTokens

public void removeCancelledTokens()
Description copied from interface: TokenStore
Removes all cancelled tokens.

Specified by:
removeCancelledTokens in interface TokenStore

removeExpiredTokens

public void removeExpiredTokens()
Description copied from interface: TokenStore
Removes all expired tokens.

Specified by:
removeExpiredTokens in interface TokenStore

setAutoRemoveTokens

public void setAutoRemoveTokens(boolean auto)
Description copied from interface: TokenStore
Controls whether the store will automatically remove cancelled and expired tokens. If true, calls to getCancelledTokens() and getExpiredTokens() will never return value;

Specified by:
setAutoRemoveTokens in interface TokenStore

Apache CXF API

Apache CXF