Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.elasticmapreduce.model;
 
 
Container for the parameters to the SetTerminationProtection operation.

SetTerminationProtection locks a job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling SetTerminationProtection on a job flow is analogous to calling the Amazon EC2 DisableAPITermination API on all of the EC2 instances in a cluster.

SetTerminationProtection is used to prevent accidental termination of a job flow and to ensure that in the event of an error, the instances will persist so you can recover any data stored in their ephemeral instance storage.

To terminate a job flow that has been locked by setting SetTerminationProtection to true , you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false .

For more information, go to Protecting a Job Flow from Termination in the Amazon Elastic MapReduce Developer's Guide.

 
 public class SetTerminationProtectionRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
 
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.
 
     private Boolean terminationProtected;

    
A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .

Returns:
A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
 
     public java.util.List<StringgetJobFlowIds() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .

Parameters:
jobFlowIds A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
 
     public void setJobFlowIds(java.util.Collection<StringjobFlowIds) {
         if (jobFlowIds == null) {
             this. = null;
             return;
         }
        jobFlowIdsCopy.addAll(jobFlowIds);
        this. = jobFlowIdsCopy;
    }
    
    
A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .

NOTE: This method appends the values to the existing list (if any). Use setJobFlowIds(java.util.Collection) or withJobFlowIds(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
jobFlowIds A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetTerminationProtectionRequest withJobFlowIds(String... jobFlowIds) {
        if (getJobFlowIds() == nullsetJobFlowIds(new java.util.ArrayList<String>(jobFlowIds.length));
        for (String value : jobFlowIds) {
            getJobFlowIds().add(value);
        }
        return this;
    }
    
    
A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .

Returns a reference to this object so that method calls can be chained together.

Parameters:
jobFlowIds A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
Returns:
A reference to this updated object so that method calls can be chained together.
        if (jobFlowIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringjobFlowIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(jobFlowIds.size());
            jobFlowIdsCopy.addAll(jobFlowIds);
            this. = jobFlowIdsCopy;
        }
        return this;
    }

    
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.

Returns:
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.
    public Boolean isTerminationProtected() {
        return ;
    }
    
    
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.

Parameters:
terminationProtected A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.
    public void setTerminationProtected(Boolean terminationProtected) {
        this. = terminationProtected;
    }
    
    
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.

Returns a reference to this object so that method calls can be chained together.

Parameters:
terminationProtected A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetTerminationProtectionRequest withTerminationProtected(Boolean terminationProtected) {
        this. = terminationProtected;
        return this;
    }

    
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.

Returns:
A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.
    public Boolean getTerminationProtected() {
        return ;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getJobFlowIds() != nullsb.append("JobFlowIds: " + getJobFlowIds() + ",");
        if (isTerminationProtected() != nullsb.append("TerminationProtected: " + isTerminationProtected() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getJobFlowIds() == null) ? 0 : getJobFlowIds().hashCode()); 
        hashCode = prime * hashCode + ((isTerminationProtected() == null) ? 0 : isTerminationProtected().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SetTerminationProtectionRequest == falsereturn false;
        
        if (other.getJobFlowIds() == null ^ this.getJobFlowIds() == nullreturn false;
        if (other.getJobFlowIds() != null && other.getJobFlowIds().equals(this.getJobFlowIds()) == falsereturn false
        if (other.isTerminationProtected() == null ^ this.isTerminationProtected() == nullreturn false;
        if (other.isTerminationProtected() != null && other.isTerminationProtected().equals(this.isTerminationProtected()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (SetTerminationProtectionRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X