/* * 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.glue.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The period in which a remote Spark runtime environment is running. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Session implements Serializable, Cloneable, StructuredPojo { /** ** The ID of the session. *
*/ private String id; /** ** The time and date when the session was created. *
*/ private java.util.Date createdOn; /** ** The session status. *
*/ private String status; /** ** The error message displayed during the session. *
*/ private String errorMessage; /** ** The description of the session. *
*/ private String description; /** ** The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. *
*/ private String role; /** ** The command object.See SessionCommand. *
*/ private SessionCommand command; /** ** A map array of key-value pairs. Max is 75 pairs. *
*/ private java.util.Map* The number of connections used for the session. *
*/ private ConnectionsList connections; /** ** The code execution progress of the session. *
*/ private Double progress; /** ** The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative * measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. *
*/ private Double maxCapacity; /** ** The name of the SecurityConfiguration structure to be used with the session. *
*/ private String securityConfiguration; /** ** The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be * greater than 2.0. *
*/ private String glueVersion; /** ** The ID of the session. *
* * @param id * The ID of the session. */ public void setId(String id) { this.id = id; } /** ** The ID of the session. *
* * @return The ID of the session. */ public String getId() { return this.id; } /** ** The ID of the session. *
* * @param id * The ID of the session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withId(String id) { setId(id); return this; } /** ** The time and date when the session was created. *
* * @param createdOn * The time and date when the session was created. */ public void setCreatedOn(java.util.Date createdOn) { this.createdOn = createdOn; } /** ** The time and date when the session was created. *
* * @return The time and date when the session was created. */ public java.util.Date getCreatedOn() { return this.createdOn; } /** ** The time and date when the session was created. *
* * @param createdOn * The time and date when the session was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withCreatedOn(java.util.Date createdOn) { setCreatedOn(createdOn); return this; } /** ** The session status. *
* * @param status * The session status. * @see SessionStatus */ public void setStatus(String status) { this.status = status; } /** ** The session status. *
* * @return The session status. * @see SessionStatus */ public String getStatus() { return this.status; } /** ** The session status. *
* * @param status * The session status. * @return Returns a reference to this object so that method calls can be chained together. * @see SessionStatus */ public Session withStatus(String status) { setStatus(status); return this; } /** ** The session status. *
* * @param status * The session status. * @return Returns a reference to this object so that method calls can be chained together. * @see SessionStatus */ public Session withStatus(SessionStatus status) { this.status = status.toString(); return this; } /** ** The error message displayed during the session. *
* * @param errorMessage * The error message displayed during the session. */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } /** ** The error message displayed during the session. *
* * @return The error message displayed during the session. */ public String getErrorMessage() { return this.errorMessage; } /** ** The error message displayed during the session. *
* * @param errorMessage * The error message displayed during the session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withErrorMessage(String errorMessage) { setErrorMessage(errorMessage); return this; } /** ** The description of the session. *
* * @param description * The description of the session. */ public void setDescription(String description) { this.description = description; } /** ** The description of the session. *
* * @return The description of the session. */ public String getDescription() { return this.description; } /** ** The description of the session. *
* * @param description * The description of the session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withDescription(String description) { setDescription(description); return this; } /** ** The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. *
* * @param role * The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. */ public void setRole(String role) { this.role = role; } /** ** The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. *
* * @return The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. */ public String getRole() { return this.role; } /** ** The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. *
* * @param role * The name or Amazon Resource Name (ARN) of the IAM role associated with the Session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withRole(String role) { setRole(role); return this; } /** ** The command object.See SessionCommand. *
* * @param command * The command object.See SessionCommand. */ public void setCommand(SessionCommand command) { this.command = command; } /** ** The command object.See SessionCommand. *
* * @return The command object.See SessionCommand. */ public SessionCommand getCommand() { return this.command; } /** ** The command object.See SessionCommand. *
* * @param command * The command object.See SessionCommand. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withCommand(SessionCommand command) { setCommand(command); return this; } /** ** A map array of key-value pairs. Max is 75 pairs. *
* * @return A map array of key-value pairs. Max is 75 pairs. */ public java.util.Map* A map array of key-value pairs. Max is 75 pairs. *
* * @param defaultArguments * A map array of key-value pairs. Max is 75 pairs. */ public void setDefaultArguments(java.util.Map* A map array of key-value pairs. Max is 75 pairs. *
* * @param defaultArguments * A map array of key-value pairs. Max is 75 pairs. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withDefaultArguments(java.util.Map* The number of connections used for the session. *
* * @param connections * The number of connections used for the session. */ public void setConnections(ConnectionsList connections) { this.connections = connections; } /** ** The number of connections used for the session. *
* * @return The number of connections used for the session. */ public ConnectionsList getConnections() { return this.connections; } /** ** The number of connections used for the session. *
* * @param connections * The number of connections used for the session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withConnections(ConnectionsList connections) { setConnections(connections); return this; } /** ** The code execution progress of the session. *
* * @param progress * The code execution progress of the session. */ public void setProgress(Double progress) { this.progress = progress; } /** ** The code execution progress of the session. *
* * @return The code execution progress of the session. */ public Double getProgress() { return this.progress; } /** ** The code execution progress of the session. *
* * @param progress * The code execution progress of the session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withProgress(Double progress) { setProgress(progress); return this; } /** ** The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative * measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. *
* * @param maxCapacity * The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a * relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. */ public void setMaxCapacity(Double maxCapacity) { this.maxCapacity = maxCapacity; } /** ** The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative * measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. *
* * @return The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a * relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. */ public Double getMaxCapacity() { return this.maxCapacity; } /** ** The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative * measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. *
* * @param maxCapacity * The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a * relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withMaxCapacity(Double maxCapacity) { setMaxCapacity(maxCapacity); return this; } /** ** The name of the SecurityConfiguration structure to be used with the session. *
* * @param securityConfiguration * The name of the SecurityConfiguration structure to be used with the session. */ public void setSecurityConfiguration(String securityConfiguration) { this.securityConfiguration = securityConfiguration; } /** ** The name of the SecurityConfiguration structure to be used with the session. *
* * @return The name of the SecurityConfiguration structure to be used with the session. */ public String getSecurityConfiguration() { return this.securityConfiguration; } /** ** The name of the SecurityConfiguration structure to be used with the session. *
* * @param securityConfiguration * The name of the SecurityConfiguration structure to be used with the session. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withSecurityConfiguration(String securityConfiguration) { setSecurityConfiguration(securityConfiguration); return this; } /** ** The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be * greater than 2.0. *
* * @param glueVersion * The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion * must be greater than 2.0. */ public void setGlueVersion(String glueVersion) { this.glueVersion = glueVersion; } /** ** The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be * greater than 2.0. *
* * @return The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion * must be greater than 2.0. */ public String getGlueVersion() { return this.glueVersion; } /** ** The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be * greater than 2.0. *
* * @param glueVersion * The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion * must be greater than 2.0. * @return Returns a reference to this object so that method calls can be chained together. */ public Session withGlueVersion(String glueVersion) { setGlueVersion(glueVersion); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getCreatedOn() != null) sb.append("CreatedOn: ").append(getCreatedOn()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getErrorMessage() != null) sb.append("ErrorMessage: ").append(getErrorMessage()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getRole() != null) sb.append("Role: ").append(getRole()).append(","); if (getCommand() != null) sb.append("Command: ").append(getCommand()).append(","); if (getDefaultArguments() != null) sb.append("DefaultArguments: ").append(getDefaultArguments()).append(","); if (getConnections() != null) sb.append("Connections: ").append(getConnections()).append(","); if (getProgress() != null) sb.append("Progress: ").append(getProgress()).append(","); if (getMaxCapacity() != null) sb.append("MaxCapacity: ").append(getMaxCapacity()).append(","); if (getSecurityConfiguration() != null) sb.append("SecurityConfiguration: ").append(getSecurityConfiguration()).append(","); if (getGlueVersion() != null) sb.append("GlueVersion: ").append(getGlueVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Session == false) return false; Session other = (Session) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getCreatedOn() == null ^ this.getCreatedOn() == null) return false; if (other.getCreatedOn() != null && other.getCreatedOn().equals(this.getCreatedOn()) == 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.getErrorMessage() == null ^ this.getErrorMessage() == null) return false; if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getRole() == null ^ this.getRole() == null) return false; if (other.getRole() != null && other.getRole().equals(this.getRole()) == false) return false; if (other.getCommand() == null ^ this.getCommand() == null) return false; if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == false) return false; if (other.getDefaultArguments() == null ^ this.getDefaultArguments() == null) return false; if (other.getDefaultArguments() != null && other.getDefaultArguments().equals(this.getDefaultArguments()) == false) return false; if (other.getConnections() == null ^ this.getConnections() == null) return false; if (other.getConnections() != null && other.getConnections().equals(this.getConnections()) == false) return false; if (other.getProgress() == null ^ this.getProgress() == null) return false; if (other.getProgress() != null && other.getProgress().equals(this.getProgress()) == false) return false; if (other.getMaxCapacity() == null ^ this.getMaxCapacity() == null) return false; if (other.getMaxCapacity() != null && other.getMaxCapacity().equals(this.getMaxCapacity()) == false) return false; if (other.getSecurityConfiguration() == null ^ this.getSecurityConfiguration() == null) return false; if (other.getSecurityConfiguration() != null && other.getSecurityConfiguration().equals(this.getSecurityConfiguration()) == false) return false; if (other.getGlueVersion() == null ^ this.getGlueVersion() == null) return false; if (other.getGlueVersion() != null && other.getGlueVersion().equals(this.getGlueVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getCreatedOn() == null) ? 0 : getCreatedOn().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getRole() == null) ? 0 : getRole().hashCode()); hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); hashCode = prime * hashCode + ((getDefaultArguments() == null) ? 0 : getDefaultArguments().hashCode()); hashCode = prime * hashCode + ((getConnections() == null) ? 0 : getConnections().hashCode()); hashCode = prime * hashCode + ((getProgress() == null) ? 0 : getProgress().hashCode()); hashCode = prime * hashCode + ((getMaxCapacity() == null) ? 0 : getMaxCapacity().hashCode()); hashCode = prime * hashCode + ((getSecurityConfiguration() == null) ? 0 : getSecurityConfiguration().hashCode()); hashCode = prime * hashCode + ((getGlueVersion() == null) ? 0 : getGlueVersion().hashCode()); return hashCode; } @Override public Session clone() { try { return (Session) 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.glue.model.transform.SessionMarshaller.getInstance().marshall(this, protocolMarshaller); } }