Class ScheduledCleanupCreationListener<C>
java.lang.Object
org.incendo.cloud.processors.cooldown.listener.ScheduledCleanupCreationListener<C>
- Type Parameters:
C- command sender type
- All Implemented Interfaces:
CooldownCreationListener<C>
@API(status=STABLE,
since="1.0.0")
public final class ScheduledCleanupCreationListener<C>
extends Object
implements CooldownCreationListener<C>
Cooldown creation listener that schedules a task to clean up the cooldown after it expires.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionScheduledCleanupCreationListener(@NonNull ScheduledExecutorService executorService, @NonNull CooldownRepository<C> cooldownRepository) Creates a new scheduled cleanup listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidcooldownCreated(@NonNull C sender, @NonNull Command<C> command, @NonNull CooldownInstance instance) Invoked when a new cooldown is created.
-
Constructor Details
-
ScheduledCleanupCreationListener
public ScheduledCleanupCreationListener(@NonNull ScheduledExecutorService executorService, @NonNull CooldownRepository<C> cooldownRepository) Creates a new scheduled cleanup listener.- Parameters:
executorService- service to schedule the cleanup task withcooldownRepository- repository that the cooldown will be deleted from
-
-
Method Details
-
cooldownCreated
public void cooldownCreated(@NonNull C sender, @NonNull Command<C> command, @NonNull CooldownInstance instance) Description copied from interface:CooldownCreationListenerInvoked when a new cooldown is created.- Specified by:
cooldownCreatedin interfaceCooldownCreationListener<C>- Parameters:
sender- sender that the cooldown is created forcommand- command that triggered the cooldown creationinstance- created instance
-