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
TokenStorage
add
in interface TokenStorage
token
- The token to be addedTrustException
public void update(Token token) throws TrustException
TokenStorage
update
in interface TokenStorage
TrustException
public String[] getTokenIdentifiers() throws TrustException
TokenStorage
getTokenIdentifiers
in interface TokenStorage
TrustException
public Token[] getValidTokens() throws TrustException
TokenStorage
getValidTokens
in interface TokenStorage
Tokens
.TrustException
public Token[] getRenewedTokens() throws TrustException
TokenStorage
getRenewedTokens
in interface TokenStorage
Tokens
TrustException
public Token[] getCancelledTokens() throws TrustException
TokenStorage
getCancelledTokens
in interface TokenStorage
Tokens
TrustException
public Token[] getExpiredTokens() throws TrustException
TokenStorage
EXPIRED
tokens.
If there are no EXPIRED
tokens null
will be
returnedgetExpiredTokens
in interface TokenStorage
Tokens
TrustException
public Token getToken(String id) throws TrustException
TokenStorage
Token
of the given idgetToken
in interface TokenStorage
Token
identified by the give idTrustException
public void removeToken(String id)
TokenStorage
removeToken
in interface TokenStorage
id
- Token id to remove.protected void processTokenExpiry() throws TrustException
TrustException
public static String getIdFromSTR(org.apache.axiom.om.OMElement str)
Copyright © Apache Software Foundation. All Rights Reserved.