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.elasticloadbalancing.model;
 

Information about a listener.

For information about the protocols and the ports supported by Elastic Load Balancing, see Listener Configurations for Elastic Load Balancing in the Elastic Load Balancing Developer Guide .

 
 public class Listener implements SerializableCloneable {

    
The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.
 
     private String protocol;

    
The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.
 
     private Integer loadBalancerPort;

    
The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

 
     private String instanceProtocol;

    
The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.

Constraints:
Range: 1 - 65535

 
     private Integer instancePort;

    
The Amazon Resource Name (ARN) of the server certificate.
 
     private String sSLCertificateId;

    
Default constructor for a new Listener object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public Listener() {}
    
    
Constructs a new Listener object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
protocol The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.
loadBalancerPort The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.
instancePort The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.
 
     public Listener(String protocolInteger loadBalancerPortInteger instancePort) {
         setProtocol(protocol);
         setLoadBalancerPort(loadBalancerPort);
         setInstancePort(instancePort);
     }

    
The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.

Returns:
The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.
    public String getProtocol() {
        return ;
    }
    
    
The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.

Parameters:
protocol The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.
    public void setProtocol(String protocol) {
        this. = protocol;
    }
    
    
The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.

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

Parameters:
protocol The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Listener withProtocol(String protocol) {
        this. = protocol;
        return this;
    }

    
The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.

Returns:
The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.
    public Integer getLoadBalancerPort() {
        return ;
    }
    
    
The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.

Parameters:
loadBalancerPort The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.
    public void setLoadBalancerPort(Integer loadBalancerPort) {
        this. = loadBalancerPort;
    }
    
    
The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.

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

Parameters:
loadBalancerPort The port on which the load balancer is listening: 25, 80, 443, 465, 587, or 1024-65535.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Listener withLoadBalancerPort(Integer loadBalancerPort) {
        this. = loadBalancerPort;
        return this;
    }

    
The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

Returns:
The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

    public String getInstanceProtocol() {
        return ;
    }
    
    
The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

Parameters:
instanceProtocol The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

    public void setInstanceProtocol(String instanceProtocol) {
        this. = instanceProtocol;
    }
    
    
The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

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

Parameters:
instanceProtocol The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must be at the same protocol.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

Returns:
A reference to this updated object so that method calls can be chained together.
    public Listener withInstanceProtocol(String instanceProtocol) {
        this. = instanceProtocol;
        return this;
    }

    
The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.

Constraints:
Range: 1 - 65535

Returns:
The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.
    public Integer getInstancePort() {
        return ;
    }
    
    
The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.

Constraints:
Range: 1 - 65535

Parameters:
instancePort The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.
    public void setInstancePort(Integer instancePort) {
        this. = instancePort;
    }
    
    
The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.

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

Constraints:
Range: 1 - 65535

Parameters:
instancePort The port on which the instance server is listening - 25, 80, 443, 465, 587, or 1024-65535.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Listener withInstancePort(Integer instancePort) {
        this. = instancePort;
        return this;
    }

    
The Amazon Resource Name (ARN) of the server certificate.

Returns:
The Amazon Resource Name (ARN) of the server certificate.
    public String getSSLCertificateId() {
        return ;
    }
    
    
The Amazon Resource Name (ARN) of the server certificate.

Parameters:
sSLCertificateId The Amazon Resource Name (ARN) of the server certificate.
    public void setSSLCertificateId(String sSLCertificateId) {
        this. = sSLCertificateId;
    }
    
    
The Amazon Resource Name (ARN) of the server certificate.

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

Parameters:
sSLCertificateId The Amazon Resource Name (ARN) of the server certificate.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Listener withSSLCertificateId(String sSLCertificateId) {
        this. = sSLCertificateId;
        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 (getProtocol() != nullsb.append("Protocol: " + getProtocol() + ",");
        if (getLoadBalancerPort() != nullsb.append("LoadBalancerPort: " + getLoadBalancerPort() + ",");
        if (getInstanceProtocol() != nullsb.append("InstanceProtocol: " + getInstanceProtocol() + ",");
        if (getInstancePort() != nullsb.append("InstancePort: " + getInstancePort() + ",");
        if (getSSLCertificateId() != nullsb.append("SSLCertificateId: " + getSSLCertificateId() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); 
        hashCode = prime * hashCode + ((getLoadBalancerPort() == null) ? 0 : getLoadBalancerPort().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceProtocol() == null) ? 0 : getInstanceProtocol().hashCode()); 
        hashCode = prime * hashCode + ((getInstancePort() == null) ? 0 : getInstancePort().hashCode()); 
        hashCode = prime * hashCode + ((getSSLCertificateId() == null) ? 0 : getSSLCertificateId().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Listener == falsereturn false;
        Listener other = (Listener)obj;
        
        if (other.getProtocol() == null ^ this.getProtocol() == nullreturn false;
        if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == falsereturn false
        if (other.getLoadBalancerPort() == null ^ this.getLoadBalancerPort() == nullreturn false;
        if (other.getLoadBalancerPort() != null && other.getLoadBalancerPort().equals(this.getLoadBalancerPort()) == falsereturn false
        if (other.getInstanceProtocol() == null ^ this.getInstanceProtocol() == nullreturn false;
        if (other.getInstanceProtocol() != null && other.getInstanceProtocol().equals(this.getInstanceProtocol()) == falsereturn false
        if (other.getInstancePort() == null ^ this.getInstancePort() == nullreturn false;
        if (other.getInstancePort() != null && other.getInstancePort().equals(this.getInstancePort()) == falsereturn false
        if (other.getSSLCertificateId() == null ^ this.getSSLCertificateId() == nullreturn false;
        if (other.getSSLCertificateId() != null && other.getSSLCertificateId().equals(this.getSSLCertificateId()) == falsereturn false
        return true;
    }
    
    @Override
    public Listener clone() {
        try {
            return (Listenersuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X