Interface HttpDiscovery<B extends HttpDiscovery<B>>

Type Parameters:
B - In order to implement the builder pattern with a coherent type hierarchy.
All Superinterfaces:
Configurable<HttpDiscoveryContext>, Destroyable, Destroyable.DestroyAutomaton, HttpDiscoveryUrlAccessor, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B>, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty, Initializable, Initializable.InitializeAutomaton, InitializedAccessor, LifecycleComponent, LifecycleComponent.LifecycleAutomaton, LifecycleStatusAccessor, LoadBalancingStrategyAccessor, LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>, LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty, Pausable, Pausable.PauseAutomaton, Resumable, Resumable.ResumeAutomaton, RunningAccessor, Startable, Startable.StartAutomaton, Stoppable, Stoppable.StopAutomaton
All Known Subinterfaces:
HttpDiscoverySidecar<B>, HttpRestDiscoveryClient<B>
All Known Implementing Classes:
AbstractHttpDiscoverySidecar, AbstractHttpRestDiscoveryClientDecorator

The HttpDiscovery describes the functionality required in order to discover a service at a service discovery and discovery service. This type is intended to be used by different separate hierarchy branches by providing the generic type <B>, ensuring a coherent type hierarchy for each branch.
  • Method Details

    • withLoadBalancingStrategy

      default B withLoadBalancingStrategy(LoadBalancingStrategy aStrategy)
      Specified by:
      withLoadBalancingStrategy in interface LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B extends HttpDiscovery<B>>
    • withHttpDiscoveryUrl

      default B withHttpDiscoveryUrl(Url aUrl)
      Sets the URL for the URL property locating the service discovery discovery.
      Specified by:
      withHttpDiscoveryUrl in interface HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B extends HttpDiscovery<B>>
      Parameters:
      aUrl - The service discovery discovery URL to be stored by the URL property.
      Returns:
      The builder for applying multiple build operations.
    • toUrl

      Url toUrl(Url aUrl)
      Resolves the server's alias from the provided Url by an actual host and returns the accordingly resolved Url.
      Parameters:
      aUrl - The Url for the request.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aUrl) throws MalformedURLException
      Resolves the server's alias from the provided String by an actual host and returns the accordingly resolved Url.
      Parameters:
      aUrl - The URL String to be parsed. The URL consists of the scheme (protocol), the identify and the secret (optional), the host as well as an optional port and the (optional) path.
      Returns:
      The tinkered Url.
      Throws:
      MalformedURLException - in case the provided URL is considered being malformed.
    • toUrl

      default Url toUrl(String aUrl, FormFields aQueryFields) throws MalformedURLException
      Resolves the server's alias from the provided String by an actual host and returns the accordingly resolved Url.
      Parameters:
      aUrl - The URL String to be parsed. The URL consists of the scheme (protocol), the identify and the secret (optional), the host as well as an optional port and the (optional) path.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      Returns:
      The tinkered Url.
      Throws:
      MalformedURLException - in case the provided URL is considered being malformed.
    • toUrl

      default Url toUrl(String aUrl, FormFields aQueryFields, String aFragment) throws MalformedURLException
      Resolves the server's alias from the provided String by an actual host and returns the accordingly resolved Url.
      Parameters:
      aUrl - The URL String to be parsed. The URL consists of the scheme (protocol), the identify and the secret (optional), the host as well as an optional port and the (optional) path.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      aFragment - The fragment to be set.
      Returns:
      The tinkered Url.
      Throws:
      MalformedURLException - in case the provided URL is considered being malformed.
    • toUrl

      default Url toUrl(URL aURL)
      Constructs an Url from the provided URL instance.
      Parameters:
      aURL - The URL to be used.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, int aPort)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, int aPort, String aPath)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      aPath - The path on the host to which the base destination URL is to point to.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      aFragment - The fragment to be set.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, int aPort)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, int aPort, String aPath)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      aPath - The path on the host to which the base destination URL is to point to.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPort - The port to be used when connecting to the host.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      aFragment - The fragment to be set.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, String aPath)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPath - The path on the host to which the base destination URL is to point to.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, String aPath, FormFields aQueryFields)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Scheme aScheme, String aHost, String aPath, FormFields aQueryFields, String aFragment)
      Constructs an Url with the common attributes.
      Parameters:
      aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      aFragment - The fragment to be set.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, String aPath)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPath - The path on the host to which the base destination URL is to point to.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, String aPath, FormFields aQueryFields)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(String aProtocol, String aHost, String aPath, FormFields aQueryFields, String aFragment)
      Constructs an Url with the common attributes.
      Parameters:
      aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
      aHost - The host to which the destination URL is to point to.
      aPath - The path on the host to which the base destination URL is to point to.
      aQueryFields - The Query-Fields to be used for the HTTP Query-String.
      aFragment - The fragment to be set.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Url aUrl, Url aOtherUrl)
      Constructs a new Url from the given Url instances by adding the other Url's data to the first Url's data. E.g. a path from the other Url is append to the first Url's path, the query parameters are added or overwritten accordingly and so on.
      Parameters:
      aUrl - The Url which is to be enriched.
      aOtherUrl - The Url enriching the given Url by an actual host and returns the accordingly resolved Url.
      Returns:
      The tinkered Url.
    • toUrl

      default Url toUrl(Url aUrl, String... aPaths)
      Some Url algebra: Adds the provided path to the given Url by prepending it to the Url's path.
      Parameters:
      aUrl - The Url to which to add the path.
      aPaths - The paths to be added to the given Url by an actual host and returns the accordingly resolved Url.
      Returns:
      The tinkered Url.
    • initialize

      default void initialize() throws InitializeException

      Initially fetches the list of available services and their accordingly associated Url from the discovery service. Sets up the client according to the current client's state when invoking initialize(Url, LoadBalancingStrategy, TrustStoreDescriptor).

      Specified by:
      initialize in interface Initializable
      Throws:
      InitializeException
    • initialize

      default void initialize(Url aDiscoveryUrl) throws InitializeException
      Initially fetches the list of available services and their accordingly associated Url from the discovery service. Sets up the client according to the current client's state and the provided parameters when invoking initialize(Url, LoadBalancingStrategy, TrustStoreDescriptor).
      Parameters:
      aDiscoveryUrl - The Url pointing to the discovery service.
      Throws:
      InitializeException - Thrown in case initializing fails.
    • initialize

      default void initialize(HttpDiscoveryContext aDiscoveryContext) throws InitializeException

      Initially fetches the list of available services and their accordingly associated Url from the discovery service. Sets up the client according to the provided context when invoking initialize(Url, LoadBalancingStrategy, TrustStoreDescriptor).

      Specified by:
      initialize in interface Configurable<B extends HttpDiscovery<B>>
      Parameters:
      aDiscoveryContext - The HttpDiscoveryContext describing the information for connecting to the discovery service.
      Throws:
      InitializeException
    • initialize

      default void initialize(Url aDiscoveryUrl, TrustStoreDescriptor aStoreDescriptor) throws InitializeException
      Initially fetches the list of available services and their accordingly associated Url from the discovery service. Sets up the client according to the current client's state and the provided parameters when invoking initialize(Url, LoadBalancingStrategy, TrustStoreDescriptor).
      Parameters:
      aDiscoveryUrl - The Url pointing to the discovery service
      aStoreDescriptor - The descriptor describing the truststore to be used by this client.
      Throws:
      InitializeException - the initialize exception
    • initialize

      default void initialize(Url aDiscoveryUrl, LoadBalancingStrategy aStrategy) throws InitializeException
      Initially fetches the list of available services and their accordingly associated Url from the discovery service. Sets up the client according to the current client's state and the provided parameters.
      Parameters:
      aDiscoveryUrl - The Url pointing to the discovery service
      aStrategy - The load balancing strategy to use when resolving targeted Url of issued requests.
      Throws:
      InitializeException - the initialize exception
    • initialize

      void initialize(Url aDiscoveryUrl, LoadBalancingStrategy aStrategy, TrustStoreDescriptor aStoreDescriptor) throws InitializeException
      Initially fetches the list of available services and their accordingly associated Url from the discovery service. Sets up the client according to the current client's state and the provided parameters.
      Parameters:
      aDiscoveryUrl - The Url pointing to the discovery service
      aStrategy - The load balancing strategy to use when resolving targeted Url of issued requests.
      aStoreDescriptor - The descriptor describing the truststore to be used by this client.
      Throws:
      InitializeException - the initialize exception
    • start

      void start() throws StartException

      Starts resolving of the host part of an Url from the list of available services and their accordingly associated Url as of the discovery service. Takes care to update the list of available services and their accordingly associated Url from the discovery service. This may be achieved by starting a scheduler. If necessary, the connection is opened.

      Specified by:
      start in interface Startable
      Throws:
      StartException
    • pause

      void pause() throws PauseException

      Pauses the resolving of the host part of an Url from the list of available services and their accordingly associated Url as of the discovery service.

      Specified by:
      pause in interface Pausable
      Throws:
      PauseException
    • resume

      void resume() throws ResumeException

      Resumes the resolving of the host part of an Url from the list of available services and their accordingly associated Url as of the discovery service.

      Specified by:
      resume in interface Resumable
      Throws:
      ResumeException
    • stop

      void stop() throws StopException

      Stops resolving of the host part of an Url from the list of available services and their accordingly associated Url as of the discovery service. Does not update the list of available services and their accordingly associated Url from the discovery service. This may be achieved by canceling a scheduler.

      Specified by:
      stop in interface Stoppable
      Throws:
      StopException
    • destroy

      void destroy()

      Stops resolving of the host part of an Url from the list of available services and their accordingly associated Url as of the discovery service. Does not update the list of available services and their accordingly associated Url from the discovery service. This may be achieved by canceling a scheduler. Finally the connection is closed.

      Specified by:
      destroy in interface Destroyable