public class SimpleTokenStore extends Object implements TokenStorage, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Lock |
readLock |
protected ReadWriteLock |
readWriteLock
We use a read write lock to improve concurrency while avoiding concurrent modification
exceptions.
|
protected Map |
tokens |
protected Lock |
writeLock |
TOKEN_STORAGE_KEY| Constructor and Description |
|---|
SimpleTokenStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Token token)
Add the given token to the list.
|
Token[] |
getCancelledTokens()
Return the list of CANCELLED tokens
|
Token[] |
getExpiredTokens()
Return the list of
EXPIRED tokens. |
static String |
getIdFromSTR(org.apache.axiom.om.OMElement str) |
Token[] |
getRenewedTokens()
Return the list of RENEWED tokens.
|
Token |
getToken(String id)
Returns the
Token of the given id |
String[] |
getTokenIdentifiers()
Return the list of all token identifiers.
|
Token[] |
getValidTokens()
Return the list of ISSUED and RENEWED tokens.
|
protected void |
processTokenExpiry() |
void |
removeToken(String id)
Removes the given token from token storage.
|
void |
update(Token token)
Update an existing token.
|
protected Map tokens
protected final ReadWriteLock readWriteLock
protected final Lock readLock
protected final Lock writeLock
public void add(Token token) throws TrustException
TokenStorageadd in interface TokenStoragetoken - The token to be addedTrustExceptionpublic void update(Token token) throws TrustException
TokenStorageupdate in interface TokenStorageTrustExceptionpublic String[] getTokenIdentifiers() throws TrustException
TokenStoragegetTokenIdentifiers in interface TokenStorageTrustExceptionpublic Token[] getValidTokens() throws TrustException
TokenStoragegetValidTokens in interface TokenStorageTokens.TrustExceptionpublic Token[] getRenewedTokens() throws TrustException
TokenStoragegetRenewedTokens in interface TokenStorageTokensTrustExceptionpublic Token[] getCancelledTokens() throws TrustException
TokenStoragegetCancelledTokens in interface TokenStorageTokensTrustExceptionpublic Token[] getExpiredTokens() throws TrustException
TokenStorageEXPIRED tokens.
If there are no EXPIRED tokens null will be
returnedgetExpiredTokens in interface TokenStorageTokensTrustExceptionpublic Token getToken(String id) throws TrustException
TokenStorageToken of the given idgetToken in interface TokenStorageToken identified by the give idTrustExceptionpublic void removeToken(String id)
TokenStorageremoveToken in interface TokenStorageid - Token id to remove.protected void processTokenExpiry()
throws TrustException
TrustExceptionpublic static String getIdFromSTR(org.apache.axiom.om.OMElement str)
Copyright © Apache Software Foundation. All Rights Reserved.