Interface CdsPermissionRequestRepository
- All Superinterfaces:
FullPermissionRequestRepository<CdsPermissionRequest>,PermissionRequestRepository<CdsPermissionRequest>,org.springframework.data.repository.Repository<CdsPermissionRequest,,String> StalePermissionRequestRepository<CdsPermissionRequest>,StatusPermissionRequestRepository<CdsPermissionRequest>
@Repository
public interface CdsPermissionRequestRepository
extends FullPermissionRequestRepository<CdsPermissionRequest>, org.springframework.data.repository.Repository<CdsPermissionRequest,String>
-
Method Summary
Modifier and TypeMethodDescriptionfindByState(String state) findStalePermissionRequests(int stalenessDuration) Finds all permission request that are older than thestalenessDurationand have either the statusVALIDATEDorSENT_TO_PERMISSION_ADMINISTRATOR.Methods inherited from interface energy.eddie.api.agnostic.process.model.persistence.PermissionRequestRepository
findByPermissionId, getByPermissionId, saveMethods inherited from interface energy.eddie.api.agnostic.process.model.persistence.StatusPermissionRequestRepository
findByStatus
-
Method Details
-
findByState
-
findStalePermissionRequests
@Query(value="SELECT *\nFROM cds.permission_request WHERE status = \'SENT_TO_PERMISSION_ADMINISTRATOR\' AND (created <= NOW() - :hours * INTERVAL \'1 hour\' OR auth_expires_at <= NOW())\n", nativeQuery=true) Collection<CdsPermissionRequest> findStalePermissionRequests(@Param("hours") int stalenessDuration) Description copied from interface:StalePermissionRequestRepositoryFinds all permission request that are older than thestalenessDurationand have either the statusVALIDATEDorSENT_TO_PERMISSION_ADMINISTRATOR.- Specified by:
findStalePermissionRequestsin interfaceStalePermissionRequestRepository<CdsPermissionRequest>- Parameters:
stalenessDuration- the max amount of hours the permission request has to be created ago to not be considered stale.- Returns:
- all permission request created now -
stalenessDurationhours ago, with above specified status.
-