Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.batch.model.JobQueueDetail 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.batch.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* An object that represents the details for an Batch job queue.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class JobQueueDetail implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField JOB_QUEUE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("jobQueueName").getter(getter(JobQueueDetail::jobQueueName)).setter(setter(Builder::jobQueueName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobQueueName").build()).build();
private static final SdkField JOB_QUEUE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("jobQueueArn").getter(getter(JobQueueDetail::jobQueueArn)).setter(setter(Builder::jobQueueArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobQueueArn").build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("state")
.getter(getter(JobQueueDetail::stateAsString)).setter(setter(Builder::state))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("state").build()).build();
private static final SdkField SCHEDULING_POLICY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("schedulingPolicyArn").getter(getter(JobQueueDetail::schedulingPolicyArn))
.setter(setter(Builder::schedulingPolicyArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schedulingPolicyArn").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(JobQueueDetail::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("statusReason").getter(getter(JobQueueDetail::statusReason)).setter(setter(Builder::statusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusReason").build()).build();
private static final SdkField PRIORITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("priority").getter(getter(JobQueueDetail::priority)).setter(setter(Builder::priority))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("priority").build()).build();
private static final SdkField> COMPUTE_ENVIRONMENT_ORDER_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("computeEnvironmentOrder")
.getter(getter(JobQueueDetail::computeEnvironmentOrder))
.setter(setter(Builder::computeEnvironmentOrder))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("computeEnvironmentOrder").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ComputeEnvironmentOrder::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(JobQueueDetail::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField> JOB_STATE_TIME_LIMIT_ACTIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("jobStateTimeLimitActions")
.getter(getter(JobQueueDetail::jobStateTimeLimitActions))
.setter(setter(Builder::jobStateTimeLimitActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobStateTimeLimitActions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(JobStateTimeLimitAction::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_QUEUE_NAME_FIELD,
JOB_QUEUE_ARN_FIELD, STATE_FIELD, SCHEDULING_POLICY_ARN_FIELD, STATUS_FIELD, STATUS_REASON_FIELD, PRIORITY_FIELD,
COMPUTE_ENVIRONMENT_ORDER_FIELD, TAGS_FIELD, JOB_STATE_TIME_LIMIT_ACTIONS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("jobQueueName", JOB_QUEUE_NAME_FIELD);
put("jobQueueArn", JOB_QUEUE_ARN_FIELD);
put("state", STATE_FIELD);
put("schedulingPolicyArn", SCHEDULING_POLICY_ARN_FIELD);
put("status", STATUS_FIELD);
put("statusReason", STATUS_REASON_FIELD);
put("priority", PRIORITY_FIELD);
put("computeEnvironmentOrder", COMPUTE_ENVIRONMENT_ORDER_FIELD);
put("tags", TAGS_FIELD);
put("jobStateTimeLimitActions", JOB_STATE_TIME_LIMIT_ACTIONS_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String jobQueueName;
private final String jobQueueArn;
private final String state;
private final String schedulingPolicyArn;
private final String status;
private final String statusReason;
private final Integer priority;
private final List computeEnvironmentOrder;
private final Map tags;
private final List jobStateTimeLimitActions;
private JobQueueDetail(BuilderImpl builder) {
this.jobQueueName = builder.jobQueueName;
this.jobQueueArn = builder.jobQueueArn;
this.state = builder.state;
this.schedulingPolicyArn = builder.schedulingPolicyArn;
this.status = builder.status;
this.statusReason = builder.statusReason;
this.priority = builder.priority;
this.computeEnvironmentOrder = builder.computeEnvironmentOrder;
this.tags = builder.tags;
this.jobStateTimeLimitActions = builder.jobStateTimeLimitActions;
}
/**
*
* The job queue name.
*
*
* @return The job queue name.
*/
public final String jobQueueName() {
return jobQueueName;
}
/**
*
* The Amazon Resource Name (ARN) of the job queue.
*
*
* @return The Amazon Resource Name (ARN) of the job queue.
*/
public final String jobQueueArn() {
return jobQueueArn;
}
/**
*
* Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
, it can
* accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the queue, but jobs
* already in the queue can finish.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return
* {@link JQState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stateAsString}.
*
*
* @return Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
, it
* can accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the queue,
* but jobs already in the queue can finish.
* @see JQState
*/
public final JQState state() {
return JQState.fromValue(state);
}
/**
*
* Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
, it can
* accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the queue, but jobs
* already in the queue can finish.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return
* {@link JQState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stateAsString}.
*
*
* @return Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
, it
* can accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the queue,
* but jobs already in the queue can finish.
* @see JQState
*/
public final String stateAsString() {
return state;
}
/**
*
* The Amazon Resource Name (ARN) of the scheduling policy. The format is
* aws:Partition :batch:Region :Account :scheduling-policy/Name
. For example,
* aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy
.
*
*
* @return The Amazon Resource Name (ARN) of the scheduling policy. The format is
* aws:Partition :batch:Region :Account :scheduling-policy/Name
. For
* example, aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy
.
*/
public final String schedulingPolicyArn() {
return schedulingPolicyArn;
}
/**
*
* The status of the job queue (for example, CREATING
or VALID
).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link JQStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the job queue (for example, CREATING
or VALID
).
* @see JQStatus
*/
public final JQStatus status() {
return JQStatus.fromValue(status);
}
/**
*
* The status of the job queue (for example, CREATING
or VALID
).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link JQStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the job queue (for example, CREATING
or VALID
).
* @see JQStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* A short, human-readable string to provide additional details for the current status of the job queue.
*
*
* @return A short, human-readable string to provide additional details for the current status of the job queue.
*/
public final String statusReason() {
return statusReason;
}
/**
*
* The priority of the job queue. Job queues with a higher priority (or a higher integer value for the
* priority
parameter) are evaluated first when associated with the same compute environment. Priority
* is determined in descending order. For example, a job queue with a priority value of 10
is given
* scheduling preference over a job queue with a priority value of 1
. All of the compute environments
* must be either Amazon EC2 (EC2
or SPOT
) or Fargate (FARGATE
or
* FARGATE_SPOT
). Amazon EC2 and Fargate compute environments can't be mixed.
*
*
* @return The priority of the job queue. Job queues with a higher priority (or a higher integer value for the
* priority
parameter) are evaluated first when associated with the same compute environment.
* Priority is determined in descending order. For example, a job queue with a priority value of
* 10
is given scheduling preference over a job queue with a priority value of 1
.
* All of the compute environments must be either Amazon EC2 (EC2
or SPOT
) or
* Fargate (FARGATE
or FARGATE_SPOT
). Amazon EC2 and Fargate compute environments
* can't be mixed.
*/
public final Integer priority() {
return priority;
}
/**
* For responses, this returns true if the service returned a value for the ComputeEnvironmentOrder property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasComputeEnvironmentOrder() {
return computeEnvironmentOrder != null && !(computeEnvironmentOrder instanceof SdkAutoConstructList);
}
/**
*
* The compute environments that are attached to the job queue and the order that job placement is preferred.
* Compute environments are selected for job placement in ascending order.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasComputeEnvironmentOrder} method.
*
*
* @return The compute environments that are attached to the job queue and the order that job placement is
* preferred. Compute environments are selected for job placement in ascending order.
*/
public final List computeEnvironmentOrder() {
return computeEnvironmentOrder;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The tags that are applied to the job queue. For more information, see Tagging your Batch resources in
* Batch User Guide .
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The tags that are applied to the job queue. For more information, see Tagging your Batch
* resources in Batch User Guide .
*/
public final Map tags() {
return tags;
}
/**
* For responses, this returns true if the service returned a value for the JobStateTimeLimitActions property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasJobStateTimeLimitActions() {
return jobStateTimeLimitActions != null && !(jobStateTimeLimitActions instanceof SdkAutoConstructList);
}
/**
*
* The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified state
* longer than specified times. Batch will perform each action after maxTimeSeconds
has passed.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasJobStateTimeLimitActions} method.
*
*
* @return The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified
* state longer than specified times. Batch will perform each action after maxTimeSeconds
has
* passed.
*/
public final List jobStateTimeLimitActions() {
return jobStateTimeLimitActions;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(jobQueueName());
hashCode = 31 * hashCode + Objects.hashCode(jobQueueArn());
hashCode = 31 * hashCode + Objects.hashCode(stateAsString());
hashCode = 31 * hashCode + Objects.hashCode(schedulingPolicyArn());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusReason());
hashCode = 31 * hashCode + Objects.hashCode(priority());
hashCode = 31 * hashCode + Objects.hashCode(hasComputeEnvironmentOrder() ? computeEnvironmentOrder() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasJobStateTimeLimitActions() ? jobStateTimeLimitActions() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof JobQueueDetail)) {
return false;
}
JobQueueDetail other = (JobQueueDetail) obj;
return Objects.equals(jobQueueName(), other.jobQueueName()) && Objects.equals(jobQueueArn(), other.jobQueueArn())
&& Objects.equals(stateAsString(), other.stateAsString())
&& Objects.equals(schedulingPolicyArn(), other.schedulingPolicyArn())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(statusReason(), other.statusReason()) && Objects.equals(priority(), other.priority())
&& hasComputeEnvironmentOrder() == other.hasComputeEnvironmentOrder()
&& Objects.equals(computeEnvironmentOrder(), other.computeEnvironmentOrder()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags()) && hasJobStateTimeLimitActions() == other.hasJobStateTimeLimitActions()
&& Objects.equals(jobStateTimeLimitActions(), other.jobStateTimeLimitActions());
}
/**
* 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 final String toString() {
return ToString.builder("JobQueueDetail").add("JobQueueName", jobQueueName()).add("JobQueueArn", jobQueueArn())
.add("State", stateAsString()).add("SchedulingPolicyArn", schedulingPolicyArn()).add("Status", statusAsString())
.add("StatusReason", statusReason()).add("Priority", priority())
.add("ComputeEnvironmentOrder", hasComputeEnvironmentOrder() ? computeEnvironmentOrder() : null)
.add("Tags", hasTags() ? tags() : null)
.add("JobStateTimeLimitActions", hasJobStateTimeLimitActions() ? jobStateTimeLimitActions() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "jobQueueName":
return Optional.ofNullable(clazz.cast(jobQueueName()));
case "jobQueueArn":
return Optional.ofNullable(clazz.cast(jobQueueArn()));
case "state":
return Optional.ofNullable(clazz.cast(stateAsString()));
case "schedulingPolicyArn":
return Optional.ofNullable(clazz.cast(schedulingPolicyArn()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "statusReason":
return Optional.ofNullable(clazz.cast(statusReason()));
case "priority":
return Optional.ofNullable(clazz.cast(priority()));
case "computeEnvironmentOrder":
return Optional.ofNullable(clazz.cast(computeEnvironmentOrder()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
case "jobStateTimeLimitActions":
return Optional.ofNullable(clazz.cast(jobStateTimeLimitActions()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function getter(Function g) {
return obj -> g.apply((JobQueueDetail) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The job queue name.
*
*
* @param jobQueueName
* The job queue name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder jobQueueName(String jobQueueName);
/**
*
* The Amazon Resource Name (ARN) of the job queue.
*
*
* @param jobQueueArn
* The Amazon Resource Name (ARN) of the job queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder jobQueueArn(String jobQueueArn);
/**
*
* Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
, it can
* accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the queue, but jobs
* already in the queue can finish.
*
*
* @param state
* Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
,
* it can accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the
* queue, but jobs already in the queue can finish.
* @see JQState
* @return Returns a reference to this object so that method calls can be chained together.
* @see JQState
*/
Builder state(String state);
/**
*
* Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
, it can
* accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the queue, but jobs
* already in the queue can finish.
*
*
* @param state
* Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED
,
* it can accept jobs. If the job queue state is DISABLED
, new jobs can't be added to the
* queue, but jobs already in the queue can finish.
* @see JQState
* @return Returns a reference to this object so that method calls can be chained together.
* @see JQState
*/
Builder state(JQState state);
/**
*
* The Amazon Resource Name (ARN) of the scheduling policy. The format is
* aws:Partition :batch:Region :Account :scheduling-policy/Name
. For
* example, aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy
.
*
*
* @param schedulingPolicyArn
* The Amazon Resource Name (ARN) of the scheduling policy. The format is
* aws:Partition :batch:Region :Account :scheduling-policy/Name
.
* For example, aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder schedulingPolicyArn(String schedulingPolicyArn);
/**
*
* The status of the job queue (for example, CREATING
or VALID
).
*
*
* @param status
* The status of the job queue (for example, CREATING
or VALID
).
* @see JQStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see JQStatus
*/
Builder status(String status);
/**
*
* The status of the job queue (for example, CREATING
or VALID
).
*
*
* @param status
* The status of the job queue (for example, CREATING
or VALID
).
* @see JQStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see JQStatus
*/
Builder status(JQStatus status);
/**
*
* A short, human-readable string to provide additional details for the current status of the job queue.
*
*
* @param statusReason
* A short, human-readable string to provide additional details for the current status of the job queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder statusReason(String statusReason);
/**
*
* The priority of the job queue. Job queues with a higher priority (or a higher integer value for the
* priority
parameter) are evaluated first when associated with the same compute environment.
* Priority is determined in descending order. For example, a job queue with a priority value of 10
* is given scheduling preference over a job queue with a priority value of 1
. All of the compute
* environments must be either Amazon EC2 (EC2
or SPOT
) or Fargate (
* FARGATE
or FARGATE_SPOT
). Amazon EC2 and Fargate compute environments can't be
* mixed.
*
*
* @param priority
* The priority of the job queue. Job queues with a higher priority (or a higher integer value for the
* priority
parameter) are evaluated first when associated with the same compute
* environment. Priority is determined in descending order. For example, a job queue with a priority
* value of 10
is given scheduling preference over a job queue with a priority value of
* 1
. All of the compute environments must be either Amazon EC2 (EC2
or
* SPOT
) or Fargate (FARGATE
or FARGATE_SPOT
). Amazon EC2 and
* Fargate compute environments can't be mixed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder priority(Integer priority);
/**
*
* The compute environments that are attached to the job queue and the order that job placement is preferred.
* Compute environments are selected for job placement in ascending order.
*
*
* @param computeEnvironmentOrder
* The compute environments that are attached to the job queue and the order that job placement is
* preferred. Compute environments are selected for job placement in ascending order.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder computeEnvironmentOrder(Collection computeEnvironmentOrder);
/**
*
* The compute environments that are attached to the job queue and the order that job placement is preferred.
* Compute environments are selected for job placement in ascending order.
*
*
* @param computeEnvironmentOrder
* The compute environments that are attached to the job queue and the order that job placement is
* preferred. Compute environments are selected for job placement in ascending order.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder computeEnvironmentOrder(ComputeEnvironmentOrder... computeEnvironmentOrder);
/**
*
* The compute environments that are attached to the job queue and the order that job placement is preferred.
* Compute environments are selected for job placement in ascending order.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.batch.model.ComputeEnvironmentOrder.Builder} avoiding the need to
* create one manually via {@link software.amazon.awssdk.services.batch.model.ComputeEnvironmentOrder#builder()}
* .
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.batch.model.ComputeEnvironmentOrder.Builder#build()} is called
* immediately and its result is passed to {@link #computeEnvironmentOrder(List)}.
*
* @param computeEnvironmentOrder
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.batch.model.ComputeEnvironmentOrder.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #computeEnvironmentOrder(java.util.Collection)
*/
Builder computeEnvironmentOrder(Consumer... computeEnvironmentOrder);
/**
*
* The tags that are applied to the job queue. For more information, see Tagging your Batch resources in
* Batch User Guide .
*
*
* @param tags
* The tags that are applied to the job queue. For more information, see Tagging your Batch
* resources in Batch User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
*
* The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified state
* longer than specified times. Batch will perform each action after maxTimeSeconds
has passed.
*
*
* @param jobStateTimeLimitActions
* The set of actions that Batch perform on jobs that remain at the head of the job queue in the
* specified state longer than specified times. Batch will perform each action after
* maxTimeSeconds
has passed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder jobStateTimeLimitActions(Collection jobStateTimeLimitActions);
/**
*
* The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified state
* longer than specified times. Batch will perform each action after maxTimeSeconds
has passed.
*
*
* @param jobStateTimeLimitActions
* The set of actions that Batch perform on jobs that remain at the head of the job queue in the
* specified state longer than specified times. Batch will perform each action after
* maxTimeSeconds
has passed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder jobStateTimeLimitActions(JobStateTimeLimitAction... jobStateTimeLimitActions);
/**
*
* The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified state
* longer than specified times. Batch will perform each action after maxTimeSeconds
has passed.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.batch.model.JobStateTimeLimitAction.Builder} avoiding the need to
* create one manually via {@link software.amazon.awssdk.services.batch.model.JobStateTimeLimitAction#builder()}
* .
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.batch.model.JobStateTimeLimitAction.Builder#build()} is called
* immediately and its result is passed to {@link #jobStateTimeLimitActions(List)}.
*
* @param jobStateTimeLimitActions
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.batch.model.JobStateTimeLimitAction.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #jobStateTimeLimitActions(java.util.Collection)
*/
Builder jobStateTimeLimitActions(Consumer... jobStateTimeLimitActions);
}
static final class BuilderImpl implements Builder {
private String jobQueueName;
private String jobQueueArn;
private String state;
private String schedulingPolicyArn;
private String status;
private String statusReason;
private Integer priority;
private List computeEnvironmentOrder = DefaultSdkAutoConstructList.getInstance();
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private List jobStateTimeLimitActions = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(JobQueueDetail model) {
jobQueueName(model.jobQueueName);
jobQueueArn(model.jobQueueArn);
state(model.state);
schedulingPolicyArn(model.schedulingPolicyArn);
status(model.status);
statusReason(model.statusReason);
priority(model.priority);
computeEnvironmentOrder(model.computeEnvironmentOrder);
tags(model.tags);
jobStateTimeLimitActions(model.jobStateTimeLimitActions);
}
public final String getJobQueueName() {
return jobQueueName;
}
public final void setJobQueueName(String jobQueueName) {
this.jobQueueName = jobQueueName;
}
@Override
public final Builder jobQueueName(String jobQueueName) {
this.jobQueueName = jobQueueName;
return this;
}
public final String getJobQueueArn() {
return jobQueueArn;
}
public final void setJobQueueArn(String jobQueueArn) {
this.jobQueueArn = jobQueueArn;
}
@Override
public final Builder jobQueueArn(String jobQueueArn) {
this.jobQueueArn = jobQueueArn;
return this;
}
public final String getState() {
return state;
}
public final void setState(String state) {
this.state = state;
}
@Override
public final Builder state(String state) {
this.state = state;
return this;
}
@Override
public final Builder state(JQState state) {
this.state(state == null ? null : state.toString());
return this;
}
public final String getSchedulingPolicyArn() {
return schedulingPolicyArn;
}
public final void setSchedulingPolicyArn(String schedulingPolicyArn) {
this.schedulingPolicyArn = schedulingPolicyArn;
}
@Override
public final Builder schedulingPolicyArn(String schedulingPolicyArn) {
this.schedulingPolicyArn = schedulingPolicyArn;
return this;
}
public final String getStatus() {
return status;
}
public final void setStatus(String status) {
this.status = status;
}
@Override
public final Builder status(String status) {
this.status = status;
return this;
}
@Override
public final Builder status(JQStatus status) {
this.status(status == null ? null : status.toString());
return this;
}
public final String getStatusReason() {
return statusReason;
}
public final void setStatusReason(String statusReason) {
this.statusReason = statusReason;
}
@Override
public final Builder statusReason(String statusReason) {
this.statusReason = statusReason;
return this;
}
public final Integer getPriority() {
return priority;
}
public final void setPriority(Integer priority) {
this.priority = priority;
}
@Override
public final Builder priority(Integer priority) {
this.priority = priority;
return this;
}
public final List getComputeEnvironmentOrder() {
List result = ComputeEnvironmentOrdersCopier
.copyToBuilder(this.computeEnvironmentOrder);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setComputeEnvironmentOrder(Collection computeEnvironmentOrder) {
this.computeEnvironmentOrder = ComputeEnvironmentOrdersCopier.copyFromBuilder(computeEnvironmentOrder);
}
@Override
public final Builder computeEnvironmentOrder(Collection computeEnvironmentOrder) {
this.computeEnvironmentOrder = ComputeEnvironmentOrdersCopier.copy(computeEnvironmentOrder);
return this;
}
@Override
@SafeVarargs
public final Builder computeEnvironmentOrder(ComputeEnvironmentOrder... computeEnvironmentOrder) {
computeEnvironmentOrder(Arrays.asList(computeEnvironmentOrder));
return this;
}
@Override
@SafeVarargs
public final Builder computeEnvironmentOrder(Consumer... computeEnvironmentOrder) {
computeEnvironmentOrder(Stream.of(computeEnvironmentOrder)
.map(c -> ComputeEnvironmentOrder.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagrisTagsMapCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagrisTagsMapCopier.copy(tags);
return this;
}
public final List getJobStateTimeLimitActions() {
List result = JobStateTimeLimitActionsCopier
.copyToBuilder(this.jobStateTimeLimitActions);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setJobStateTimeLimitActions(Collection jobStateTimeLimitActions) {
this.jobStateTimeLimitActions = JobStateTimeLimitActionsCopier.copyFromBuilder(jobStateTimeLimitActions);
}
@Override
public final Builder jobStateTimeLimitActions(Collection jobStateTimeLimitActions) {
this.jobStateTimeLimitActions = JobStateTimeLimitActionsCopier.copy(jobStateTimeLimitActions);
return this;
}
@Override
@SafeVarargs
public final Builder jobStateTimeLimitActions(JobStateTimeLimitAction... jobStateTimeLimitActions) {
jobStateTimeLimitActions(Arrays.asList(jobStateTimeLimitActions));
return this;
}
@Override
@SafeVarargs
public final Builder jobStateTimeLimitActions(Consumer... jobStateTimeLimitActions) {
jobStateTimeLimitActions(Stream.of(jobStateTimeLimitActions)
.map(c -> JobStateTimeLimitAction.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
@Override
public JobQueueDetail build() {
return new JobQueueDetail(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
@Override
public Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
}
}