All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.batch.model.JobDetail Maven / Gradle / Ivy

/*
 * Copyright 2012-2017 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 com.amazonaws.services.batch.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* An object representing an AWS Batch job. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class JobDetail implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the job. *

*/ private String jobName; /** *

* The ID for the job. *

*/ private String jobId; /** *

* The Amazon Resource Name (ARN) of the job queue with which the job is associated. *

*/ private String jobQueue; /** *

* The current status for the job. *

*/ private String status; /** *

* A short, human-readable string to provide additional details about the current status of the job. *

*/ private String statusReason; /** *

* The Unix timestamp for when the job was created (when the task entered the PENDING state). *

*/ private Long createdAt; /** *

* The Unix timestamp for when the job was started (when the task transitioned from the PENDING state * to the RUNNING state). *

*/ private Long startedAt; /** *

* The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING state * to the STOPPED state). *

*/ private Long stoppedAt; /** *

* A list of job names or IDs on which this job depends. *

*/ private java.util.List dependsOn; /** *

* The job definition that is used by this job. *

*/ private String jobDefinition; /** *

* Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. *

*/ private java.util.Map parameters; /** *

* An object representing the details of the container that is associated with the job. *

*/ private ContainerDetail container; /** *

* The name of the job. *

* * @param jobName * The name of the job. */ public void setJobName(String jobName) { this.jobName = jobName; } /** *

* The name of the job. *

* * @return The name of the job. */ public String getJobName() { return this.jobName; } /** *

* The name of the job. *

* * @param jobName * The name of the job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withJobName(String jobName) { setJobName(jobName); return this; } /** *

* The ID for the job. *

* * @param jobId * The ID for the job. */ public void setJobId(String jobId) { this.jobId = jobId; } /** *

* The ID for the job. *

* * @return The ID for the job. */ public String getJobId() { return this.jobId; } /** *

* The ID for the job. *

* * @param jobId * The ID for the job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withJobId(String jobId) { setJobId(jobId); return this; } /** *

* The Amazon Resource Name (ARN) of the job queue with which the job is associated. *

* * @param jobQueue * The Amazon Resource Name (ARN) of the job queue with which the job is associated. */ public void setJobQueue(String jobQueue) { this.jobQueue = jobQueue; } /** *

* The Amazon Resource Name (ARN) of the job queue with which the job is associated. *

* * @return The Amazon Resource Name (ARN) of the job queue with which the job is associated. */ public String getJobQueue() { return this.jobQueue; } /** *

* The Amazon Resource Name (ARN) of the job queue with which the job is associated. *

* * @param jobQueue * The Amazon Resource Name (ARN) of the job queue with which the job is associated. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withJobQueue(String jobQueue) { setJobQueue(jobQueue); return this; } /** *

* The current status for the job. *

* * @param status * The current status for the job. * @see JobStatus */ public void setStatus(String status) { this.status = status; } /** *

* The current status for the job. *

* * @return The current status for the job. * @see JobStatus */ public String getStatus() { return this.status; } /** *

* The current status for the job. *

* * @param status * The current status for the job. * @return Returns a reference to this object so that method calls can be chained together. * @see JobStatus */ public JobDetail withStatus(String status) { setStatus(status); return this; } /** *

* The current status for the job. *

* * @param status * The current status for the job. * @see JobStatus */ public void setStatus(JobStatus status) { this.status = status.toString(); } /** *

* The current status for the job. *

* * @param status * The current status for the job. * @return Returns a reference to this object so that method calls can be chained together. * @see JobStatus */ public JobDetail withStatus(JobStatus status) { setStatus(status); return this; } /** *

* A short, human-readable string to provide additional details about the current status of the job. *

* * @param statusReason * A short, human-readable string to provide additional details about the current status of the job. */ public void setStatusReason(String statusReason) { this.statusReason = statusReason; } /** *

* A short, human-readable string to provide additional details about the current status of the job. *

* * @return A short, human-readable string to provide additional details about the current status of the job. */ public String getStatusReason() { return this.statusReason; } /** *

* A short, human-readable string to provide additional details about the current status of the job. *

* * @param statusReason * A short, human-readable string to provide additional details about the current status of the job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withStatusReason(String statusReason) { setStatusReason(statusReason); return this; } /** *

* The Unix timestamp for when the job was created (when the task entered the PENDING state). *

* * @param createdAt * The Unix timestamp for when the job was created (when the task entered the PENDING state). */ public void setCreatedAt(Long createdAt) { this.createdAt = createdAt; } /** *

* The Unix timestamp for when the job was created (when the task entered the PENDING state). *

* * @return The Unix timestamp for when the job was created (when the task entered the PENDING state). */ public Long getCreatedAt() { return this.createdAt; } /** *

* The Unix timestamp for when the job was created (when the task entered the PENDING state). *

* * @param createdAt * The Unix timestamp for when the job was created (when the task entered the PENDING state). * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withCreatedAt(Long createdAt) { setCreatedAt(createdAt); return this; } /** *

* The Unix timestamp for when the job was started (when the task transitioned from the PENDING state * to the RUNNING state). *

* * @param startedAt * The Unix timestamp for when the job was started (when the task transitioned from the PENDING * state to the RUNNING state). */ public void setStartedAt(Long startedAt) { this.startedAt = startedAt; } /** *

* The Unix timestamp for when the job was started (when the task transitioned from the PENDING state * to the RUNNING state). *

* * @return The Unix timestamp for when the job was started (when the task transitioned from the PENDING * state to the RUNNING state). */ public Long getStartedAt() { return this.startedAt; } /** *

* The Unix timestamp for when the job was started (when the task transitioned from the PENDING state * to the RUNNING state). *

* * @param startedAt * The Unix timestamp for when the job was started (when the task transitioned from the PENDING * state to the RUNNING state). * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withStartedAt(Long startedAt) { setStartedAt(startedAt); return this; } /** *

* The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING state * to the STOPPED state). *

* * @param stoppedAt * The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING * state to the STOPPED state). */ public void setStoppedAt(Long stoppedAt) { this.stoppedAt = stoppedAt; } /** *

* The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING state * to the STOPPED state). *

* * @return The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING * state to the STOPPED state). */ public Long getStoppedAt() { return this.stoppedAt; } /** *

* The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING state * to the STOPPED state). *

* * @param stoppedAt * The Unix timestamp for when the job was stopped (when the task transitioned from the RUNNING * state to the STOPPED state). * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withStoppedAt(Long stoppedAt) { setStoppedAt(stoppedAt); return this; } /** *

* A list of job names or IDs on which this job depends. *

* * @return A list of job names or IDs on which this job depends. */ public java.util.List getDependsOn() { return dependsOn; } /** *

* A list of job names or IDs on which this job depends. *

* * @param dependsOn * A list of job names or IDs on which this job depends. */ public void setDependsOn(java.util.Collection dependsOn) { if (dependsOn == null) { this.dependsOn = null; return; } this.dependsOn = new java.util.ArrayList(dependsOn); } /** *

* A list of job names or IDs on which this job depends. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setDependsOn(java.util.Collection)} or {@link #withDependsOn(java.util.Collection)} if you want to * override the existing values. *

* * @param dependsOn * A list of job names or IDs on which this job depends. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withDependsOn(JobDependency... dependsOn) { if (this.dependsOn == null) { setDependsOn(new java.util.ArrayList(dependsOn.length)); } for (JobDependency ele : dependsOn) { this.dependsOn.add(ele); } return this; } /** *

* A list of job names or IDs on which this job depends. *

* * @param dependsOn * A list of job names or IDs on which this job depends. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withDependsOn(java.util.Collection dependsOn) { setDependsOn(dependsOn); return this; } /** *

* The job definition that is used by this job. *

* * @param jobDefinition * The job definition that is used by this job. */ public void setJobDefinition(String jobDefinition) { this.jobDefinition = jobDefinition; } /** *

* The job definition that is used by this job. *

* * @return The job definition that is used by this job. */ public String getJobDefinition() { return this.jobDefinition; } /** *

* The job definition that is used by this job. *

* * @param jobDefinition * The job definition that is used by this job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withJobDefinition(String jobDefinition) { setJobDefinition(jobDefinition); return this; } /** *

* Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. *

* * @return Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. */ public java.util.Map getParameters() { return parameters; } /** *

* Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. *

* * @param parameters * Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. */ public void setParameters(java.util.Map parameters) { this.parameters = parameters; } /** *

* Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. *

* * @param parameters * Additional parameters passed to the job that replace parameter substitution placeholders or override any * corresponding parameter defaults from the job definition. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withParameters(java.util.Map parameters) { setParameters(parameters); return this; } public JobDetail addParametersEntry(String key, String value) { if (null == this.parameters) { this.parameters = new java.util.HashMap(); } if (this.parameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.parameters.put(key, value); return this; } /** * Removes all the entries added into Parameters. * * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail clearParametersEntries() { this.parameters = null; return this; } /** *

* An object representing the details of the container that is associated with the job. *

* * @param container * An object representing the details of the container that is associated with the job. */ public void setContainer(ContainerDetail container) { this.container = container; } /** *

* An object representing the details of the container that is associated with the job. *

* * @return An object representing the details of the container that is associated with the job. */ public ContainerDetail getContainer() { return this.container; } /** *

* An object representing the details of the container that is associated with the job. *

* * @param container * An object representing the details of the container that is associated with the job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobDetail withContainer(ContainerDetail container) { setContainer(container); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getJobName() != null) sb.append("JobName: ").append(getJobName()).append(","); if (getJobId() != null) sb.append("JobId: ").append(getJobId()).append(","); if (getJobQueue() != null) sb.append("JobQueue: ").append(getJobQueue()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getStatusReason() != null) sb.append("StatusReason: ").append(getStatusReason()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getStartedAt() != null) sb.append("StartedAt: ").append(getStartedAt()).append(","); if (getStoppedAt() != null) sb.append("StoppedAt: ").append(getStoppedAt()).append(","); if (getDependsOn() != null) sb.append("DependsOn: ").append(getDependsOn()).append(","); if (getJobDefinition() != null) sb.append("JobDefinition: ").append(getJobDefinition()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getContainer() != null) sb.append("Container: ").append(getContainer()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof JobDetail == false) return false; JobDetail other = (JobDetail) obj; if (other.getJobName() == null ^ this.getJobName() == null) return false; if (other.getJobName() != null && other.getJobName().equals(this.getJobName()) == false) return false; if (other.getJobId() == null ^ this.getJobId() == null) return false; if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == false) return false; if (other.getJobQueue() == null ^ this.getJobQueue() == null) return false; if (other.getJobQueue() != null && other.getJobQueue().equals(this.getJobQueue()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getStatusReason() == null ^ this.getStatusReason() == null) return false; if (other.getStatusReason() != null && other.getStatusReason().equals(this.getStatusReason()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getStartedAt() == null ^ this.getStartedAt() == null) return false; if (other.getStartedAt() != null && other.getStartedAt().equals(this.getStartedAt()) == false) return false; if (other.getStoppedAt() == null ^ this.getStoppedAt() == null) return false; if (other.getStoppedAt() != null && other.getStoppedAt().equals(this.getStoppedAt()) == false) return false; if (other.getDependsOn() == null ^ this.getDependsOn() == null) return false; if (other.getDependsOn() != null && other.getDependsOn().equals(this.getDependsOn()) == false) return false; if (other.getJobDefinition() == null ^ this.getJobDefinition() == null) return false; if (other.getJobDefinition() != null && other.getJobDefinition().equals(this.getJobDefinition()) == false) return false; if (other.getParameters() == null ^ this.getParameters() == null) return false; if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false) return false; if (other.getContainer() == null ^ this.getContainer() == null) return false; if (other.getContainer() != null && other.getContainer().equals(this.getContainer()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getJobName() == null) ? 0 : getJobName().hashCode()); hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode()); hashCode = prime * hashCode + ((getJobQueue() == null) ? 0 : getJobQueue().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStatusReason() == null) ? 0 : getStatusReason().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getStartedAt() == null) ? 0 : getStartedAt().hashCode()); hashCode = prime * hashCode + ((getStoppedAt() == null) ? 0 : getStoppedAt().hashCode()); hashCode = prime * hashCode + ((getDependsOn() == null) ? 0 : getDependsOn().hashCode()); hashCode = prime * hashCode + ((getJobDefinition() == null) ? 0 : getJobDefinition().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getContainer() == null) ? 0 : getContainer().hashCode()); return hashCode; } @Override public JobDetail clone() { try { return (JobDetail) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.batch.model.transform.JobDetailMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy