Package energy.eddie.aiida.services
Class PermissionScheduler
java.lang.Object
energy.eddie.aiida.services.PermissionScheduler
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionScheduler(Clock clock, org.springframework.scheduling.TaskScheduler scheduler, PermissionRepository repository, ConcurrentMap<UUID, ScheduledFuture<?>> permissionFutures, StreamerManager streamerManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidremovePermission(UUID permissionId) Removes any scheduled start or expiration runnable for the specified ID.scheduleOrStart(Permission permission) If the start date of the permission is in the past or now, the streaming is directly started, otherwise a Runnable will be scheduled to start the permission once its start time has been reached.
-
Constructor Details
-
PermissionScheduler
public PermissionScheduler(Clock clock, org.springframework.scheduling.TaskScheduler scheduler, PermissionRepository repository, ConcurrentMap<UUID, ScheduledFuture<?>> permissionFutures, StreamerManager streamerManager)
-
-
Method Details
-
scheduleOrStart
If the start date of the permission is in the past or now, the streaming is directly started, otherwise a Runnable will be scheduled to start the permission once its start time has been reached.- Returns:
- The updated permission object. It is already persisted in the database.
-
removePermission
Removes any scheduled start or expiration runnable for the specified ID. E.g. when the permission is revoked or terminated.
-