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, setRefreshTokenLifetime
public 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
OAuthDataProvider
Client
getClient
in interface ClientRegistrationProvider
getClient
in interface OAuthDataProvider
clientId
- the client idOAuthServiceException
public void setClient(Client client)
setClient
in interface ClientRegistrationProvider
public Client removeClient(String clientId)
removeClient
in interface ClientRegistrationProvider
public List<Client> getClients()
getClients
in interface ClientRegistrationProvider
public ServerAccessToken getAccessToken(String accessToken) throws OAuthServiceException
OAuthDataProvider
getAccessToken
in interface OAuthDataProvider
accessToken
- the token keyOAuthServiceException
public void removeAccessToken(ServerAccessToken accessToken) throws OAuthServiceException
OAuthDataProvider
removeAccessToken
in interface OAuthDataProvider
accessToken
- the tokenOAuthServiceException
protected boolean revokeAccessToken(String accessTokenKey)
revokeAccessToken
in class AbstractOAuthDataProvider
protected RefreshToken revokeRefreshToken(Client client, String refreshTokenKey)
revokeRefreshToken
in class AbstractOAuthDataProvider
protected void saveAccessToken(ServerAccessToken serverToken)
saveAccessToken
in class AbstractOAuthDataProvider
protected void saveRefreshToken(ServerAccessToken at, RefreshToken refreshToken)
saveRefreshToken
in class AbstractOAuthDataProvider
protected 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