public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider
| 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 |
|---|---|
void |
close() |
protected static net.sf.ehcache.Ehcache |
createCache(net.sf.ehcache.CacheManager cacheManager,
String cacheKey) |
protected Client |
doRemoveClient(Client c) |
ServerAccessToken |
getAccessToken(String accessToken)
Get access token
|
List<ServerAccessToken> |
getAccessTokens(Client c,
UserSubject sub)
Return all access tokens associated with a given client
|
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(UserSubject resourceOwner)
Get a list of clients registered by a resource owner.
|
protected RefreshToken |
getRefreshToken(String refreshTokenKey) |
List<RefreshToken> |
getRefreshTokens(Client c,
UserSubject sub)
Return all refresh tokens associated with a given client
|
protected static boolean |
isTokenMatched(ServerAccessToken token,
Client c,
UserSubject sub) |
protected static void |
putCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Object value,
long ttl) |
Client |
removeClient(String clientId)
Remove a Client with the given id
|
protected ServerAccessToken |
revokeAccessToken(String accessTokenKey) |
protected RefreshToken |
revokeRefreshToken(String refreshTokenKey) |
protected void |
saveAccessToken(ServerAccessToken serverToken) |
protected void |
saveRefreshToken(ServerAccessToken at,
RefreshToken refreshToken) |
void |
setClient(Client client)
Set a Client
|
void |
setClients(List<Client> clients) |
convertScopeToPermissions, createAccessToken, createNewAccessToken, createNewRefreshToken, doCreateAccessToken, doCreateNewRefreshToken, doRefreshAccessToken, getDefaultScopes, getInvisibleToClientScopes, getMessageContext, getPermissionMap, getPreauthorizedToken, getRequiredScopes, handleLinkedRefreshToken, init, isRefreshTokenSupported, isSupportPreauthorizedTokens, refreshAccessToken, removeAccessToken, removeClientTokens, revokeAccessTokens, revokeToken, setAccessTokenLifetime, setDefaultScopes, setInvisibleToClientScopes, setMessageContext, setPermissionMap, setRecycleRefreshTokens, setRefreshTokenLifetime, setRequiredScopes, setSupportedScopes, setSupportPreauthorizedTokens, unlinkRefreshAccessToken, updateRefreshTokenpublic 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
OAuthDataProviderClientclientId - the client idOAuthServiceExceptionpublic void setClient(Client client)
ClientRegistrationProviderclient - the clientpublic Client removeClient(String clientId)
ClientRegistrationProviderclientId - the client idpublic List<Client> getClients(UserSubject resourceOwner)
ClientRegistrationProviderresourceOwner - the resource owner, can be nullpublic List<ServerAccessToken> getAccessTokens(Client c, UserSubject sub)
OAuthDataProviderc - the clientsub - the user subject, can be nullpublic List<RefreshToken> getRefreshTokens(Client c, UserSubject sub)
OAuthDataProviderc - the clientsub - the user subject, can be nullprotected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub)
public ServerAccessToken getAccessToken(String accessToken) throws OAuthServiceException
OAuthDataProvideraccessToken - the token keyOAuthServiceExceptionprotected ServerAccessToken revokeAccessToken(String accessTokenKey)
revokeAccessToken in class AbstractOAuthDataProviderprotected RefreshToken getRefreshToken(String refreshTokenKey)
getRefreshToken in class AbstractOAuthDataProviderprotected RefreshToken revokeRefreshToken(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)
public void close()
close in class AbstractOAuthDataProviderApache CXF