/* * Copyright 2018-2023 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.iotjobsdataplane.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains data about a job execution. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class JobExecution implements Serializable, Cloneable, StructuredPojo { /** ** The unique identifier you assigned to this job when it was created. *
*/ private String jobId; /** ** The name of the thing that is executing the job. *
*/ private String thingName; /** ** The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". *
*/ private String status; /** ** A collection of name/value pairs that describe the status of the job execution. *
*/ private java.util.Map* The time, in milliseconds since the epoch, when the job execution was enqueued. *
*/ private Long queuedAt; /** ** The time, in milliseconds since the epoch, when the job execution was started. *
*/ private Long startedAt; /** ** The time, in milliseconds since the epoch, when the job execution was last updated. *
*/ private Long lastUpdatedAt; /** *
* The estimated number of seconds that remain before the job execution status will be changed to
* TIMED_OUT
.
*
* The version of the job execution. Job execution versions are incremented each time they are updated by a device. *
*/ private Long versionNumber; /** ** A number that identifies a particular job execution on a particular device. It can be used later in commands that * return or update job execution information. *
*/ private Long executionNumber; /** ** The content of the job document. *
*/ private String jobDocument; /** ** The unique identifier you assigned to this job when it was created. *
* * @param jobId * The unique identifier you assigned to this job when it was created. */ public void setJobId(String jobId) { this.jobId = jobId; } /** ** The unique identifier you assigned to this job when it was created. *
* * @return The unique identifier you assigned to this job when it was created. */ public String getJobId() { return this.jobId; } /** ** The unique identifier you assigned to this job when it was created. *
* * @param jobId * The unique identifier you assigned to this job when it was created. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withJobId(String jobId) { setJobId(jobId); return this; } /** ** The name of the thing that is executing the job. *
* * @param thingName * The name of the thing that is executing the job. */ public void setThingName(String thingName) { this.thingName = thingName; } /** ** The name of the thing that is executing the job. *
* * @return The name of the thing that is executing the job. */ public String getThingName() { return this.thingName; } /** ** The name of the thing that is executing the job. *
* * @param thingName * The name of the thing that is executing the job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withThingName(String thingName) { setThingName(thingName); return this; } /** ** The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". *
* * @param status * The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". * @see JobExecutionStatus */ public void setStatus(String status) { this.status = status; } /** ** The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". *
* * @return The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". * @see JobExecutionStatus */ public String getStatus() { return this.status; } /** ** The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". *
* * @param status * The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". * @return Returns a reference to this object so that method calls can be chained together. * @see JobExecutionStatus */ public JobExecution withStatus(String status) { setStatus(status); return this; } /** ** The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". *
* * @param status * The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", * "REJECTED", or "REMOVED". * @return Returns a reference to this object so that method calls can be chained together. * @see JobExecutionStatus */ public JobExecution withStatus(JobExecutionStatus status) { this.status = status.toString(); return this; } /** ** A collection of name/value pairs that describe the status of the job execution. *
* * @return A collection of name/value pairs that describe the status of the job execution. */ public java.util.Map* A collection of name/value pairs that describe the status of the job execution. *
* * @param statusDetails * A collection of name/value pairs that describe the status of the job execution. */ public void setStatusDetails(java.util.Map* A collection of name/value pairs that describe the status of the job execution. *
* * @param statusDetails * A collection of name/value pairs that describe the status of the job execution. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withStatusDetails(java.util.Map* The time, in milliseconds since the epoch, when the job execution was enqueued. *
* * @param queuedAt * The time, in milliseconds since the epoch, when the job execution was enqueued. */ public void setQueuedAt(Long queuedAt) { this.queuedAt = queuedAt; } /** ** The time, in milliseconds since the epoch, when the job execution was enqueued. *
* * @return The time, in milliseconds since the epoch, when the job execution was enqueued. */ public Long getQueuedAt() { return this.queuedAt; } /** ** The time, in milliseconds since the epoch, when the job execution was enqueued. *
* * @param queuedAt * The time, in milliseconds since the epoch, when the job execution was enqueued. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withQueuedAt(Long queuedAt) { setQueuedAt(queuedAt); return this; } /** ** The time, in milliseconds since the epoch, when the job execution was started. *
* * @param startedAt * The time, in milliseconds since the epoch, when the job execution was started. */ public void setStartedAt(Long startedAt) { this.startedAt = startedAt; } /** ** The time, in milliseconds since the epoch, when the job execution was started. *
* * @return The time, in milliseconds since the epoch, when the job execution was started. */ public Long getStartedAt() { return this.startedAt; } /** ** The time, in milliseconds since the epoch, when the job execution was started. *
* * @param startedAt * The time, in milliseconds since the epoch, when the job execution was started. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withStartedAt(Long startedAt) { setStartedAt(startedAt); return this; } /** ** The time, in milliseconds since the epoch, when the job execution was last updated. *
* * @param lastUpdatedAt * The time, in milliseconds since the epoch, when the job execution was last updated. */ public void setLastUpdatedAt(Long lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; } /** ** The time, in milliseconds since the epoch, when the job execution was last updated. *
* * @return The time, in milliseconds since the epoch, when the job execution was last updated. */ public Long getLastUpdatedAt() { return this.lastUpdatedAt; } /** ** The time, in milliseconds since the epoch, when the job execution was last updated. *
* * @param lastUpdatedAt * The time, in milliseconds since the epoch, when the job execution was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withLastUpdatedAt(Long lastUpdatedAt) { setLastUpdatedAt(lastUpdatedAt); return this; } /** *
* The estimated number of seconds that remain before the job execution status will be changed to
* TIMED_OUT
.
*
TIMED_OUT
.
*/
public void setApproximateSecondsBeforeTimedOut(Long approximateSecondsBeforeTimedOut) {
this.approximateSecondsBeforeTimedOut = approximateSecondsBeforeTimedOut;
}
/**
*
* The estimated number of seconds that remain before the job execution status will be changed to
* TIMED_OUT
.
*
TIMED_OUT
.
*/
public Long getApproximateSecondsBeforeTimedOut() {
return this.approximateSecondsBeforeTimedOut;
}
/**
*
* The estimated number of seconds that remain before the job execution status will be changed to
* TIMED_OUT
.
*
TIMED_OUT
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobExecution withApproximateSecondsBeforeTimedOut(Long approximateSecondsBeforeTimedOut) {
setApproximateSecondsBeforeTimedOut(approximateSecondsBeforeTimedOut);
return this;
}
/**
* * The version of the job execution. Job execution versions are incremented each time they are updated by a device. *
* * @param versionNumber * The version of the job execution. Job execution versions are incremented each time they are updated by a * device. */ public void setVersionNumber(Long versionNumber) { this.versionNumber = versionNumber; } /** ** The version of the job execution. Job execution versions are incremented each time they are updated by a device. *
* * @return The version of the job execution. Job execution versions are incremented each time they are updated by a * device. */ public Long getVersionNumber() { return this.versionNumber; } /** ** The version of the job execution. Job execution versions are incremented each time they are updated by a device. *
* * @param versionNumber * The version of the job execution. Job execution versions are incremented each time they are updated by a * device. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withVersionNumber(Long versionNumber) { setVersionNumber(versionNumber); return this; } /** ** A number that identifies a particular job execution on a particular device. It can be used later in commands that * return or update job execution information. *
* * @param executionNumber * A number that identifies a particular job execution on a particular device. It can be used later in * commands that return or update job execution information. */ public void setExecutionNumber(Long executionNumber) { this.executionNumber = executionNumber; } /** ** A number that identifies a particular job execution on a particular device. It can be used later in commands that * return or update job execution information. *
* * @return A number that identifies a particular job execution on a particular device. It can be used later in * commands that return or update job execution information. */ public Long getExecutionNumber() { return this.executionNumber; } /** ** A number that identifies a particular job execution on a particular device. It can be used later in commands that * return or update job execution information. *
* * @param executionNumber * A number that identifies a particular job execution on a particular device. It can be used later in * commands that return or update job execution information. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withExecutionNumber(Long executionNumber) { setExecutionNumber(executionNumber); return this; } /** ** The content of the job document. *
* * @param jobDocument * The content of the job document. */ public void setJobDocument(String jobDocument) { this.jobDocument = jobDocument; } /** ** The content of the job document. *
* * @return The content of the job document. */ public String getJobDocument() { return this.jobDocument; } /** ** The content of the job document. *
* * @param jobDocument * The content of the job document. * @return Returns a reference to this object so that method calls can be chained together. */ public JobExecution withJobDocument(String jobDocument) { setJobDocument(jobDocument); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getJobId() != null) sb.append("JobId: ").append(getJobId()).append(","); if (getThingName() != null) sb.append("ThingName: ").append(getThingName()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getStatusDetails() != null) sb.append("StatusDetails: ").append(getStatusDetails()).append(","); if (getQueuedAt() != null) sb.append("QueuedAt: ").append(getQueuedAt()).append(","); if (getStartedAt() != null) sb.append("StartedAt: ").append(getStartedAt()).append(","); if (getLastUpdatedAt() != null) sb.append("LastUpdatedAt: ").append(getLastUpdatedAt()).append(","); if (getApproximateSecondsBeforeTimedOut() != null) sb.append("ApproximateSecondsBeforeTimedOut: ").append(getApproximateSecondsBeforeTimedOut()).append(","); if (getVersionNumber() != null) sb.append("VersionNumber: ").append(getVersionNumber()).append(","); if (getExecutionNumber() != null) sb.append("ExecutionNumber: ").append(getExecutionNumber()).append(","); if (getJobDocument() != null) sb.append("JobDocument: ").append(getJobDocument()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof JobExecution == false) return false; JobExecution other = (JobExecution) obj; if (other.getJobId() == null ^ this.getJobId() == null) return false; if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == false) return false; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == 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.getStatusDetails() == null ^ this.getStatusDetails() == null) return false; if (other.getStatusDetails() != null && other.getStatusDetails().equals(this.getStatusDetails()) == false) return false; if (other.getQueuedAt() == null ^ this.getQueuedAt() == null) return false; if (other.getQueuedAt() != null && other.getQueuedAt().equals(this.getQueuedAt()) == 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.getLastUpdatedAt() == null ^ this.getLastUpdatedAt() == null) return false; if (other.getLastUpdatedAt() != null && other.getLastUpdatedAt().equals(this.getLastUpdatedAt()) == false) return false; if (other.getApproximateSecondsBeforeTimedOut() == null ^ this.getApproximateSecondsBeforeTimedOut() == null) return false; if (other.getApproximateSecondsBeforeTimedOut() != null && other.getApproximateSecondsBeforeTimedOut().equals(this.getApproximateSecondsBeforeTimedOut()) == false) return false; if (other.getVersionNumber() == null ^ this.getVersionNumber() == null) return false; if (other.getVersionNumber() != null && other.getVersionNumber().equals(this.getVersionNumber()) == false) return false; if (other.getExecutionNumber() == null ^ this.getExecutionNumber() == null) return false; if (other.getExecutionNumber() != null && other.getExecutionNumber().equals(this.getExecutionNumber()) == false) return false; if (other.getJobDocument() == null ^ this.getJobDocument() == null) return false; if (other.getJobDocument() != null && other.getJobDocument().equals(this.getJobDocument()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode()); hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStatusDetails() == null) ? 0 : getStatusDetails().hashCode()); hashCode = prime * hashCode + ((getQueuedAt() == null) ? 0 : getQueuedAt().hashCode()); hashCode = prime * hashCode + ((getStartedAt() == null) ? 0 : getStartedAt().hashCode()); hashCode = prime * hashCode + ((getLastUpdatedAt() == null) ? 0 : getLastUpdatedAt().hashCode()); hashCode = prime * hashCode + ((getApproximateSecondsBeforeTimedOut() == null) ? 0 : getApproximateSecondsBeforeTimedOut().hashCode()); hashCode = prime * hashCode + ((getVersionNumber() == null) ? 0 : getVersionNumber().hashCode()); hashCode = prime * hashCode + ((getExecutionNumber() == null) ? 0 : getExecutionNumber().hashCode()); hashCode = prime * hashCode + ((getJobDocument() == null) ? 0 : getJobDocument().hashCode()); return hashCode; } @Override public JobExecution clone() { try { return (JobExecution) 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.iotjobsdataplane.model.transform.JobExecutionMarshaller.getInstance().marshall(this, protocolMarshaller); } }