Class DefaultMessageScheduler
java.lang.Object
io.fluxcapacitor.javaclient.scheduling.DefaultMessageScheduler
- All Implemented Interfaces:
MessageScheduler
,HasLocalHandlers
Default implementation of the
MessageScheduler
interface.
This implementation uses a SchedulingClient
to schedule and cancel scheduled messages,
and implements the HasLocalHandlers
interface to allow for local handling of scheduled messages,
used by TestFixtures
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelSchedule
(String scheduleId) Cancel a previously scheduled message or command by ID.getSchedule
(String scheduleId) Look up an existing schedule.void
handleLocally
(Schedule schedule) Schedule the givenSchedule
object, optionally skipping if already present, using the specified guarantee.scheduleCommand
(Schedule schedule, boolean ifAbsent, Guarantee guarantee) Schedule a command using the given scheduling settings, using the providedGuarantee
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilter
Methods inherited from interface io.fluxcapacitor.javaclient.scheduling.MessageScheduler
schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleCommand, scheduleCommand, scheduleCommand, scheduleCommand, scheduleCommand, scheduleCommand, scheduleCommand, scheduleCommand, schedulePeriodic, schedulePeriodic
-
Constructor Details
-
DefaultMessageScheduler
public DefaultMessageScheduler()
-
-
Method Details
-
schedule
Description copied from interface:MessageScheduler
Schedule the givenSchedule
object, optionally skipping if already present, using the specified guarantee.- Specified by:
schedule
in interfaceMessageScheduler
- Parameters:
message
- the schedule messageifAbsent
- only schedule if not already scheduledguarantee
- the delivery guarantee to use- Returns:
- a CompletableFuture completing when the message is successfully scheduled
-
scheduleCommand
public CompletableFuture<Void> scheduleCommand(Schedule schedule, boolean ifAbsent, Guarantee guarantee) Description copied from interface:MessageScheduler
Schedule a command using the given scheduling settings, using the providedGuarantee
.- Specified by:
scheduleCommand
in interfaceMessageScheduler
- Parameters:
schedule
- the command scheduleifAbsent
- skip if existing schedule is presentguarantee
- the delivery guarantee to apply- Returns:
- a future indicating when the command is scheduled
-
cancelSchedule
Description copied from interface:MessageScheduler
Cancel a previously scheduled message or command by ID.- Specified by:
cancelSchedule
in interfaceMessageScheduler
- Parameters:
scheduleId
- the ID of the schedule to cancel
-
getSchedule
Description copied from interface:MessageScheduler
Look up an existing schedule.- Specified by:
getSchedule
in interfaceMessageScheduler
- Parameters:
scheduleId
- the ID of the schedule- Returns:
- the schedule if found
-
handleLocally
-