Class DiscoveryClientConfiguration

java.lang.Object
io.micronaut.http.client.HttpClientConfiguration
io.micronaut.discovery.client.DiscoveryClientConfiguration
Direct Known Subclasses:
ConsulConfiguration, EurekaConfiguration

public abstract class DiscoveryClientConfiguration extends io.micronaut.http.client.HttpClientConfiguration
Abstract class for all DiscoveryClient configurations.
Since:
1.0
Author:
graemerocher
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.micronaut.http.client.HttpClientConfiguration

    io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration, io.micronaut.http.client.HttpClientConfiguration.DnsResolutionMode, io.micronaut.http.client.HttpClientConfiguration.Http2ClientConfiguration, io.micronaut.http.client.HttpClientConfiguration.WebSocketCompressionConfiguration
  • Field Summary

    Fields inherited from class io.micronaut.http.client.HttpClientConfiguration

    DEFAULT_ALLOW_BLOCK_EVENT_LOOP, DEFAULT_CONNECTION_POOL_IDLE_TIMEOUT_SECONDS, DEFAULT_DNS_RESOLUTION_MODE, DEFAULT_EXCEPTION_ON_ERROR_STATUS, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_READ_IDLE_TIMEOUT_MINUTES, DEFAULT_READ_TIMEOUT_SECONDS, DEFAULT_SHUTDOWN_QUIET_PERIOD_MILLISECONDS, DEFAULT_SHUTDOWN_TIMEOUT_MILLISECONDS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    DiscoveryClientConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<io.micronaut.discovery.ServiceInstance>
     
     
    List<io.micronaut.discovery.ServiceInstance>
     
    abstract @NonNull io.micronaut.discovery.DiscoveryConfiguration
     
    @NonNull String
     
    int
     
    abstract @Nullable io.micronaut.discovery.registration.RegistrationConfiguration
     
     
    protected abstract String
     
    boolean
     
    boolean
    Whether DNS should be used to resolve the discovery servers.
    void
    setContextPath(String contextPath)
    Sets the context path.
    void
    setDefaultZone(List<URL> defaultZone)
    Sets the Discovery servers to use for the default zone.
    void
     
    void
    setPort(int port)
     
    void
    setSecure(boolean secure)
     
    void
    setShouldUseDns(boolean shouldUseDns)
    Whether DNS should be used to resolve the discovery servers.
    void
    Configures Discovery servers in other zones.
     

    Methods inherited from class io.micronaut.http.client.HttpClientConfiguration

    getAddressResolverGroupName, getAlpnModes, getChannelOptions, getConnectionPoolConfiguration, getConnectionPoolIdleTimeout, getConnectTimeout, getConnectTtl, getDefaultCharset, getDnsResolutionMode, getEventLoopGroup, getHttp2Configuration, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getPlaintextMode, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getRequestTimeout, getShutdownQuietPeriod, getShutdownTimeout, getSslConfiguration, getThreadFactory, getWebSocketCompressionConfiguration, isAllowBlockEventLoop, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setAddressResolverGroupName, setAllowBlockEventLoop, setAlpnModes, setChannelOptions, setConnectionPoolIdleTimeout, setConnectTimeout, setConnectTtl, setDefaultCharset, setDnsResolutionMode, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setPlaintextMode, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setRequestTimeout, setShutdownQuietPeriod, setShutdownTimeout, setSslConfiguration, setThreadFactory

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DiscoveryClientConfiguration

      public DiscoveryClientConfiguration()
      Default constructor.
    • DiscoveryClientConfiguration

      public DiscoveryClientConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
      Parameters:
      applicationConfiguration - The application configuration.
  • Method Details

    • isShouldUseDns

      public boolean isShouldUseDns()
      Whether DNS should be used to resolve the discovery servers.
      Returns:
      True if DNS should be used.
    • setShouldUseDns

      public void setShouldUseDns(boolean shouldUseDns)
      Whether DNS should be used to resolve the discovery servers.
      Parameters:
      shouldUseDns - True if DNS should be used.
    • getContextPath

      public Optional<String> getContextPath()
      Returns:
      The context path to use
    • setContextPath

      public void setContextPath(String contextPath)
      Sets the context path.
      Parameters:
      contextPath - The context path
    • getServiceId

      public Optional<String> getServiceId()
      Returns:
      Resolves the service ID to use
    • getDefaultZone

      public List<io.micronaut.discovery.ServiceInstance> getDefaultZone()
      Returns:
      The Discovery servers within the default zone
    • setDefaultZone

      public void setDefaultZone(List<URL> defaultZone)
      Sets the Discovery servers to use for the default zone.
      Parameters:
      defaultZone - The default zone
    • getAllZones

      public List<io.micronaut.discovery.ServiceInstance> getAllZones()
      Returns:
      The Discovery servers within all zones
    • setZones

      public void setZones(Map<String,List<URL>> zones)
      Configures Discovery servers in other zones.
      Parameters:
      zones - The zones
    • isSecure

      public boolean isSecure()
      Returns:
      Is the discovery server exposed over HTTPS (defaults to false)
    • setSecure

      public void setSecure(boolean secure)
      Parameters:
      secure - Set if the discovery server is exposed over HTTPS
    • getHost

      @NonNull public @NonNull String getHost()
      Returns:
      The Discovery server instance host name. Defaults to 'localhost'.
    • setHost

      public void setHost(String host)
      Parameters:
      host - The Discovery server host name
    • getPort

      public int getPort()
      Returns:
      The default Discovery server port
    • setPort

      public void setPort(int port)
      Parameters:
      port - The port for the Discovery server
    • getDiscovery

      @NonNull public abstract @NonNull io.micronaut.discovery.DiscoveryConfiguration getDiscovery()
      Returns:
      The default discovery configuration
    • getRegistration

      @Nullable public abstract @Nullable io.micronaut.discovery.registration.RegistrationConfiguration getRegistration()
      Returns:
      The default registration configuration
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getServiceID

      protected abstract String getServiceID()
      Returns:
      The ID of the DiscoveryClient