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.opsworks.model;
 
 
Container for the parameters to the RegisterInstance operation.

Registers instances with a specified stack that were created outside of AWS OpsWorks.

NOTE:We do not recommend using this action to register instances. The complete registration operation has two primary steps, installing the AWS OpsWorks agent on the instance and registering the instance with the stack. RegisterInstance handles only the second step. You should instead use the AWS CLI register command, which performs the entire registration operation.

Required Permissions : To use this action, an IAM user must have a Manage permissions level for the stack or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions .

 
 public class RegisterInstanceRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The ID of the stack that the instance is to be registered with.
 
     private String stackId;

    
The instance's hostname.
 
     private String hostname;

    
The instance's public IP address.
 
     private String publicIp;

    
The instance's private IP address.
 
     private String privateIp;

    
The instances public RSA key. This key is used to encrypt communication between the instance and the service.
 
     private String rsaPublicKey;

    
The instances public RSA key fingerprint.
 
     private String rsaPublicKeyFingerprint;

    
An InstanceIdentity object that contains the instance's identity.
 
     private InstanceIdentity instanceIdentity;

    
The ID of the stack that the instance is to be registered with.

Returns:
The ID of the stack that the instance is to be registered with.
 
     public String getStackId() {
         return ;
     }
    
    
The ID of the stack that the instance is to be registered with.

Parameters:
stackId The ID of the stack that the instance is to be registered with.
 
     public void setStackId(String stackId) {
         this. = stackId;
    }
    
    
The ID of the stack that the instance is to be registered with.

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

Parameters:
stackId The ID of the stack that the instance is to be registered with.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterInstanceRequest withStackId(String stackId) {
        this. = stackId;
        return this;
    }

    
The instance's hostname.

Returns:
The instance's hostname.
    public String getHostname() {
        return ;
    }
    
    
The instance's hostname.

Parameters:
hostname The instance's hostname.
    public void setHostname(String hostname) {
        this. = hostname;
    }
    
    
The instance's hostname.

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

Parameters:
hostname The instance's hostname.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterInstanceRequest withHostname(String hostname) {
        this. = hostname;
        return this;
    }

    
The instance's public IP address.

Returns:
The instance's public IP address.
    public String getPublicIp() {
        return ;
    }
    
    
The instance's public IP address.

Parameters:
publicIp The instance's public IP address.
    public void setPublicIp(String publicIp) {
        this. = publicIp;
    }
    
    
The instance's public IP address.

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

Parameters:
publicIp The instance's public IP address.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterInstanceRequest withPublicIp(String publicIp) {
        this. = publicIp;
        return this;
    }

    
The instance's private IP address.

Returns:
The instance's private IP address.
    public String getPrivateIp() {
        return ;
    }
    
    
The instance's private IP address.

Parameters:
privateIp The instance's private IP address.
    public void setPrivateIp(String privateIp) {
        this. = privateIp;
    }
    
    
The instance's private IP address.

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

Parameters:
privateIp The instance's private IP address.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterInstanceRequest withPrivateIp(String privateIp) {
        this. = privateIp;
        return this;
    }

    
The instances public RSA key. This key is used to encrypt communication between the instance and the service.

Returns:
The instances public RSA key. This key is used to encrypt communication between the instance and the service.
    public String getRsaPublicKey() {
        return ;
    }
    
    
The instances public RSA key. This key is used to encrypt communication between the instance and the service.

Parameters:
rsaPublicKey The instances public RSA key. This key is used to encrypt communication between the instance and the service.
    public void setRsaPublicKey(String rsaPublicKey) {
        this. = rsaPublicKey;
    }
    
    
The instances public RSA key. This key is used to encrypt communication between the instance and the service.

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

Parameters:
rsaPublicKey The instances public RSA key. This key is used to encrypt communication between the instance and the service.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterInstanceRequest withRsaPublicKey(String rsaPublicKey) {
        this. = rsaPublicKey;
        return this;
    }

    
The instances public RSA key fingerprint.

Returns:
The instances public RSA key fingerprint.
        return ;
    }
    
    
