Class ServiceDiscoveryOptions

java.lang.Object
io.vertx.servicediscovery.ServiceDiscoveryOptions

public class ServiceDiscoveryOptions extends Object
Options to configure the service discovery.
Author:
Clement Escoffier
  • Field Details

  • Constructor Details

    • ServiceDiscoveryOptions

      public ServiceDiscoveryOptions()
      Creates a new instance of ServiceDiscoveryOptions using the default values.
    • ServiceDiscoveryOptions

      public ServiceDiscoveryOptions(ServiceDiscoveryOptions other)
      Creates a new instance of ServiceDiscoveryOptions by copying the values from another instance.
      Parameters:
      other - the instance to copy
    • ServiceDiscoveryOptions

      public ServiceDiscoveryOptions(JsonObject json)
      Creates a new instance of ServiceDiscoveryOptions from its JSON representation.
      Parameters:
      json - the json object
  • Method Details

    • toJson

      public JsonObject toJson()
      Builds the JSON representation for the current ServiceDiscoveryOptions.
      Returns:
      the json representation
    • getAnnounceAddress

      public String getAnnounceAddress()
      Returns:
      the event bus address on which the service arrivals, departures and modifications are announced. This address must be consistent in the whole application.
    • setAnnounceAddress

      public ServiceDiscoveryOptions setAnnounceAddress(String announceAddress)
      Sets the event bus address on which the service arrivals, departures and modifications are announced. This address must be consistent in the whole application.
      Parameters:
      announceAddress - the address, must not be null
      Returns:
      the current ServiceDiscoveryOptions
    • getBackendConfiguration

      public JsonObject getBackendConfiguration()
      Returns:
      the backend configuration. Cannot be null.
    • setBackendConfiguration

      public ServiceDiscoveryOptions setBackendConfiguration(JsonObject backendConfiguration)
      Sets the configuration passed to the ServiceDiscoveryBackend. Refer to the backend documentation to get more details on the requirements. The default backend does not need any configuration.
      Parameters:
      backendConfiguration - the backend configuration
      Returns:
      the current ServiceDiscoveryOptions
    • setName

      public ServiceDiscoveryOptions setName(String name)
      Sets the service discovery name used in the service usage events. If not set, the node id is used.
      Parameters:
      name - the name to use.
      Returns:
      the current ServiceDiscoveryOptions
    • getName

      public String getName()
      Gets the service discovery name used in service usage events. If not set the node id is used.
      Returns:
      the name
    • getUsageAddress

      public String getUsageAddress()
      Returns:
      the event bus address on which are sent the service usage events (bind / release).
    • setUsageAddress

      public ServiceDiscoveryOptions setUsageAddress(String usageAddress)
      Sets the usage address: the event bus address on which are sent the service usage events (bind / release).
      Parameters:
      usageAddress - the address,
      invalid @link
      {@link null
      } to disable use service usage tracking
      Returns:
      the current ServiceDiscoveryOptions