Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to jclouds, Inc. (jclouds) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. jclouds licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License 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 org.jclouds.elb.domain;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 
Listener is a process that listens for client connection requests. It is configured with a protocol and a port number for front-end (Load Balancer) and back-end (Back-end instance) connections. By default, your load balancer is set to use the HTTP protocol with port 80 for the front-end connection and the back-end connection. The default settings can be changed using the AWS Management Console, the Query API, the command line interface (CLI), or the SDKs.

Author(s):
Adrian Cole
See also:
doc
 
 public class Listener {
 
    public static Builder<?> builder() {
       return new ConcreteBuilder();
    }
 
    public Builder<?> toBuilder() {
       return new ConcreteBuilder().fromListener(this);
    }
 
    public static abstract class Builder<T extends Builder<T>> {
       protected abstract T self();
 
       protected int instancePort = -1;
       protected Protocol instanceProtocol;
       protected int port = -1;
       protected Protocol protocol;
       protected Optional<StringSSLCertificateId = Optional.absent();

      
 
       public T instancePort(int instancePort) {
          this. = instancePort;
          return self();
       }

      
 
       public T instanceProtocol(Protocol instanceProtocol) {
          this. = instanceProtocol;
          return self();
       }

      
 
       public T port(int port) {
          this. = port;
          return self();
       }

      
 
       public T protocol(Protocol protocol) {
          this. = protocol;
          if ( == null)
              = protocol;
          return self();
       }

      
 
      public T SSLCertificateId(String SSLCertificateId) {
         this. = Optional.fromNullable(SSLCertificateId);
         return self();
      }
      public Listener build() {
         return new Listener();
      }
      public T fromListener(Listener in) {
         return this.instancePort(in.getInstancePort()).instanceProtocol(in.getInstanceProtocol()).port(in.getPort())
                  .protocol(in.getProtocol()).SSLCertificateId(in.getSSLCertificateId().orNull());
      }
   }
   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
      @Override
      protected ConcreteBuilder self() {
         return this;
      }
   }
   protected final int instancePort;
   protected final Protocol instanceProtocol;
   protected final int port;
   protected final Protocol protocol;
   protected final Optional<StringSSLCertificateId;
   protected Listener(int instancePortProtocol instanceProtocolint portProtocol protocol,
            Optional<StringSSLCertificateId) {
      this. = checkNonNegative(instancePort"instancePort");
      this. = checkNotNull(instanceProtocol"instanceProtocol");
      this. = checkNonNegative(port"port");
      this. = checkNotNull(protocol"protocol");
      this. = checkNotNull(SSLCertificateId"SSLCertificateId");
   }
   static int checkNonNegative(int inString name) {
      checkArgument(in > 0, "%s must be non-negative"name);
      return in;
   }
   
   
The name associated with the LoadBalancer. The name must be unique within your set of LoadBalancers.
   public int getInstancePort() {
      return ;
   }

   
pecifies the protocol to use for routing traffic to back-end instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified for the life of the LoadBalancer.
   public Protocol getInstanceProtocol() {
      return ;
   }

   
Specifies the external LoadBalancer port number. This property cannot be modified for the life of the LoadBalancer.
   public int getPort() {
      return ;
   }

   
Specifies the LoadBalancer transport protocol to use for routing - HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life of the LoadBalancer.
   public Protocol getProtocol() {
      return ;
   }

   
The ARN string of the server certificate. To get the ARN of the server certificate, call the AWS Identity and Access Management UploadServerCertificate API.
      return ;
   }

   
   public int hashCode() {
   }

   
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      Listener other = (Listenerobj;
      return Objects.equal(this.other.instancePort)
               && Objects.equal(this.other.instanceProtocol) && Objects.equal(this.other.port)
               && Objects.equal(this.other.protocol)
               && Objects.equal(this.other.SSLCertificateId);
   }

   
   public String toString() {
      return string().toString();
   }
   protected ToStringHelper string() {
      return Objects.toStringHelper(this).omitNullValues().add("instancePort").add("instanceProtocol",
               ).add("port").add("protocol").add("SSLCertificateId",
               .orNull());
   }
New to GrepCode? Check out our FAQ X