The instances public RSA key fingerprint.

Parameters:
rsaPublicKeyFingerprint The instances public RSA key fingerprint.
    public void setRsaPublicKeyFingerprint(String rsaPublicKeyFingerprint) {
        this. = rsaPublicKeyFingerprint;
    }
    
    
The instances public RSA key fingerprint.

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

Parameters:
rsaPublicKeyFingerprint The instances public RSA key fingerprint.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterInstanceRequest withRsaPublicKeyFingerprint(String rsaPublicKeyFingerprint) {
        this. = rsaPublicKeyFingerprint;
        return this;
    }

    
An InstanceIdentity object that contains the instance's identity.

Returns:
An InstanceIdentity object that contains the instance's identity.
        return ;
    }
    
    
An InstanceIdentity object that contains the instance's identity.

Parameters:
instanceIdentity An InstanceIdentity object that contains the instance's identity.
    public void setInstanceIdentity(InstanceIdentity instanceIdentity) {
        this. = instanceIdentity;
    }
    
    
An InstanceIdentity object that contains the instance's identity.

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

Parameters:
instanceIdentity An InstanceIdentity object that contains the instance's identity.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = instanceIdentity;
        return this;
    }

    
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 (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getHostname() != nullsb.append("Hostname: " + getHostname() + ",");
        if (getPublicIp() != nullsb.append("PublicIp: " + getPublicIp() + ",");
        if (getPrivateIp() != nullsb.append("PrivateIp: " + getPrivateIp() + ",");
        if (getRsaPublicKey() != nullsb.append("RsaPublicKey: " + getRsaPublicKey() + ",");
        if (getRsaPublicKeyFingerprint() != nullsb.append("RsaPublicKeyFingerprint: " + getRsaPublicKeyFingerprint() + ",");
        if (getInstanceIdentity() != nullsb.append("InstanceIdentity: " + getInstanceIdentity() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getHostname() == null) ? 0 : getHostname().hashCode()); 
        hashCode = prime * hashCode + ((getPublicIp() == null) ? 0 : getPublicIp().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIp() == null) ? 0 : getPrivateIp().hashCode()); 
        hashCode = prime * hashCode + ((getRsaPublicKey() == null) ? 0 : getRsaPublicKey().hashCode()); 
        hashCode = prime * hashCode + ((getRsaPublicKeyFingerprint() == null) ? 0 : getRsaPublicKeyFingerprint().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceIdentity() == null) ? 0 : getInstanceIdentity().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RegisterInstanceRequest == falsereturn false;
        RegisterInstanceRequest other = (RegisterInstanceRequest)obj;
        
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getHostname() == null ^ this.getHostname() == nullreturn false;
        if (other.getHostname() != null && other.getHostname().equals(this.getHostname()) == falsereturn false
        if (other.getPublicIp() == null ^ this.getPublicIp() == nullreturn false;
        if (other.getPublicIp() != null && other.getPublicIp().equals(this.getPublicIp()) == falsereturn false
        if (other.getPrivateIp() == null ^ this.getPrivateIp() == nullreturn false;
        if (other.getPrivateIp() != null && other.getPrivateIp().equals(this.getPrivateIp()) == falsereturn false
        if (other.getRsaPublicKey() == null ^ this.getRsaPublicKey() == nullreturn false;
        if (other.getRsaPublicKey() != null && other.getRsaPublicKey().equals(this.getRsaPublicKey()) == falsereturn false
        if (other.getRsaPublicKeyFingerprint() == null ^ this.getRsaPublicKeyFingerprint() == nullreturn false;
        if (other.getRsaPublicKeyFingerprint() != null && other.getRsaPublicKeyFingerprint().equals(this.getRsaPublicKeyFingerprint()) == falsereturn false
        if (other.getInstanceIdentity() == null ^ this.getInstanceIdentity() == nullreturn false;
        if (other.getInstanceIdentity() != null && other.getInstanceIdentity().equals(this.getInstanceIdentity()) == falsereturn false
        return true;
    }
    
    @Override
    public RegisterInstanceRequest clone() {
        
            return (RegisterInstanceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X