Module org.refcodes.rest.ext.eureka
Package org.refcodes.rest.ext.eureka
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>
TheEurekaDiscoverySidecar
decorates aHttpRestClient
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
-
-
Constructor Summary
Constructors Constructor Description EurekaDiscoverySidecar()
Constructs aEurekaDiscoverySidecar
with discovery functionality.EurekaDiscoverySidecar(ExecutorService aExecutorService)
Constructs aEurekaDiscoverySidecar
with discovery functionality.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
void
initialize(org.refcodes.web.Url aDiscoveryUrl, org.refcodes.web.LoadBalancingStrategy aStrategy, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
void
pause()
void
resume()
void
start()
void
stop()
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.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.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator
setHttpDiscoveryUrl
-
Methods inherited from interface org.refcodes.rest.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty
letHttpDiscoveryUrl
-
Methods inherited from interface org.refcodes.component.Initializable.InitializeAutomaton
isInitalizable
-
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.PauseAutomaton
isPausable, isPaused
-
Methods inherited from interface org.refcodes.component.Stoppable.StopAutomaton
isStoppable, isStopped
-
Methods inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor
getTrustStoreDescriptor
-
-
-
-
Constructor Detail
-
EurekaDiscoverySidecar
public EurekaDiscoverySidecar()
Constructs aEurekaDiscoverySidecar
with discovery functionality.
-
EurekaDiscoverySidecar
public EurekaDiscoverySidecar(ExecutorService aExecutorService)
Constructs aEurekaDiscoverySidecar
with discovery functionality.- Parameters:
aExecutorService
- An executor service to be used when creatingThread
s.
-
-
Method Detail
-
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 interfaceorg.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
- Throws:
org.refcodes.component.InitializeException
-
start
public void start() throws org.refcodes.component.StartException
- Specified by:
start
in interfaceorg.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
- Specified by:
start
in interfaceorg.refcodes.component.Startable
- Overrides:
start
in classorg.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
- Throws:
org.refcodes.component.StartException
-
pause
public void pause() throws org.refcodes.component.PauseException
- Specified by:
pause
in interfaceorg.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
- Specified by:
pause
in interfaceorg.refcodes.component.Pausable
- Overrides:
pause
in classorg.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
- Throws:
org.refcodes.component.PauseException
-
stop
public void stop() throws org.refcodes.component.StopException
- Specified by:
stop
in interfaceorg.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
- Specified by:
stop
in interfaceorg.refcodes.component.Stoppable
- Overrides:
stop
in classorg.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
- Throws:
org.refcodes.component.StopException
-
resume
public void resume() throws org.refcodes.component.ResumeException
- Specified by:
resume
in interfaceorg.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
- Specified by:
resume
in interfaceorg.refcodes.component.Resumable
- Overrides:
resume
in classorg.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
- Throws:
org.refcodes.component.ResumeException
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.refcodes.component.Destroyable
- Specified by:
destroy
in interfaceorg.refcodes.rest.HttpDiscovery<EurekaDiscoverySidecar>
- Overrides:
destroy
in classorg.refcodes.rest.AbstractHttpDiscoverySidecar<EurekaDiscoverySidecar>
-
toUrl
public org.refcodes.web.Url toUrl(org.refcodes.web.Url aUrl)
- Specified by:
toUrl
in interfaceorg.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.
-
-