Package io.temporal.client.schedules
Interface ScheduleClient
-
public interface ScheduleClient
Client to the Temporal service used to create, list and get handles to Schedules.- See Also:
ScheduleHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description ScheduleHandle
createSchedule(java.lang.String scheduleID, Schedule schedule, ScheduleOptions options)
Create a schedule and return its handle.ScheduleHandle
getHandle(java.lang.String scheduleID)
Gets the schedule handle for the given ID.java.util.stream.Stream<ScheduleListDescription>
listSchedules()
List schedules.java.util.stream.Stream<ScheduleListDescription>
listSchedules(java.lang.Integer pageSize)
List schedules.static ScheduleClient
newInstance(io.temporal.serviceclient.WorkflowServiceStubs service)
Creates a client that connects to an instance of the Temporal Service to interact with schedules.static ScheduleClient
newInstance(io.temporal.serviceclient.WorkflowServiceStubs service, ScheduleClientOptions options)
Creates a client that connects to an instance of the Temporal Service to interact with schedules.
-
-
-
Method Detail
-
newInstance
static ScheduleClient newInstance(io.temporal.serviceclient.WorkflowServiceStubs service)
Creates a client that connects to an instance of the Temporal Service to interact with schedules.- Parameters:
service
- client to the Temporal Service endpoint.- Returns:
- client to interact with schedules
-
newInstance
static ScheduleClient newInstance(io.temporal.serviceclient.WorkflowServiceStubs service, ScheduleClientOptions options)
Creates a client that connects to an instance of the Temporal Service to interact with schedules.- Parameters:
service
- client to the Temporal Service endpoint.options
- Options (likeDataConverter
er override) for configuring client.- Returns:
- client to interact with schedules
-
createSchedule
ScheduleHandle createSchedule(java.lang.String scheduleID, Schedule schedule, ScheduleOptions options)
Create a schedule and return its handle.- Parameters:
scheduleID
- Unique ID for the schedule.schedule
- Schedule to create.options
- Options for creating the schedule.- Returns:
- A handle that can be used to perform operations on a schedule.
- Throws:
ScheduleAlreadyRunningException
- if the schedule is already runnning.
-
getHandle
ScheduleHandle getHandle(java.lang.String scheduleID)
Gets the schedule handle for the given ID.- Parameters:
scheduleID
- Schedule ID to get the handle for.- Returns:
- A handle that can be used to perform operations on a schedule.
-
listSchedules
java.util.stream.Stream<ScheduleListDescription> listSchedules()
List schedules.- Returns:
- sequential stream that performs remote pagination under the hood
-
listSchedules
java.util.stream.Stream<ScheduleListDescription> listSchedules(@Nullable java.lang.Integer pageSize)
List schedules.- Parameters:
pageSize
- how many results to fetch from the Server at a time. Default is 100.- Returns:
- sequential stream that performs remote pagination under the hood
-
-