Class ScheduleId
java.lang.Object
io.fluxzero.sdk.scheduling.ScheduleId
Represents a unique identifier for a schedule, consisting of a type and an id. It is simply a convenience class
used to prevent clashes between schedule ids, e.g.: two functionally different schedules involving the same entity
id.
This class is typically used to encapsulate and uniquely identify schedules within a system. The combination of type and id can be used to distinguish between different schedule categories or instances.
The typed overloads on MessageScheduler accept this value directly. The scheduler persists its stable
toString() representation, so the same instance can be used to schedule, look up and cancel a message.
ScheduleIds can be used as-is or extended to form strongly typed schedule ids:
public class TaskExpiryId extends ScheduleId {
public TaskExpiryId(TaskId taskId) {
super("task-expiry", taskId);
}
}
-
Constructor Summary
ConstructorsConstructorDescriptionScheduleId(String type, Object id) Constructs a new ScheduleId object using the specified type and identifier. -
Method Summary
-
Constructor Details
-
ScheduleId
Constructs a new ScheduleId object using the specified type and identifier.- Parameters:
type- the type or category associated with the schedule. This parameter is used to distinguish schedules based on their broader classifications (e.g., "task", "booking"). It must be a non-null string and should provide context about the nature of the schedule.id- the unique identifier for the schedule. This parameter is used to uniquely identify a specific schedule instance within the specified type. If the provided id is an instance of theIdclass, its functional ID is extracted, otherwise thetoString()value of the id is used.
-
-
Method Details
-
of
Creates a schedule ID from a schedule type and domain identifier.- Parameters:
type- the type or category of the scheduleid- the domain identifier;Idvalues use their functional ID- Returns:
- the schedule ID
-
toString
-