Package de.terrestris.shoguncore.service
Class AbstractTokenService<E extends Token,D extends AbstractTokenDao<E>>
- java.lang.Object
-
- de.terrestris.shoguncore.service.AbstractDaoService<E,D>
-
- de.terrestris.shoguncore.service.AbstractCrudService<E,D>
-
- de.terrestris.shoguncore.service.PermissionAwareCrudService<E,D>
-
- de.terrestris.shoguncore.service.AbstractTokenService<E,D>
-
- Direct Known Subclasses:
AbstractUserTokenService
public abstract class AbstractTokenService<E extends Token,D extends AbstractTokenDao<E>> extends PermissionAwareCrudService<E,D>
- Author:
- Daniel Koch, Nils Bühner
-
-
Field Summary
-
Fields inherited from class de.terrestris.shoguncore.service.PermissionAwareCrudService
permissionCollectionService
-
Fields inherited from class de.terrestris.shoguncore.service.AbstractDaoService
dao, LOG
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractTokenService()Default constructor, which calls the type-constructorprotectedAbstractTokenService(java.lang.Class<E> entityClass)Constructor that sets the concrete entity class for the service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EfindByTokenValue(java.lang.String token)voidvalidateToken(E token)If the passed token is null or expired, this method will throw anException.-
Methods inherited from class de.terrestris.shoguncore.service.PermissionAwareCrudService
addAndSaveGroupPermissions, addAndSaveUserPermissions, findAllUserGroupPermissionsOfUserGroup, findAllUserPermissionsOfUser, getPermissionCollectionService, removeAndSaveGroupPermissions, removeAndSaveUserPermissions, setDao, setPermissionCollectionService
-
Methods inherited from class de.terrestris.shoguncore.service.AbstractCrudService
delete, findAll, findAllRestricted, findAllWhereFieldEquals, findAllWithCollectionContaining, findById, findBySimpleFilter, loadById, saveOrUpdate, updatePartialWithJsonNode
-
Methods inherited from class de.terrestris.shoguncore.service.AbstractDaoService
getDao, getEntityClass
-
-
-
-
Constructor Detail
-
AbstractTokenService
public AbstractTokenService()
Default constructor, which calls the type-constructor
-
AbstractTokenService
protected AbstractTokenService(java.lang.Class<E> entityClass)
Constructor that sets the concrete entity class for the service. Subclasses MUST call this constructor.
-
-
Method Detail
-
findByTokenValue
@Transactional(readOnly=true) public E findByTokenValue(java.lang.String token)
- Returns:
-
validateToken
@Transactional(readOnly=true) public void validateToken(E token) throws java.lang.Exception
If the passed token is null or expired, this method will throw anException.- Parameters:
token-- Throws:
java.lang.Exception- if the token is not valid (e.g. because it is expired)
-
-