
software.amazon.awssdk.services.swf.model.ScheduleActivityTaskDecisionAttributes Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.swf.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Provides the details of the ScheduleActivityTask
decision.
*
*
* Access Control
*
*
* You can use IAM policies to control this decision's access to Amazon SWF resources as follows:
*
*
* -
*
* Use a Resource
element with the domain name to limit the action to only specified domains.
*
*
* -
*
* Use an Action
element to allow or deny permission to call this action.
*
*
* -
*
* Constrain the following parameters by using a Condition
element with the appropriate keys.
*
*
* -
*
* activityType.name
– String constraint. The key is swf:activityType.name
.
*
*
* -
*
* activityType.version
– String constraint. The key is swf:activityType.version
.
*
*
* -
*
* taskList
– String constraint. The key is swf:taskList.name
.
*
*
*
*
*
*
* If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the
* specified constraints, the action fails. The associated event attribute's cause
parameter is set to
* OPERATION_NOT_PERMITTED
. For details and example IAM policies, see Using IAM to Manage Access to
* Amazon SWF Workflows in the Amazon SWF Developer Guide.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ScheduleActivityTaskDecisionAttributes implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACTIVITY_TYPE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(ScheduleActivityTaskDecisionAttributes::activityType)).setter(setter(Builder::activityType))
.constructor(ActivityType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("activityType").build()).build();
private static final SdkField ACTIVITY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::activityId)).setter(setter(Builder::activityId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("activityId").build()).build();
private static final SdkField CONTROL_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::control)).setter(setter(Builder::control))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("control").build()).build();
private static final SdkField INPUT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::input)).setter(setter(Builder::input))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("input").build()).build();
private static final SdkField SCHEDULE_TO_CLOSE_TIMEOUT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::scheduleToCloseTimeout))
.setter(setter(Builder::scheduleToCloseTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scheduleToCloseTimeout").build())
.build();
private static final SdkField TASK_LIST_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(ScheduleActivityTaskDecisionAttributes::taskList)).setter(setter(Builder::taskList))
.constructor(TaskList::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskList").build()).build();
private static final SdkField TASK_PRIORITY_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::taskPriority)).setter(setter(Builder::taskPriority))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskPriority").build()).build();
private static final SdkField SCHEDULE_TO_START_TIMEOUT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::scheduleToStartTimeout))
.setter(setter(Builder::scheduleToStartTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scheduleToStartTimeout").build())
.build();
private static final SdkField START_TO_CLOSE_TIMEOUT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::startToCloseTimeout))
.setter(setter(Builder::startToCloseTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startToCloseTimeout").build())
.build();
private static final SdkField HEARTBEAT_TIMEOUT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ScheduleActivityTaskDecisionAttributes::heartbeatTimeout)).setter(setter(Builder::heartbeatTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("heartbeatTimeout").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTIVITY_TYPE_FIELD,
ACTIVITY_ID_FIELD, CONTROL_FIELD, INPUT_FIELD, SCHEDULE_TO_CLOSE_TIMEOUT_FIELD, TASK_LIST_FIELD, TASK_PRIORITY_FIELD,
SCHEDULE_TO_START_TIMEOUT_FIELD, START_TO_CLOSE_TIMEOUT_FIELD, HEARTBEAT_TIMEOUT_FIELD));
private static final long serialVersionUID = 1L;
private final ActivityType activityType;
private final String activityId;
private final String control;
private final String input;
private final String scheduleToCloseTimeout;
private final TaskList taskList;
private final String taskPriority;
private final String scheduleToStartTimeout;
private final String startToCloseTimeout;
private final String heartbeatTimeout;
private ScheduleActivityTaskDecisionAttributes(BuilderImpl builder) {
this.activityType = builder.activityType;
this.activityId = builder.activityId;
this.control = builder.control;
this.input = builder.input;
this.scheduleToCloseTimeout = builder.scheduleToCloseTimeout;
this.taskList = builder.taskList;
this.taskPriority = builder.taskPriority;
this.scheduleToStartTimeout = builder.scheduleToStartTimeout;
this.startToCloseTimeout = builder.startToCloseTimeout;
this.heartbeatTimeout = builder.heartbeatTimeout;
}
/**
*
* The type of the activity task to schedule.
*
*
* @return The type of the activity task to schedule.
*/
public ActivityType activityType() {
return activityType;
}
/**
*
* The activityId
of the activity task.
*
*
* The specified string must not start or end with whitespace. It must not contain a :
(colon),
* /
(slash), |
(vertical bar), or any control characters (\u0000-\u001f
|
* \u007f-\u009f
). Also, it must not contain the literal string arn
.
*
*
* @return The activityId
of the activity task.
*
* The specified string must not start or end with whitespace. It must not contain a :
(colon),
* /
(slash), |
(vertical bar), or any control characters (
* \u0000-\u001f
| \u007f-\u009f
). Also, it must not contain the literal string
* arn
.
*/
public String activityId() {
return activityId;
}
/**
*
* Data attached to the event that can be used by the decider in subsequent workflow tasks. This data isn't sent to
* the activity.
*
*
* @return Data attached to the event that can be used by the decider in subsequent workflow tasks. This data isn't
* sent to the activity.
*/
public String control() {
return control;
}
/**
*
* The input provided to the activity task.
*
*
* @return The input provided to the activity task.
*/
public String input() {
return input;
}
/**
*
* The maximum duration for this activity task.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-close timeout for this activity task must be specified either as a default for the activity type or
* through this field. If neither this field is set nor a default schedule-to-close timeout was specified at
* registration time then a fault is returned.
*
*
*
* @return The maximum duration for this activity task.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-close timeout for this activity task must be specified either as a default for the activity
* type or through this field. If neither this field is set nor a default schedule-to-close timeout was
* specified at registration time then a fault is returned.
*
*/
public String scheduleToCloseTimeout() {
return scheduleToCloseTimeout;
}
/**
*
* If set, specifies the name of the task list in which to schedule the activity task. If not specified, the
* defaultTaskList
registered with the activity type is used.
*
*
*
* A task list for this activity task must be specified either as a default for the activity type or through this
* field. If neither this field is set nor a default task list was specified at registration time then a fault is
* returned.
*
*
*
* The specified string must not start or end with whitespace. It must not contain a :
(colon),
* /
(slash), |
(vertical bar), or any control characters (\u0000-\u001f
|
* \u007f-\u009f
). Also, it must not contain the literal string arn
.
*
*
* @return If set, specifies the name of the task list in which to schedule the activity task. If not specified, the
* defaultTaskList
registered with the activity type is used.
*
* A task list for this activity task must be specified either as a default for the activity type or through
* this field. If neither this field is set nor a default task list was specified at registration time then
* a fault is returned.
*
*
*
* The specified string must not start or end with whitespace. It must not contain a :
(colon),
* /
(slash), |
(vertical bar), or any control characters (
* \u0000-\u001f
| \u007f-\u009f
). Also, it must not contain the literal string
* arn
.
*/
public TaskList taskList() {
return taskList;
}
/**
*
* If set, specifies the priority with which the activity task is to be assigned to a worker. This overrides the
* defaultTaskPriority specified when registering the activity type using RegisterActivityType. Valid values
* are integers that range from Java's Integer.MIN_VALUE
(-2147483648) to
* Integer.MAX_VALUE
(2147483647). Higher numbers indicate higher priority.
*
*
* For more information about setting task priority, see Setting Task
* Priority in the Amazon SWF Developer Guide.
*
*
* @return If set, specifies the priority with which the activity task is to be assigned to a worker. This overrides
* the defaultTaskPriority specified when registering the activity type using RegisterActivityType.
* Valid values are integers that range from Java's Integer.MIN_VALUE
(-2147483648) to
* Integer.MAX_VALUE
(2147483647). Higher numbers indicate higher priority.
*
* For more information about setting task priority, see Setting Task
* Priority in the Amazon SWF Developer Guide.
*/
public String taskPriority() {
return taskPriority;
}
/**
*
* If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This overrides the
* default schedule-to-start timeout specified when registering the activity type using RegisterActivityType.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-start timeout for this activity task must be specified either as a default for the activity type or
* through this field. If neither this field is set nor a default schedule-to-start timeout was specified at
* registration time then a fault is returned.
*
*
*
* @return If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This
* overrides the default schedule-to-start timeout specified when registering the activity type using
* RegisterActivityType.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-start timeout for this activity task must be specified either as a default for the activity
* type or through this field. If neither this field is set nor a default schedule-to-start timeout was
* specified at registration time then a fault is returned.
*
*/
public String scheduleToStartTimeout() {
return scheduleToStartTimeout;
}
/**
*
* If set, specifies the maximum duration a worker may take to process this activity task. This overrides the
* default start-to-close timeout specified when registering the activity type using RegisterActivityType.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A start-to-close timeout for this activity task must be specified either as a default for the activity type or
* through this field. If neither this field is set nor a default start-to-close timeout was specified at
* registration time then a fault is returned.
*
*
*
* @return If set, specifies the maximum duration a worker may take to process this activity task. This overrides
* the default start-to-close timeout specified when registering the activity type using
* RegisterActivityType.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A start-to-close timeout for this activity task must be specified either as a default for the activity
* type or through this field. If neither this field is set nor a default start-to-close timeout was
* specified at registration time then a fault is returned.
*
*/
public String startToCloseTimeout() {
return startToCloseTimeout;
}
/**
*
* If set, specifies the maximum time before which a worker processing a task of this type must report progress by
* calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically timed
* out. If the worker subsequently attempts to record a heartbeat or returns a result, it is ignored. This overrides
* the default heartbeat timeout specified when registering the activity type using RegisterActivityType.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
* @return If set, specifies the maximum time before which a worker processing a task of this type must report
* progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is
* automatically timed out. If the worker subsequently attempts to record a heartbeat or returns a result,
* it is ignored. This overrides the default heartbeat timeout specified when registering the activity type
* using RegisterActivityType.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*/
public String heartbeatTimeout() {
return heartbeatTimeout;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(activityType());
hashCode = 31 * hashCode + Objects.hashCode(activityId());
hashCode = 31 * hashCode + Objects.hashCode(control());
hashCode = 31 * hashCode + Objects.hashCode(input());
hashCode = 31 * hashCode + Objects.hashCode(scheduleToCloseTimeout());
hashCode = 31 * hashCode + Objects.hashCode(taskList());
hashCode = 31 * hashCode + Objects.hashCode(taskPriority());
hashCode = 31 * hashCode + Objects.hashCode(scheduleToStartTimeout());
hashCode = 31 * hashCode + Objects.hashCode(startToCloseTimeout());
hashCode = 31 * hashCode + Objects.hashCode(heartbeatTimeout());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ScheduleActivityTaskDecisionAttributes)) {
return false;
}
ScheduleActivityTaskDecisionAttributes other = (ScheduleActivityTaskDecisionAttributes) obj;
return Objects.equals(activityType(), other.activityType()) && Objects.equals(activityId(), other.activityId())
&& Objects.equals(control(), other.control()) && Objects.equals(input(), other.input())
&& Objects.equals(scheduleToCloseTimeout(), other.scheduleToCloseTimeout())
&& Objects.equals(taskList(), other.taskList()) && Objects.equals(taskPriority(), other.taskPriority())
&& Objects.equals(scheduleToStartTimeout(), other.scheduleToStartTimeout())
&& Objects.equals(startToCloseTimeout(), other.startToCloseTimeout())
&& Objects.equals(heartbeatTimeout(), other.heartbeatTimeout());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public String toString() {
return ToString.builder("ScheduleActivityTaskDecisionAttributes").add("ActivityType", activityType())
.add("ActivityId", activityId()).add("Control", control()).add("Input", input())
.add("ScheduleToCloseTimeout", scheduleToCloseTimeout()).add("TaskList", taskList())
.add("TaskPriority", taskPriority()).add("ScheduleToStartTimeout", scheduleToStartTimeout())
.add("StartToCloseTimeout", startToCloseTimeout()).add("HeartbeatTimeout", heartbeatTimeout()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "activityType":
return Optional.ofNullable(clazz.cast(activityType()));
case "activityId":
return Optional.ofNullable(clazz.cast(activityId()));
case "control":
return Optional.ofNullable(clazz.cast(control()));
case "input":
return Optional.ofNullable(clazz.cast(input()));
case "scheduleToCloseTimeout":
return Optional.ofNullable(clazz.cast(scheduleToCloseTimeout()));
case "taskList":
return Optional.ofNullable(clazz.cast(taskList()));
case "taskPriority":
return Optional.ofNullable(clazz.cast(taskPriority()));
case "scheduleToStartTimeout":
return Optional.ofNullable(clazz.cast(scheduleToStartTimeout()));
case "startToCloseTimeout":
return Optional.ofNullable(clazz.cast(startToCloseTimeout()));
case "heartbeatTimeout":
return Optional.ofNullable(clazz.cast(heartbeatTimeout()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* The specified string must not start or end with whitespace. It must not contain a :
* (colon), /
(slash), |
(vertical bar), or any control characters (
* \u0000-\u001f
| \u007f-\u009f
). Also, it must not contain the literal string
* arn
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder activityId(String activityId);
/**
*
* Data attached to the event that can be used by the decider in subsequent workflow tasks. This data isn't sent
* to the activity.
*
*
* @param control
* Data attached to the event that can be used by the decider in subsequent workflow tasks. This data
* isn't sent to the activity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder control(String control);
/**
*
* The input provided to the activity task.
*
*
* @param input
* The input provided to the activity task.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder input(String input);
/**
*
* The maximum duration for this activity task.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-close timeout for this activity task must be specified either as a default for the activity
* type or through this field. If neither this field is set nor a default schedule-to-close timeout was
* specified at registration time then a fault is returned.
*
*
*
* @param scheduleToCloseTimeout
* The maximum duration for this activity task.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-close timeout for this activity task must be specified either as a default for the
* activity type or through this field. If neither this field is set nor a default schedule-to-close
* timeout was specified at registration time then a fault is returned.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder scheduleToCloseTimeout(String scheduleToCloseTimeout);
/**
*
* If set, specifies the name of the task list in which to schedule the activity task. If not specified, the
* defaultTaskList
registered with the activity type is used.
*
*
*
* A task list for this activity task must be specified either as a default for the activity type or through
* this field. If neither this field is set nor a default task list was specified at registration time then a
* fault is returned.
*
*
*
* The specified string must not start or end with whitespace. It must not contain a :
(colon),
* /
(slash), |
(vertical bar), or any control characters (\u0000-\u001f
* | \u007f-\u009f
). Also, it must not contain the literal string arn
.
*
*
* @param taskList
* If set, specifies the name of the task list in which to schedule the activity task. If not specified,
* the defaultTaskList
registered with the activity type is used.
*
* A task list for this activity task must be specified either as a default for the activity type or
* through this field. If neither this field is set nor a default task list was specified at registration
* time then a fault is returned.
*
*
*
* The specified string must not start or end with whitespace. It must not contain a :
* (colon), /
(slash), |
(vertical bar), or any control characters (
* \u0000-\u001f
| \u007f-\u009f
). Also, it must not contain the literal string
* arn
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder taskList(TaskList taskList);
/**
*
* If set, specifies the name of the task list in which to schedule the activity task. If not specified, the
* defaultTaskList
registered with the activity type is used.
*
*
*
* A task list for this activity task must be specified either as a default for the activity type or through
* this field. If neither this field is set nor a default task list was specified at registration time then a
* fault is returned.
*
*
*
* The specified string must not start or end with whitespace. It must not contain a :
(colon),
* /
(slash), |
(vertical bar), or any control characters (\u0000-\u001f
* | \u007f-\u009f
). Also, it must not contain the literal string arn
.
*
* This is a convenience that creates an instance of the {@link TaskList.Builder} avoiding the need to create
* one manually via {@link TaskList#builder()}.
*
* When the {@link Consumer} completes, {@link TaskList.Builder#build()} is called immediately and its result is
* passed to {@link #taskList(TaskList)}.
*
* @param taskList
* a consumer that will call methods on {@link TaskList.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #taskList(TaskList)
*/
default Builder taskList(Consumer taskList) {
return taskList(TaskList.builder().applyMutation(taskList).build());
}
/**
*
* If set, specifies the priority with which the activity task is to be assigned to a worker. This overrides the
* defaultTaskPriority specified when registering the activity type using RegisterActivityType. Valid
* values are integers that range from Java's Integer.MIN_VALUE
(-2147483648) to
* Integer.MAX_VALUE
(2147483647). Higher numbers indicate higher priority.
*
*
* For more information about setting task priority, see Setting Task
* Priority in the Amazon SWF Developer Guide.
*
*
* @param taskPriority
* If set, specifies the priority with which the activity task is to be assigned to a worker. This
* overrides the defaultTaskPriority specified when registering the activity type using
* RegisterActivityType. Valid values are integers that range from Java's
* Integer.MIN_VALUE
(-2147483648) to Integer.MAX_VALUE
(2147483647). Higher
* numbers indicate higher priority.
*
* For more information about setting task priority, see Setting
* Task Priority in the Amazon SWF Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder taskPriority(String taskPriority);
/**
*
* If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This overrides
* the default schedule-to-start timeout specified when registering the activity type using
* RegisterActivityType.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-start timeout for this activity task must be specified either as a default for the activity
* type or through this field. If neither this field is set nor a default schedule-to-start timeout was
* specified at registration time then a fault is returned.
*
*
*
* @param scheduleToStartTimeout
* If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This
* overrides the default schedule-to-start timeout specified when registering the activity type using
* RegisterActivityType.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A schedule-to-start timeout for this activity task must be specified either as a default for the
* activity type or through this field. If neither this field is set nor a default schedule-to-start
* timeout was specified at registration time then a fault is returned.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder scheduleToStartTimeout(String scheduleToStartTimeout);
/**
*
* If set, specifies the maximum duration a worker may take to process this activity task. This overrides the
* default start-to-close timeout specified when registering the activity type using
* RegisterActivityType.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A start-to-close timeout for this activity task must be specified either as a default for the activity type
* or through this field. If neither this field is set nor a default start-to-close timeout was specified at
* registration time then a fault is returned.
*
*
*
* @param startToCloseTimeout
* If set, specifies the maximum duration a worker may take to process this activity task. This overrides
* the default start-to-close timeout specified when registering the activity type using
* RegisterActivityType.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
*
* A start-to-close timeout for this activity task must be specified either as a default for the activity
* type or through this field. If neither this field is set nor a default start-to-close timeout was
* specified at registration time then a fault is returned.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder startToCloseTimeout(String startToCloseTimeout);
/**
*
* If set, specifies the maximum time before which a worker processing a task of this type must report progress
* by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically
* timed out. If the worker subsequently attempts to record a heartbeat or returns a result, it is ignored. This
* overrides the default heartbeat timeout specified when registering the activity type using
* RegisterActivityType.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
* @param heartbeatTimeout
* If set, specifies the maximum time before which a worker processing a task of this type must report
* progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task
* is automatically timed out. If the worker subsequently attempts to record a heartbeat or returns a
* result, it is ignored. This overrides the default heartbeat timeout specified when registering the
* activity type using RegisterActivityType.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder heartbeatTimeout(String heartbeatTimeout);
}
static final class BuilderImpl implements Builder {
private ActivityType activityType;
private String activityId;
private String control;
private String input;
private String scheduleToCloseTimeout;
private TaskList taskList;
private String taskPriority;
private String scheduleToStartTimeout;
private String startToCloseTimeout;
private String heartbeatTimeout;
private BuilderImpl() {
}
private BuilderImpl(ScheduleActivityTaskDecisionAttributes model) {
activityType(model.activityType);
activityId(model.activityId);
control(model.control);
input(model.input);
scheduleToCloseTimeout(model.scheduleToCloseTimeout);
taskList(model.taskList);
taskPriority(model.taskPriority);
scheduleToStartTimeout(model.scheduleToStartTimeout);
startToCloseTimeout(model.startToCloseTimeout);
heartbeatTimeout(model.heartbeatTimeout);
}
public final ActivityType.Builder getActivityType() {
return activityType != null ? activityType.toBuilder() : null;
}
@Override
public final Builder activityType(ActivityType activityType) {
this.activityType = activityType;
return this;
}
public final void setActivityType(ActivityType.BuilderImpl activityType) {
this.activityType = activityType != null ? activityType.build() : null;
}
public final String getActivityId() {
return activityId;
}
@Override
public final Builder activityId(String activityId) {
this.activityId = activityId;
return this;
}
public final void setActivityId(String activityId) {
this.activityId = activityId;
}
public final String getControl() {
return control;
}
@Override
public final Builder control(String control) {
this.control = control;
return this;
}
public final void setControl(String control) {
this.control = control;
}
public final String getInput() {
return input;
}
@Override
public final Builder input(String input) {
this.input = input;
return this;
}
public final void setInput(String input) {
this.input = input;
}
public final String getScheduleToCloseTimeout() {
return scheduleToCloseTimeout;
}
@Override
public final Builder scheduleToCloseTimeout(String scheduleToCloseTimeout) {
this.scheduleToCloseTimeout = scheduleToCloseTimeout;
return this;
}
public final void setScheduleToCloseTimeout(String scheduleToCloseTimeout) {
this.scheduleToCloseTimeout = scheduleToCloseTimeout;
}
public final TaskList.Builder getTaskList() {
return taskList != null ? taskList.toBuilder() : null;
}
@Override
public final Builder taskList(TaskList taskList) {
this.taskList = taskList;
return this;
}
public final void setTaskList(TaskList.BuilderImpl taskList) {
this.taskList = taskList != null ? taskList.build() : null;
}
public final String getTaskPriority() {
return taskPriority;
}
@Override
public final Builder taskPriority(String taskPriority) {
this.taskPriority = taskPriority;
return this;
}
public final void setTaskPriority(String taskPriority) {
this.taskPriority = taskPriority;
}
public final String getScheduleToStartTimeout() {
return scheduleToStartTimeout;
}
@Override
public final Builder scheduleToStartTimeout(String scheduleToStartTimeout) {
this.scheduleToStartTimeout = scheduleToStartTimeout;
return this;
}
public final void setScheduleToStartTimeout(String scheduleToStartTimeout) {
this.scheduleToStartTimeout = scheduleToStartTimeout;
}
public final String getStartToCloseTimeout() {
return startToCloseTimeout;
}
@Override
public final Builder startToCloseTimeout(String startToCloseTimeout) {
this.startToCloseTimeout = startToCloseTimeout;
return this;
}
public final void setStartToCloseTimeout(String startToCloseTimeout) {
this.startToCloseTimeout = startToCloseTimeout;
}
public final String getHeartbeatTimeout() {
return heartbeatTimeout;
}
@Override
public final Builder heartbeatTimeout(String heartbeatTimeout) {
this.heartbeatTimeout = heartbeatTimeout;
return this;
}
public final void setHeartbeatTimeout(String heartbeatTimeout) {
this.heartbeatTimeout = heartbeatTimeout;
}
@Override
public ScheduleActivityTaskDecisionAttributes build() {
return new ScheduleActivityTaskDecisionAttributes(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}