Class ConsulHelpers

java.lang.Object
org.kiwiproject.registry.consul.server.ConsulHelpers

public final class ConsulHelpers extends Object
Set of utilities that assist in populating a service registration.
  • Method Details

    • newDefaultMetadata

      public static Map<String,String> newDefaultMetadata(ServiceInfo serviceInfo)
      Creates a map with default metadata items that the ConsulRegistryClient will be looking for when it converts a registered service back into a ServiceInstance.

      This map is intended to be a baseline of metadata to register. This map is modifiable, so it can easily be changed or added to later in the registration process.

      Parameters:
      serviceInfo - the information about the service to pull data from.
      Returns:
      a map that is pre-populated with defaults.
    • newDefaultMetadata

      public static Map<String,String> newDefaultMetadata(ServiceInstance serviceInstance)
      Creates a map with default metadata items that the ConsulRegistryClient will be looking for when it converts a registered service back into a ServiceInstance.

      This map is intended to be a baseline of metadata to register. This map is modifiable, so it can easily be changed or added to later in the registration process.

      Parameters:
      serviceInstance - the information about the service to pull data from.
      Returns:
      a map that is pre-populated with defaults.