@@ -524,10 +524,8 @@ public void suspendInstance(String instanceId, @Nullable String reason, @Nullabl
524524 * @param pageSize the maximum number of instance IDs to return, or null for no limit
525525 * @return the raw list-instance-IDs response from the sidecar
526526 */
527- public OrchestratorService .ListInstanceIDsResponse listInstanceIds (
528- @ Nullable String continuationToken , @ Nullable Integer pageSize ) {
529- return this .listInstanceIds (continuationToken , pageSize , null );
530- }
527+ public abstract OrchestratorService .ListInstanceIDsResponse listInstanceIds (
528+ @ Nullable String continuationToken , @ Nullable Integer pageSize );
531529
532530 /**
533531 * Lists workflow instance IDs with optional pagination, keeping only the IDs that start with a prefix.
@@ -536,9 +534,16 @@ public OrchestratorService.ListInstanceIDsResponse listInstanceIds(
536534 * @param pageSize the maximum number of instance IDs to return, or null for no limit
537535 * @param instanceIdPrefix only instance IDs that start with this prefix are returned, or null for all
538536 * @return the raw list-instance-IDs response from the sidecar
537+ * @throws UnsupportedOperationException if a prefix is given and this implementation cannot filter by one
539538 */
540- public abstract OrchestratorService .ListInstanceIDsResponse listInstanceIds (
541- @ Nullable String continuationToken , @ Nullable Integer pageSize , @ Nullable String instanceIdPrefix );
539+ public OrchestratorService .ListInstanceIDsResponse listInstanceIds (
540+ @ Nullable String continuationToken , @ Nullable Integer pageSize , @ Nullable String instanceIdPrefix ) {
541+ if (instanceIdPrefix == null || instanceIdPrefix .isEmpty ()) {
542+ return this .listInstanceIds (continuationToken , pageSize );
543+ }
544+ throw new UnsupportedOperationException (
545+ "listing instance IDs by prefix is not supported by this DurableTaskClient implementation" );
546+ }
542547
543548 /**
544549 * Gets the full execution history of a workflow instance.
@@ -568,15 +573,19 @@ public abstract String rerunWorkflowFromEvent(String sourceInstanceId, int event
568573 * @param input the input given to every run. Must be serializable. May be null.
569574 * @param overwrite true to replace an existing schedule of the same name
570575 */
571- public abstract void createWorkflowSchedule (WorkflowSchedule schedule , @ Nullable Object input , boolean overwrite );
576+ public void createWorkflowSchedule (WorkflowSchedule schedule , @ Nullable Object input , boolean overwrite ) {
577+ throw schedulesUnsupported ();
578+ }
572579
573580 /**
574581 * Gets a workflow schedule with its status.
575582 *
576583 * @param name the name of the schedule
577584 * @return the schedule
578585 */
579- public abstract WorkflowSchedule getWorkflowSchedule (String name );
586+ public WorkflowSchedule getWorkflowSchedule (String name ) {
587+ throw schedulesUnsupported ();
588+ }
580589
581590 /**
582591 * Lists workflow schedules with their status, with optional pagination.
@@ -585,23 +594,38 @@ public abstract String rerunWorkflowFromEvent(String sourceInstanceId, int event
585594 * @param pageSize the maximum number of schedules to return, or null for no limit
586595 * @return the raw list-workflow-schedules response from the sidecar
587596 */
588- public abstract ListWorkflowSchedulesResponse listWorkflowSchedules (
589- @ Nullable String continuationToken , @ Nullable Integer pageSize );
597+ public ListWorkflowSchedulesResponse listWorkflowSchedules (
598+ @ Nullable String continuationToken , @ Nullable Integer pageSize ) {
599+ throw schedulesUnsupported ();
600+ }
590601
591602 /**
592603 * Deletes a workflow schedule. Runs it already started are not affected.
593604 *
594605 * @param name the name of the schedule
595606 */
596- public abstract void deleteWorkflowSchedule (String name );
607+ public void deleteWorkflowSchedule (String name ) {
608+ throw schedulesUnsupported ();
609+ }
597610
598611 /**
599612 * Starts a run of a workflow schedule now, without changing when its next scheduled run is.
600613 *
601614 * @param name the name of the schedule
602615 * @return the instance ID of the run
603616 */
604- public abstract String triggerWorkflowSchedule (String name );
617+ public String triggerWorkflowSchedule (String name ) {
618+ throw schedulesUnsupported ();
619+ }
620+
621+ /**
622+ * Rejects a workflow schedule call on a client that does not implement schedules. Implementations that
623+ * support them override the schedule methods, so this is only reached on ones that do not.
624+ */
625+ private static UnsupportedOperationException schedulesUnsupported () {
626+ return new UnsupportedOperationException (
627+ "workflow schedules are not supported by this DurableTaskClient implementation" );
628+ }
605629
606630 /**
607631 * Rejects a cross-app target on a client that does not implement cross-app routing. Implementations that
0 commit comments