Package x.oauth
Class SkyLogicDataManager
java.lang.Object
x.oauth.SkyLogicDataManager
- All Implemented Interfaces:
DBManager
Connects to the SkyLogic data layer and responsible for CRUD operations.
- Author:
- sakdsitt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static org.slf4j.Loggerprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteScope(String scopeName) Deletes an oauth20 scope.findAccessToken(String accessToken) Loads an access token record from DB by passed accessTokenfindAccessTokenByRefreshToken(String refreshToken, String clientId) Loads an access token record from DB by passed refreshTokenfindAuthCode(String authCode, String redirectUri) Loads an auth code record from DB by passed authCode and redirect uri.findClientCredentials(String clientId) Loads a client credentials from DB by passed clientId.Loads a scope from DB by its name.getAccessTokenByUserIdAndClientApp(String userId, String clientId) Returns a list of all active access tokens for a user and a client application.Lists all client applications stored in the DB.Lists all registered scopes.static voidvoidremoveAccessToken(String accessToken) Remove an access token.voidstoreAccessToken(AccessToken accessToken) Stores access tokens in the DB.voidstoreAuthCode(AuthCode authCode) Stores auth codes in the DB.voidstoreClientCredentials(ClientCredentials clientCreds) Stores client credentials in the DB.booleanstoreScope(Scope scope) Stores OAuth20 scope in the DB.voidupdateAccessTokenValidStatus(String accessToken, boolean valid) Updates access token status.voidupdateAuthCodeValidStatus(String authCode, boolean valid) Updates auth code valid status.booleanupdateClientApp(String clientId, String scope, String description, Long status, String applicationDetails) Updates client application scope, description, status and details.booleanvalidClient(String clientId, String clientSecret) Validates passed clientId and clientSecret.
-
Field Details
-
log
protected static org.slf4j.Logger log -
CLIENTS_COLLECTION_NAME
- See Also:
-
CLIENTS_ID_NAME
- See Also:
-
AUTH_CODE_COLLECTION_NAME
- See Also:
-
AUTH_CODE_ID_NAME
- See Also:
-
ACCESS_TOKEN_COLLECTION_NAME
- See Also:
-
ACCESS_TOKEN_ID_NAME
- See Also:
-
REFRESH_TOKEN_ID_NAME
- See Also:
-
VALID_NAME
- See Also:
-
REDIRECT_URI_NAME
- See Also:
-
SCOPE_COLLECTION_NAME
- See Also:
-
SCOPE_ID_NAME
- See Also:
-
USER_ID
- See Also:
-
-
Constructor Details
-
SkyLogicDataManager
public SkyLogicDataManager()
-
-
Method Details
-
storeClientCredentials
Description copied from interface:DBManagerStores client credentials in the DB.- Specified by:
storeClientCredentialsin interfaceDBManager
-
findClientCredentials
Description copied from interface:DBManagerLoads a client credentials from DB by passed clientId.- Specified by:
findClientCredentialsin interfaceDBManager
-
storeAuthCode
Description copied from interface:DBManagerStores auth codes in the DB.- Specified by:
storeAuthCodein interfaceDBManager
-
findAuthCode
Description copied from interface:DBManagerLoads an auth code record from DB by passed authCode and redirect uri.- Specified by:
findAuthCodein interfaceDBManager
-
storeAccessToken
Description copied from interface:DBManagerStores access tokens in the DB.- Specified by:
storeAccessTokenin interfaceDBManager
-
findAccessToken
Description copied from interface:DBManagerLoads an access token record from DB by passed accessToken- Specified by:
findAccessTokenin interfaceDBManager
-
findAccessTokenByRefreshToken
Description copied from interface:DBManagerLoads an access token record from DB by passed refreshToken- Specified by:
findAccessTokenByRefreshTokenin interfaceDBManager
-
updateAccessTokenValidStatus
Description copied from interface:DBManagerUpdates access token status.- Specified by:
updateAccessTokenValidStatusin interfaceDBManager
-
updateAuthCodeValidStatus
Description copied from interface:DBManagerUpdates auth code valid status.- Specified by:
updateAuthCodeValidStatusin interfaceDBManager
-
validClient
Description copied from interface:DBManagerValidates passed clientId and clientSecret.- Specified by:
validClientin interfaceDBManager
-
storeScope
Description copied from interface:DBManagerStores OAuth20 scope in the DB.- Specified by:
storeScopein interfaceDBManager
-
getAllScopes
Description copied from interface:DBManagerLists all registered scopes.- Specified by:
getAllScopesin interfaceDBManager
-
findScope
Description copied from interface:DBManagerLoads a scope from DB by its name. -
updateClientApp
public boolean updateClientApp(String clientId, String scope, String description, Long status, String applicationDetails) Description copied from interface:DBManagerUpdates client application scope, description, status and details.- Specified by:
updateClientAppin interfaceDBManager
-
getAllApplications
Description copied from interface:DBManagerLists all client applications stored in the DB.- Specified by:
getAllApplicationsin interfaceDBManager
-
deleteScope
Description copied from interface:DBManagerDeletes an oauth20 scope.- Specified by:
deleteScopein interfaceDBManager
-
getAccessTokenByUserIdAndClientApp
Description copied from interface:DBManagerReturns a list of all active access tokens for a user and a client application.- Specified by:
getAccessTokenByUserIdAndClientAppin interfaceDBManager
-
removeAccessToken
Description copied from interface:DBManagerRemove an access token.- Specified by:
removeAccessTokenin interfaceDBManager
-
main
-