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 Summary
FieldsModifier 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.TokenStorage
TOKEN_STORAGE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
readWriteLock
We 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
-
SimpleTokenStore
public SimpleTokenStore()
-
-
Method Details
-
add
Description copied from interface:TokenStorageAdd the given token to the list.- Specified by:
addin interfaceTokenStorage- Parameters:
token- The token to be added- Throws:
TrustException
-
update
Description copied from interface:TokenStorageUpdate an existing token.- Specified by:
updatein interfaceTokenStorage- Throws:
TrustException
-
getTokenIdentifiers
Description copied from interface:TokenStorageReturn the list of all token identifiers.- Specified by:
getTokenIdentifiersin interfaceTokenStorage- Returns:
- As array of token identifiers
- Throws:
TrustException
-
getValidTokens
Description copied from interface:TokenStorageReturn the list of ISSUED and RENEWED tokens.- Specified by:
getValidTokensin interfaceTokenStorage- Returns:
- An array of ISSUED and RENEWED
Tokens. - Throws:
TrustException
-
getRenewedTokens
Description copied from interface:TokenStorageReturn the list of RENEWED tokens.- Specified by:
getRenewedTokensin interfaceTokenStorage- Returns:
- An array of RENEWED
Tokens - Throws:
TrustException
-
getCancelledTokens
Description copied from interface:TokenStorageReturn the list of CANCELLED tokens- Specified by:
getCancelledTokensin interfaceTokenStorage- Returns:
- An array of CANCELLED
Tokens - Throws:
TrustException
-
getExpiredTokens
Description copied from interface:TokenStorageReturn the list ofEXPIREDtokens. If there are noEXPIREDtokensnullwill be returned- Specified by:
getExpiredTokensin interfaceTokenStorage- Returns:
- An array of expired
Tokens - Throws:
TrustException
-
getToken
Description copied from interface:TokenStorageReturns theTokenof the given id- Specified by:
getTokenin interfaceTokenStorage- Returns:
- The requested
Tokenidentified by the give id - Throws:
TrustException
-
removeToken
Description copied from interface:TokenStorageRemoves the given token from token storage.- Specified by:
removeTokenin interfaceTokenStorage- Parameters:
id- Token id to remove.
-
processTokenExpiry
- Throws:
TrustException
-
getIdFromSTR
-