Package org.apache.rahas
Class SimpleTokenStore
java.lang.Object
org.apache.rahas.SimpleTokenStore
- All Implemented Interfaces:
- Serializable,- TokenStorage
In-memory implementation of the token storage
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Lockprotected final ReadWriteLockWe use a read write lock to improve concurrency while avoiding concurrent modification exceptions.protected Mapprotected final LockFields inherited from interface org.apache.rahas.TokenStorageTOKEN_STORAGE_KEY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd the given token to the list.Token[]Return the list of CANCELLED tokensToken[]Return the list ofEXPIREDtokens.static StringgetIdFromSTR(org.apache.axiom.om.OMElement str) Token[]Return the list of RENEWED tokens.Returns theTokenof the given idString[]Return the list of all token identifiers.Token[]Return the list of ISSUED and RENEWED tokens.protected voidprocessTokenExpiry(Token token) voidremoveToken(String id) Removes the given token from token storage.voidUpdate an existing token.
- 
Field Details- 
tokens
- 
readWriteLockWe use a read write lock to improve concurrency while avoiding concurrent modification exceptions. We allow concurrent reads and avoid concurrent reads and modifications ReentrantReadWriteLock supports a maximum of 65535 recursive write locks and 65535 read locks
- 
readLock
- 
writeLock
 
- 
- 
Constructor Details- 
SimpleTokenStorepublic SimpleTokenStore()
 
- 
- 
Method Details- 
addDescription copied from interface:TokenStorageAdd the given token to the list.- Specified by:
- addin interface- TokenStorage
- Parameters:
- token- The token to be added
- Throws:
- TrustException
 
- 
updateDescription copied from interface:TokenStorageUpdate an existing token.- Specified by:
- updatein interface- TokenStorage
- Throws:
- TrustException
 
- 
getTokenIdentifiersDescription copied from interface:TokenStorageReturn the list of all token identifiers.- Specified by:
- getTokenIdentifiersin interface- TokenStorage
- Returns:
- As array of token identifiers
- Throws:
- TrustException
 
- 
getValidTokensDescription copied from interface:TokenStorageReturn the list of ISSUED and RENEWED tokens.- Specified by:
- getValidTokensin interface- TokenStorage
- Returns:
- An array of ISSUED and RENEWED Tokens.
- Throws:
- TrustException
 
- 
getRenewedTokensDescription copied from interface:TokenStorageReturn the list of RENEWED tokens.- Specified by:
- getRenewedTokensin interface- TokenStorage
- Returns:
- An array of RENEWED Tokens
- Throws:
- TrustException
 
- 
getCancelledTokensDescription copied from interface:TokenStorageReturn the list of CANCELLED tokens- Specified by:
- getCancelledTokensin interface- TokenStorage
- Returns:
- An array of CANCELLED Tokens
- Throws:
- TrustException
 
- 
getExpiredTokensDescription copied from interface:TokenStorageReturn the list ofEXPIREDtokens. If there are noEXPIREDtokensnullwill be returned- Specified by:
- getExpiredTokensin interface- TokenStorage
- Returns:
- An array of expired Tokens
- Throws:
- TrustException
 
- 
getTokenDescription copied from interface:TokenStorageReturns theTokenof the given id- Specified by:
- getTokenin interface- TokenStorage
- Returns:
- The requested Tokenidentified by the give id
- Throws:
- TrustException
 
- 
removeTokenDescription copied from interface:TokenStorageRemoves the given token from token storage.- Specified by:
- removeTokenin interface- TokenStorage
- Parameters:
- id- Token id to remove.
 
- 
processTokenExpiry- Throws:
- TrustException
 
- 
getIdFromSTR
 
-