Class ServiceInstanceRegistration

java.lang.Object
org.springframework.cloud.zookeeper.serviceregistry.ServiceInstanceRegistration
All Implemented Interfaces:
org.springframework.cloud.client.ServiceInstance, org.springframework.cloud.client.serviceregistry.Registration, ZookeeperRegistration

public class ServiceInstanceRegistration extends Object implements ZookeeperRegistration
Registration that lazily builds a ServiceInstance so the port can by dynamically set (for instance, when the user wants a dynamic port for spring boot.
Author:
Spencer Gibb
  • Field Details

    • serviceInstance

      protected org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance> serviceInstance
    • builder

      protected org.apache.curator.x.discovery.ServiceInstanceBuilder<ZookeeperInstance> builder
  • Constructor Details

    • ServiceInstanceRegistration

      public ServiceInstanceRegistration(org.apache.curator.x.discovery.ServiceInstanceBuilder<ZookeeperInstance> builder)
  • Method Details

    • builder

    • builder

      public static ServiceInstanceRegistration.RegistrationBuilder builder(org.apache.curator.x.discovery.ServiceInstanceBuilder<ZookeeperInstance> builder)
    • getServiceInstance

      public org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance> getServiceInstance()
      Specified by:
      getServiceInstance in interface ZookeeperRegistration
    • build

      protected void build()
    • getServiceId

      public String getServiceId()
      Specified by:
      getServiceId in interface org.springframework.cloud.client.ServiceInstance
    • getPort

      public int getPort()
      Specified by:
      getPort in interface org.springframework.cloud.client.ServiceInstance
    • setPort

      public void setPort(int port)
      Specified by:
      setPort in interface ZookeeperRegistration
    • getHost

      public String getHost()
      Specified by:
      getHost in interface org.springframework.cloud.client.ServiceInstance
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface org.springframework.cloud.client.ServiceInstance
    • getUri

      public URI getUri()
      Specified by:
      getUri in interface org.springframework.cloud.client.ServiceInstance
    • getMetadata

      public Map<String,String> getMetadata()
      Specified by:
      getMetadata in interface org.springframework.cloud.client.ServiceInstance