public abstract class MapCache extends Object implements OAuth2Cache
| Constructor and Description |
|---|
MapCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAccessors()
Clears all cached
OAuth2Clients. |
void |
clearClients()
Clears all cached
OAuth2Clients. |
void |
clearTokens()
Clears all cached
OAuth2Tokens. |
protected String |
getAccessorKey(OAuth2Accessor accessor) |
protected String |
getAccessorKey(OAuth2CallbackState state) |
protected String |
getAccessorKey(String gadgetUri,
String serviceName,
String user,
String scope) |
protected abstract Map<String,OAuth2Accessor> |
getAccessorMap() |
OAuth2Client |
getClient(String gadgetUri,
String serviceName)
Find an
OAuth2Client. |
protected String |
getClientKey(OAuth2Client client) |
protected String |
getClientKey(String gadgetUri,
String serviceName) |
protected abstract Map<String,OAuth2Client> |
getClientMap() |
OAuth2Accessor |
getOAuth2Accessor(OAuth2CallbackState state)
Find an
OAuth2Accessor by state. |
OAuth2Token |
getToken(String gadgetUri,
String serviceName,
String user,
String scope,
OAuth2Token.Type type)
Find an
OAuth2Token based on index |
protected String |
getTokenKey(OAuth2Token token) |
protected String |
getTokenKey(String gadgetUri,
String serviceName,
String user,
String scope,
OAuth2Token.Type type) |
protected abstract Map<String,OAuth2Token> |
getTokenMap() |
boolean |
isPrimed() |
OAuth2Client |
removeClient(OAuth2Client client)
Remove the given client;
|
OAuth2Accessor |
removeOAuth2Accessor(OAuth2Accessor accessor)
Remove the given accessor.
|
OAuth2Token |
removeToken(OAuth2Token token)
Remove the given token;
|
void |
storeClient(OAuth2Client client)
Stores the given client.
|
void |
storeClients(Collection<OAuth2Client> clients)
Store all clients in the collection.
|
void |
storeOAuth2Accessor(OAuth2Accessor accessor)
Stores the given accessor.
|
void |
storeToken(OAuth2Token token)
Stores the given token.
|
void |
storeTokens(Collection<OAuth2Token> storeTokens)
Stores all tokens in the collection.
|
protected abstract Map<String,OAuth2Client> getClientMap()
protected abstract Map<String,OAuth2Token> getTokenMap()
protected abstract Map<String,OAuth2Accessor> getAccessorMap()
public void clearClients()
throws OAuth2CacheException
OAuth2CacheOAuth2Clients.clearClients in interface OAuth2CacheOAuth2CacheExceptionpublic void clearTokens()
throws OAuth2CacheException
OAuth2CacheOAuth2Tokens.clearTokens in interface OAuth2CacheOAuth2CacheExceptionpublic void clearAccessors()
OAuth2CacheOAuth2Clients.clearAccessors in interface OAuth2Cachepublic void storeTokens(Collection<OAuth2Token> storeTokens) throws OAuth2CacheException
OAuth2CachestoreTokens in interface OAuth2CacheOAuth2CacheExceptionpublic boolean isPrimed()
isPrimed in interface OAuth2Cachepublic OAuth2Client getClient(String gadgetUri, String serviceName)
OAuth2CacheOAuth2Client.getClient in interface OAuth2Cachepublic OAuth2Accessor getOAuth2Accessor(OAuth2CallbackState state)
OAuth2CacheOAuth2Accessor by state.getOAuth2Accessor in interface OAuth2Cachepublic OAuth2Token getToken(String gadgetUri, String serviceName, String user, String scope, OAuth2Token.Type type)
OAuth2CacheOAuth2Token based on indexgetToken in interface OAuth2Cachepublic OAuth2Client removeClient(OAuth2Client client)
OAuth2CacheremoveClient in interface OAuth2Cachenull if removal failedpublic OAuth2Accessor removeOAuth2Accessor(OAuth2Accessor accessor)
OAuth2CacheremoveOAuth2Accessor in interface OAuth2Cachenull if removal failedpublic OAuth2Token removeToken(OAuth2Token token)
OAuth2CacheremoveToken in interface OAuth2Cachenull if removal failedpublic void storeClient(OAuth2Client client) throws OAuth2CacheException
OAuth2CachestoreClient in interface OAuth2CacheOAuth2CacheExceptionpublic void storeClients(Collection<OAuth2Client> clients) throws OAuth2CacheException
OAuth2CachestoreClients in interface OAuth2CacheOAuth2CacheExceptionpublic void storeOAuth2Accessor(OAuth2Accessor accessor)
OAuth2CachestoreOAuth2Accessor in interface OAuth2Cachepublic void storeToken(OAuth2Token token) throws OAuth2CacheException
OAuth2CachestoreToken in interface OAuth2CacheOAuth2CacheExceptionprotected String getClientKey(OAuth2Client client)
protected String getAccessorKey(OAuth2CallbackState state)
protected String getAccessorKey(String gadgetUri, String serviceName, String user, String scope)
protected String getAccessorKey(OAuth2Accessor accessor)
protected String getTokenKey(String gadgetUri, String serviceName, String user, String scope, OAuth2Token.Type type)
protected String getTokenKey(OAuth2Token token)
Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.