public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider implements ClientRegistrationProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCESS_TOKEN_CACHE_KEY |
protected net.sf.ehcache.CacheManager |
cacheManager |
static String |
CLIENT_CACHE_KEY |
static String |
DEFAULT_CONFIG_URL |
static String |
REFRESH_TOKEN_CACHE_KEY |
| Constructor and Description |
|---|
DefaultEHCacheOAuthDataProvider() |
DefaultEHCacheOAuthDataProvider(String configFileURL,
Bus bus) |
DefaultEHCacheOAuthDataProvider(String configFileURL,
Bus bus,
String clientCacheKey,
String accessTokenKey,
String refreshTokenKey) |
| Modifier and Type | Method and Description |
|---|---|
protected static net.sf.ehcache.Ehcache |
createCache(net.sf.ehcache.CacheManager cacheManager,
String cacheKey) |
ServerAccessToken |
getAccessToken(String accessToken)
Get access token
|
protected static <T> T |
getCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Class<T> cls) |
Client |
getClient(String clientId)
Returns the previously registered third-party
Client |
List<Client> |
getClients() |
protected static void |
putCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Object value,
long ttl) |
void |
removeAccessToken(ServerAccessToken accessToken)
Removes the access token
The runtime will call this method if it finds that a token has expired
|
Client |
removeClient(String clientId) |
protected boolean |
revokeAccessToken(String accessTokenKey) |
protected RefreshToken |
revokeRefreshToken(Client client,
String refreshTokenKey) |
protected void |
saveAccessToken(ServerAccessToken serverToken) |
protected void |
saveRefreshToken(ServerAccessToken at,
RefreshToken refreshToken) |
void |
setClient(Client client) |
convertScopeToPermissions, createAccessToken, createNewAccessToken, createNewRefreshToken, doCreateAccessToken, doRefreshAccessToken, getPreauthorizedToken, refreshAccessToken, revokeToken, setAccessTokenLifetime, setRefreshTokenLifetimepublic static final String CLIENT_CACHE_KEY
public static final String ACCESS_TOKEN_CACHE_KEY
public static final String REFRESH_TOKEN_CACHE_KEY
public static final String DEFAULT_CONFIG_URL
protected net.sf.ehcache.CacheManager cacheManager
public DefaultEHCacheOAuthDataProvider()
public DefaultEHCacheOAuthDataProvider(String configFileURL, Bus bus)
public Client getClient(String clientId) throws OAuthServiceException
OAuthDataProviderClientgetClient in interface ClientRegistrationProvidergetClient in interface OAuthDataProviderclientId - the client idOAuthServiceExceptionpublic void setClient(Client client)
setClient in interface ClientRegistrationProviderpublic Client removeClient(String clientId)
removeClient in interface ClientRegistrationProviderpublic List<Client> getClients()
getClients in interface ClientRegistrationProviderpublic ServerAccessToken getAccessToken(String accessToken) throws OAuthServiceException
OAuthDataProvidergetAccessToken in interface OAuthDataProvideraccessToken - the token keyOAuthServiceExceptionpublic void removeAccessToken(ServerAccessToken accessToken) throws OAuthServiceException
OAuthDataProviderremoveAccessToken in interface OAuthDataProvideraccessToken - the tokenOAuthServiceExceptionprotected boolean revokeAccessToken(String accessTokenKey)
revokeAccessToken in class AbstractOAuthDataProviderprotected RefreshToken revokeRefreshToken(Client client, String refreshTokenKey)
revokeRefreshToken in class AbstractOAuthDataProviderprotected void saveAccessToken(ServerAccessToken serverToken)
saveAccessToken in class AbstractOAuthDataProviderprotected void saveRefreshToken(ServerAccessToken at, RefreshToken refreshToken)
saveRefreshToken in class AbstractOAuthDataProviderprotected static <T> T getCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Class<T> cls)
protected static void putCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Object value,
long ttl)
protected static net.sf.ehcache.Ehcache createCache(net.sf.ehcache.CacheManager cacheManager,
String cacheKey)
Apache CXF