Class AbstractHttpDiscoverySidecar<B extends HttpDiscoverySidecar<B>>

  • All Implemented Interfaces:
    org.refcodes.component.Configurable<HttpDiscoveryContext>, org.refcodes.component.Destroyable, org.refcodes.component.Destroyable.DestroyAutomaton, org.refcodes.component.Initializable, org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.InitializedAccessor, org.refcodes.component.LifeCycleComponent, org.refcodes.component.LifeCycleComponent.LifeCycleAutomaton, org.refcodes.component.LifeCycleStatusAccessor, org.refcodes.component.Pausable, org.refcodes.component.Pausable.PauseAutomaton, org.refcodes.component.Resumable, org.refcodes.component.Resumable.ResumeAutomaton, org.refcodes.component.RunningAccessor, org.refcodes.component.Startable, org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Stoppable, org.refcodes.component.Stoppable.StopAutomaton, org.refcodes.net.LoadBalancingStrategyAccessor, org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>, org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty, HttpDiscovery<B>, HttpDiscoverySidecar<B>, HttpDiscoveryUrlAccessor, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B>, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty, org.refcodes.security.TrustStoreDescriptorAccessor, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty

    public abstract class AbstractHttpDiscoverySidecar<B extends HttpDiscoverySidecar<B>>
    extends java.lang.Object
    implements HttpDiscoverySidecar<B>
    Abstract class for easily decorating a HttpRegistrySidecar.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.component.Configurable

        org.refcodes.component.Configurable.ConfigureAutomaton<CTX extends java.lang.Object>, org.refcodes.component.Configurable.ConfigureBuilder<CTX extends java.lang.Object,B extends org.refcodes.component.Configurable.ConfigureBuilder<CTX,B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable

        org.refcodes.component.Destroyable.DestroyAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.component.Initializable

        org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.Initializable.InitializeBuilder<B extends org.refcodes.component.Initializable.InitializeBuilder<B>>, org.refcodes.component.Initializable.UncheckedInitializable
      • Nested classes/interfaces inherited from interface org.refcodes.component.InitializedAccessor

        org.refcodes.component.InitializedAccessor.InitializedMutator, org.refcodes.component.InitializedAccessor.InitializedProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.LifeCycleComponent

        org.refcodes.component.LifeCycleComponent.LifeCycleAutomaton, org.refcodes.component.LifeCycleComponent.UncheckedLifeCycleComponent
      • Nested classes/interfaces inherited from interface org.refcodes.component.LifeCycleStatusAccessor

        org.refcodes.component.LifeCycleStatusAccessor.LifeCycleStatusBuilder<B extends org.refcodes.component.LifeCycleStatusAccessor.LifeCycleStatusBuilder<B>>, org.refcodes.component.LifeCycleStatusAccessor.LifeCycleStatusMutator, org.refcodes.component.LifeCycleStatusAccessor.LifeCycleStatusProperty
      • Nested classes/interfaces inherited from interface org.refcodes.net.LoadBalancingStrategyAccessor

        org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B extends org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>>, org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.Pausable

        org.refcodes.component.Pausable.PauseAutomaton, org.refcodes.component.Pausable.PauseBuilder<B extends org.refcodes.component.Pausable.PauseBuilder<B>>, org.refcodes.component.Pausable.UncheckedPausable
      • Nested classes/interfaces inherited from interface org.refcodes.component.Resumable

        org.refcodes.component.Resumable.ResumeAutomaton, org.refcodes.component.Resumable.ResumeBuilder<B extends org.refcodes.component.Resumable.ResumeBuilder<B>>, org.refcodes.component.Resumable.UncheckedResumable
      • Nested classes/interfaces inherited from interface org.refcodes.component.RunningAccessor

        org.refcodes.component.RunningAccessor.RunningMutator, org.refcodes.component.RunningAccessor.RunningProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.Startable

        org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Startable.StartBuilder<B extends org.refcodes.component.Startable.StartBuilder<B>>, org.refcodes.component.Startable.UncheckedStartable
      • Nested classes/interfaces inherited from interface org.refcodes.component.Stoppable

        org.refcodes.component.Stoppable.StopAutomaton, org.refcodes.component.Stoppable.StopBuilder<B extends org.refcodes.component.Stoppable.StopBuilder<B>>, org.refcodes.component.Stoppable.UncheckedStoppable
      • Nested classes/interfaces inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor

        org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B extends org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.refcodes.component.LifeCycleAutomatonImpl.ManualLifeCycleAutomatonImpl _lifeCycleAutomaton  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      org.refcodes.net.Url getHttpDiscoveryUrl()
      Retrieves the URL from the URL property locating the service discovery discovery.
      org.refcodes.component.LifeCycleStatus getLifeCycleStatus()
      org.refcodes.net.LoadBalancingStrategy getLoadBalancingStrategy()
      org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()
      void initialize()
      Initially fetches the list of available services and their accordingly associated Url from the discovery service.
      boolean isDestroyable()
      boolean isDestroyed()
      boolean isInitalizable()
      boolean isInitialized()
      boolean isPausable()
      boolean isPaused()
      boolean isResumable()
      boolean isRunning()
      boolean isStartable()
      boolean isStoppable()
      boolean isStopped()
      void pause()
      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.
      void resume()
      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.
      void setHttpDiscoveryUrl​(org.refcodes.net.Url aUrl)
      Sets the URL for the URL property locating the service discovery discovery.
      void setLoadBalancingStrategy​(org.refcodes.net.LoadBalancingStrategy aStrategy)
      void setTrustStoreDescriptor​(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
      void start()
      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.
      void stop()
      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.
      protected static org.refcodes.net.Url toHttpDiscoveryUrl​(org.refcodes.net.Url aDiscoveryUrl, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty aProperty)
      Resolves the property from the provided value and the provided property and the and sets the property in case the provided value is not null.
      protected static org.refcodes.net.LoadBalancingStrategy toLoadBalancingStrategy​(org.refcodes.net.LoadBalancingStrategy aStrategy, org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty aProperty)
      Resolves the property from the provided value and the provided property and the and sets the property in case the provided value is not null.
      protected static org.refcodes.security.TrustStoreDescriptor toTrustStoreDescriptor​(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty aProperty)
      Resolves the property from the provided value and the provided property and the and sets the property in case the provided value is not null.
      • Methods inherited from interface org.refcodes.component.Configurable

        initializeUnchecked
      • Methods inherited from interface org.refcodes.component.Initializable

        initializeUnchecked
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.component.Pausable

        pauseUnchecked
      • Methods inherited from interface org.refcodes.component.Resumable

        resumeUnchecked
      • Methods inherited from interface org.refcodes.component.Startable

        startUnchecked
      • Methods inherited from interface org.refcodes.component.Stoppable

        stopUnchecked
    • Field Detail

      • _lifeCycleAutomaton

        protected org.refcodes.component.LifeCycleAutomatonImpl.ManualLifeCycleAutomatonImpl _lifeCycleAutomaton
    • Constructor Detail

      • AbstractHttpDiscoverySidecar

        public AbstractHttpDiscoverySidecar()
    • Method Detail

      • isRunning

        public boolean isRunning()
        Specified by:
        isRunning in interface org.refcodes.component.RunningAccessor
      • isInitialized

        public boolean isInitialized()
        Specified by:
        isInitialized in interface org.refcodes.component.InitializedAccessor
      • getLifeCycleStatus

        public org.refcodes.component.LifeCycleStatus getLifeCycleStatus()
        Specified by:
        getLifeCycleStatus in interface org.refcodes.component.LifeCycleStatusAccessor
      • pause

        public void pause()
                   throws org.refcodes.component.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 HttpDiscovery<B extends HttpDiscoverySidecar<B>>
        Specified by:
        pause in interface org.refcodes.component.Pausable
        Throws:
        org.refcodes.component.PauseException
      • stop

        public void stop()
                  throws org.refcodes.component.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 HttpDiscovery<B extends HttpDiscoverySidecar<B>>
        Specified by:
        stop in interface org.refcodes.component.Stoppable
        Throws:
        org.refcodes.component.StopException
      • start

        public void start()
                   throws org.refcodes.component.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 HttpDiscovery<B extends HttpDiscoverySidecar<B>>
        Specified by:
        start in interface org.refcodes.component.Startable
        Throws:
        org.refcodes.component.StartException
      • resume

        public void resume()
                    throws org.refcodes.component.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 HttpDiscovery<B extends HttpDiscoverySidecar<B>>
        Specified by:
        resume in interface org.refcodes.component.Resumable
        Throws:
        org.refcodes.component.ResumeException
      • isStoppable

        public boolean isStoppable()
        Specified by:
        isStoppable in interface org.refcodes.component.Stoppable.StopAutomaton
      • isPausable

        public boolean isPausable()
        Specified by:
        isPausable in interface org.refcodes.component.Pausable.PauseAutomaton
      • isStartable

        public boolean isStartable()
        Specified by:
        isStartable in interface org.refcodes.component.Startable.StartAutomaton
      • isResumable

        public boolean isResumable()
        Specified by:
        isResumable in interface org.refcodes.component.Resumable.ResumeAutomaton
      • isStopped

        public boolean isStopped()
        Specified by:
        isStopped in interface org.refcodes.component.Stoppable.StopAutomaton
      • isPaused

        public boolean isPaused()
        Specified by:
        isPaused in interface org.refcodes.component.Pausable.PauseAutomaton
      • isInitalizable

        public boolean isInitalizable()
        Specified by:
        isInitalizable in interface org.refcodes.component.Initializable.InitializeAutomaton
      • destroy

        public 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 org.refcodes.component.Destroyable
        Specified by:
        destroy in interface HttpDiscovery<B extends HttpDiscoverySidecar<B>>
      • isDestroyable

        public boolean isDestroyable()
        Specified by:
        isDestroyable in interface org.refcodes.component.Destroyable.DestroyAutomaton
      • isDestroyed

        public boolean isDestroyed()
        Specified by:
        isDestroyed in interface org.refcodes.component.Destroyable.DestroyAutomaton
      • getLoadBalancingStrategy

        public org.refcodes.net.LoadBalancingStrategy getLoadBalancingStrategy()
        Specified by:
        getLoadBalancingStrategy in interface org.refcodes.net.LoadBalancingStrategyAccessor
      • setHttpDiscoveryUrl

        public void setHttpDiscoveryUrl​(org.refcodes.net.Url aUrl)
        Sets the URL for the URL property locating the service discovery discovery.
        Specified by:
        setHttpDiscoveryUrl in interface HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator
        Parameters:
        aUrl - The service discovery discovery URL to be stored by the URL property.
      • setLoadBalancingStrategy

        public void setLoadBalancingStrategy​(org.refcodes.net.LoadBalancingStrategy aStrategy)
        Specified by:
        setLoadBalancingStrategy in interface org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator
      • getTrustStoreDescriptor

        public org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()
        Specified by:
        getTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor
      • setTrustStoreDescriptor

        public void setTrustStoreDescriptor​(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
        Specified by:
        setTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
      • getHttpDiscoveryUrl

        public org.refcodes.net.Url getHttpDiscoveryUrl()
        Retrieves the URL from the URL property locating the service discovery discovery.
        Specified by:
        getHttpDiscoveryUrl in interface HttpDiscoveryUrlAccessor
        Returns:
        The URL stored by the URL property.
      • toLoadBalancingStrategy

        protected static org.refcodes.net.LoadBalancingStrategy toLoadBalancingStrategy​(org.refcodes.net.LoadBalancingStrategy aStrategy,
                                                                                        org.refcodes.net.LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty aProperty)
        Resolves the property from the provided value and the provided property and the and sets the property in case the provided value is not null.
        Parameters:
        aStrategy - The value to be used when not null.
        aProperty - The property to be used when the value is null and which is to be set when the value is not null.
        Returns:
        The value when not null, else the value of the provided property.
      • toTrustStoreDescriptor

        protected static org.refcodes.security.TrustStoreDescriptor toTrustStoreDescriptor​(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor,
                                                                                           org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty aProperty)
        Resolves the property from the provided value and the provided property and the and sets the property in case the provided value is not null.
        Parameters:
        aStoreDescriptor - The value to be used when not null.
        aProperty - The property to be used when the value is null and which is to be set when the value is not null.
        Returns:
        The value when not null, else the value of the provided property.
      • toHttpDiscoveryUrl

        protected static org.refcodes.net.Url toHttpDiscoveryUrl​(org.refcodes.net.Url aDiscoveryUrl,
                                                                 HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty aProperty)
        Resolves the property from the provided value and the provided property and the and sets the property in case the provided value is not null.
        Parameters:
        aDiscoveryUrl - The value to be used when not null.
        aProperty - The property to be used when the value is null and which is to be set when the value is not null.
        Returns:
        The value when not null, else the value of the provided property.