Package org.graylog2.security
Class AccessTokenServiceImpl
java.lang.Object
org.graylog2.database.PersistedServiceImpl
org.graylog2.security.AccessTokenServiceImpl
- All Implemented Interfaces:
PersistedService,AccessTokenService
@Singleton
public class AccessTokenServiceImpl
extends PersistedServiceImpl
implements AccessTokenService
Provides access to access tokens in the database.
The token value will automatically be encrypted/decrypted when storing/loading the token object from the database.
That means the token value is encrypted at rest but the loaded
AccessToken always contains the plain text value.-
Field Summary
Fields inherited from class org.graylog2.database.PersistedServiceImpl
mongoConnection -
Constructor Summary
ConstructorsConstructorDescriptionAccessTokenServiceImpl(MongoConnection mongoConnection, AccessTokenCipher accessTokenCipher) -
Method Summary
Modifier and TypeMethodDescriptionintdeleteAllForUser(String username) save(AccessToken accessToken) voidsetLastAccessCache(long duration, TimeUnit unit) org.joda.time.DateTimetouch(AccessToken accessToken) Methods inherited from class org.graylog2.database.PersistedServiceImpl
collection, collection, count, count, cursorToList, destroy, destroy, destroyAll, destroyAll, destroyAll, embed, fieldTransformations, findOne, findOne, findOne, findOne, get, get, get, query, query, query, query, query, removeEmbedded, removeEmbedded, save, saveWithoutValidation, totalCount, totalCount, validate, validate, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graylog2.plugin.database.PersistedService
destroy, destroyAll, save, saveWithoutValidation, validate, validate, validate
-
Constructor Details
-
AccessTokenServiceImpl
@Inject public AccessTokenServiceImpl(MongoConnection mongoConnection, AccessTokenCipher accessTokenCipher)
-
-
Method Details
-
load
- Specified by:
loadin interfaceAccessTokenService
-
loadById
- Specified by:
loadByIdin interfaceAccessTokenService
-
loadAll
- Specified by:
loadAllin interfaceAccessTokenService
-
create
- Specified by:
createin interfaceAccessTokenService
-
touch
- Specified by:
touchin interfaceAccessTokenService- Throws:
ValidationException
-
save
- Specified by:
savein interfaceAccessTokenService- Throws:
ValidationException
-
deleteAllForUser
- Specified by:
deleteAllForUserin interfaceAccessTokenService
-
setLastAccessCache
- Specified by:
setLastAccessCachein interfaceAccessTokenService
-