Class EurekaDiscoverySidecar

java.lang.Object
org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
org.refcodes.rest.ext.eureka.EurekaDiscoverySidecar
All Implemented Interfaces:
org.refcodes.component.Configurable<org.refcodes.rest.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, EurekaDiscovery<EurekaDiscoverySidecar>, org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>, org.refcodes.rest.HttpDiscoverySidecar<EurekaDiscoverySidecar>, org.refcodes.rest.HttpDiscoveryUrlAccessor, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<EurekaDiscoverySidecar>, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty, org.refcodes.security.TrustStoreDescriptorAccessor, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<EurekaDiscoverySidecar>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, org.refcodes.web.LoadBalancingStrategyAccessor, org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<EurekaDiscoverySidecar>, org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty

public class EurekaDiscoverySidecar extends org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar> implements EurekaDiscovery<EurekaDiscoverySidecar>, org.refcodes.rest.HttpDiscoverySidecar<EurekaDiscoverySidecar>
The EurekaDiscoverySidecar decorates a RestfulHttpClient with functionality such registering and unregistering from / to a Eureka discovery service.
  • Nested Class Summary

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

    org.refcodes.component.Configurable.ConfigureAutomaton<CTX extends Object>, org.refcodes.component.Configurable.ConfigureBuilder<CTX extends 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.rest.HttpDiscoveryUrlAccessor

    org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B extends org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B>>, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty

    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.web.LoadBalancingStrategyAccessor

    org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B extends org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>>, org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, org.refcodes.web.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 inherited from class org.refcodes.rest.AbstractHttpDiscoverySidecar

    _lifeCycleAutomaton
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a EurekaDiscoverySidecar with discovery functionality.
    Constructs a EurekaDiscoverySidecar with discovery functionality.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    initialize(org.refcodes.web.Url aDiscoveryUrl, org.refcodes.web.LoadBalancingStrategy aStrategy, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
    void
     
    void
     
    void
     
    void
     
    protected static org.refcodes.web.Url
    toHttpDiscoveryUrl(org.refcodes.web.Url aDiscoveryUrl, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty aProperty)
    Resolves the property from the provided value and the provided property and sets the property in case the provided value is not null.
    org.refcodes.web.Url
    toUrl(org.refcodes.web.Url aUrl)
    protected static org.refcodes.web.Url
    toUrl(org.refcodes.web.Url aUrl, EurekaDiscovery<?> aDiscovery, org.refcodes.rest.ext.eureka.EurekaDiscoverySidecar.RefreshDaemon aRefreshDaemon)
     

    Methods inherited from class org.refcodes.rest.AbstractHttpDiscoverySidecar

    getHttpDiscoveryUrl, getLifecycleStatus, getLoadBalancingStrategy, getTrustStoreDescriptor, initialize, isDestroyable, isDestroyed, isInitalizable, isInitialized, isPausable, isPaused, isResumable, isRunning, isStartable, isStoppable, isStopped, setHttpDiscoveryUrl, setLoadBalancingStrategy, setTrustStoreDescriptor, toLoadBalancingStrategy, toTrustStoreDescriptor

    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.Configurable

    initializeUnchecked

    Methods inherited from interface org.refcodes.component.Destroyable.DestroyAutomaton

    isDestroyable, isDestroyed

    Methods inherited from interface org.refcodes.rest.HttpDiscovery

    initialize, initialize, initialize, initialize, initialize, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, toUrl, withHttpDiscoveryUrl, withLoadBalancingStrategy

    Methods inherited from interface org.refcodes.rest.HttpDiscoverySidecar

    withTrustStoreDescriptor

    Methods inherited from interface org.refcodes.rest.HttpDiscoveryUrlAccessor

    getHttpDiscoveryUrl

    Methods inherited from interface org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator

    setHttpDiscoveryUrl

    Methods inherited from interface org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty

    letHttpDiscoveryUrl

    Methods inherited from interface org.refcodes.component.Initializable

    initializeUnchecked

    Methods inherited from interface org.refcodes.component.Initializable.InitializeAutomaton

    isInitalizable

    Methods inherited from interface org.refcodes.component.InitializedAccessor

    isInitialized

    Methods inherited from interface org.refcodes.component.LifecycleStatusAccessor

    getLifecycleStatus

    Methods inherited from interface org.refcodes.web.LoadBalancingStrategyAccessor

    getLoadBalancingStrategy

    Methods inherited from interface org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator

    setLoadBalancingStrategy

    Methods inherited from interface org.refcodes.web.LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty

    letLoadBalancingStrategy

    Methods inherited from interface org.refcodes.component.Pausable

    pauseUnchecked

    Methods inherited from interface org.refcodes.component.Pausable.PauseAutomaton

    isPausable, isPaused

    Methods inherited from interface org.refcodes.component.Resumable

    resumeUnchecked

    Methods inherited from interface org.refcodes.component.Resumable.ResumeAutomaton

    isResumable

    Methods inherited from interface org.refcodes.component.RunningAccessor

    isRunning

    Methods inherited from interface org.refcodes.component.Startable

    startUnchecked

    Methods inherited from interface org.refcodes.component.Startable.StartAutomaton

    isStartable

    Methods inherited from interface org.refcodes.component.Stoppable

    stopUnchecked

    Methods inherited from interface org.refcodes.component.Stoppable.StopAutomaton

    isStoppable, isStopped

    Methods inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor

    getTrustStoreDescriptor

    Methods inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator

    setTrustStoreDescriptor

    Methods inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty

    letTrustStoreDescriptor
  • Constructor Details

    • EurekaDiscoverySidecar

      public EurekaDiscoverySidecar()
      Constructs a EurekaDiscoverySidecar with discovery functionality.
    • EurekaDiscoverySidecar

      public EurekaDiscoverySidecar(ExecutorService aExecutorService)
      Constructs a EurekaDiscoverySidecar with discovery functionality.
      Parameters:
      aExecutorService - An executor service to be used when creating Threads.
  • Method Details

    • initialize

      public void initialize(org.refcodes.web.Url aDiscoveryUrl, org.refcodes.web.LoadBalancingStrategy aStrategy, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws org.refcodes.component.InitializeException
      Specified by:
      initialize in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
      Throws:
      org.refcodes.component.InitializeException
    • start

      public void start() throws org.refcodes.component.StartException
      Specified by:
      start in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
      Specified by:
      start in interface org.refcodes.component.Startable
      Overrides:
      start in class org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
      Throws:
      org.refcodes.component.StartException
    • pause

      public void pause() throws org.refcodes.component.PauseException
      Specified by:
      pause in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
      Specified by:
      pause in interface org.refcodes.component.Pausable
      Overrides:
      pause in class org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
      Throws:
      org.refcodes.component.PauseException
    • stop

      public void stop() throws org.refcodes.component.StopException
      Specified by:
      stop in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
      Specified by:
      stop in interface org.refcodes.component.Stoppable
      Overrides:
      stop in class org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
      Throws:
      org.refcodes.component.StopException
    • resume

      public void resume() throws org.refcodes.component.ResumeException
      Specified by:
      resume in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
      Specified by:
      resume in interface org.refcodes.component.Resumable
      Overrides:
      resume in class org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
      Throws:
      org.refcodes.component.ResumeException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.refcodes.component.Destroyable
      Specified by:
      destroy in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
      Overrides:
      destroy in class org.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
    • toUrl

      public org.refcodes.web.Url toUrl(org.refcodes.web.Url aUrl)
      Specified by:
      toUrl in interface org.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
    • toUrl

      protected static org.refcodes.web.Url toUrl(org.refcodes.web.Url aUrl, EurekaDiscovery<?> aDiscovery, org.refcodes.rest.ext.eureka.EurekaDiscoverySidecar.RefreshDaemon aRefreshDaemon)
    • toHttpDiscoveryUrl

      protected static org.refcodes.web.Url toHttpDiscoveryUrl(org.refcodes.web.Url aDiscoveryUrl, org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty aProperty)
      Resolves the property from the provided value and the provided property 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.