Class AbstractHttpDiscoverySidecar<B extends HttpDiscoverySidecar<B>>
- Type Parameters:
B- the generic type
- All Implemented Interfaces:
Configurable<HttpDiscoveryContext>, Destroyable, Destroyable.DestroyAutomaton, Initializable, Initializable.InitializeAutomaton, InitializedAccessor, LifecycleComponent, LifecycleComponent.LifecycleAutomaton, LifecycleStatusAccessor, Pausable, Pausable.PauseAutomaton, Resumable, Resumable.ResumeAutomaton, RunningAccessor, Startable, Startable.StartAutomaton, Stoppable, Stoppable.StopAutomaton, HttpDiscovery<B>, HttpDiscoverySidecar<B>, HttpDiscoveryUrlAccessor, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B>, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty, TrustStoreDescriptorAccessor, TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>, TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, LoadBalancingStrategyAccessor, LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>, LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty
HttpRegistrySidecar.-
Nested Class Summary
Nested classes/interfaces inherited from interface Configurable
Configurable.ConfigureAutomaton<CTX>, Configurable.ConfigureBuilder<CTX,B> Nested classes/interfaces inherited from interface Destroyable
Destroyable.DestroyAutomatonNested classes/interfaces inherited from interface HttpDiscoveryUrlAccessor
HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B>, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator, HttpDiscoveryUrlAccessor.HttpDiscoveryUrlPropertyNested classes/interfaces inherited from interface Initializable
Initializable.InitializeAutomaton, Initializable.InitializeBuilder<B>, Initializable.UncheckedInitializableNested classes/interfaces inherited from interface InitializedAccessor
InitializedAccessor.InitializedMutator, InitializedAccessor.InitializedPropertyNested classes/interfaces inherited from interface LifecycleComponent
LifecycleComponent.LifecycleAutomaton, LifecycleComponent.UncheckedLifecycleComponentNested classes/interfaces inherited from interface LifecycleStatusAccessor
LifecycleStatusAccessor.LifecycleStatusBuilder<B>, LifecycleStatusAccessor.LifecycleStatusMutator, LifecycleStatusAccessor.LifecycleStatusPropertyNested classes/interfaces inherited from interface LoadBalancingStrategyAccessor
LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>, LoadBalancingStrategyAccessor.LoadBalancingStrategyMutator, LoadBalancingStrategyAccessor.LoadBalancingStrategyPropertyNested classes/interfaces inherited from interface Pausable
Pausable.PauseAutomaton, Pausable.PauseBuilder<B>, Pausable.UncheckedPausableNested classes/interfaces inherited from interface Resumable
Resumable.ResumeAutomaton, Resumable.ResumeBuilder<B>, Resumable.UncheckedResumableNested classes/interfaces inherited from interface RunningAccessor
RunningAccessor.RunningMutator, RunningAccessor.RunningPropertyNested classes/interfaces inherited from interface Startable
Startable.StartAutomaton, Startable.StartBuilder<B>, Startable.UncheckedStartableNested classes/interfaces inherited from interface Stoppable
Stoppable.StopAutomaton, Stoppable.StopBuilder<B>, Stoppable.UncheckedStoppableNested classes/interfaces inherited from interface TrustStoreDescriptorAccessor
TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>, TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Retrieves the URL from the URL property locating the service discovery discovery.voidInitially fetches the list of available services and their accordingly associatedUrlfrom the discovery service.booleanbooleanbooleanbooleanbooleanbooleanisPaused()booleanbooleanbooleanbooleanbooleanvoidpause()voidresume()voidsetHttpDiscoveryUrl(Url aUrl) Sets the URL for the URL property locating the service discovery discovery.voidsetLoadBalancingStrategy(LoadBalancingStrategy aStrategy) voidsetTrustStoreDescriptor(TrustStoreDescriptor aTrustStoreDescriptor) voidstart()voidstop()protected static UrltoHttpDiscoveryUrl(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 LoadBalancingStrategytoLoadBalancingStrategy(LoadBalancingStrategy aStrategy, 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 TrustStoreDescriptortoTrustStoreDescriptor(TrustStoreDescriptor aStoreDescriptor, 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 class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Configurable
initializeUncheckedMethods inherited from interface 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, toUrl, withHttpDiscoveryUrl, withLoadBalancingStrategyMethods inherited from interface HttpDiscoverySidecar
withTrustStoreDescriptorMethods inherited from interface HttpDiscoveryUrlAccessor.HttpDiscoveryUrlProperty
letHttpDiscoveryUrlMethods inherited from interface Initializable
initializeUncheckedMethods inherited from interface LoadBalancingStrategyAccessor.LoadBalancingStrategyProperty
letLoadBalancingStrategyMethods inherited from interface Pausable
pauseUncheckedMethods inherited from interface Resumable
resumeUncheckedMethods inherited from interface Startable
startUncheckedMethods inherited from interface Stoppable
stopUncheckedMethods inherited from interface TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
letTrustStoreDescriptor
-
Field Details
-
_lifeCycleAutomaton
-
-
Constructor Details
-
AbstractHttpDiscoverySidecar
public AbstractHttpDiscoverySidecar()
-
-
Method Details
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceRunningAccessor
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInitializedAccessor
-
getLifecycleStatus
- Specified by:
getLifecycleStatusin interfaceLifecycleStatusAccessor
-
pause
Pauses the resolving of the host part of an
Urlfrom the list of available services and their accordingly associatedUrlas of the discovery service.- Specified by:
pausein interfaceHttpDiscovery<B extends HttpDiscoverySidecar<B>>- Specified by:
pausein interfacePausable- Throws:
PauseException
-
stop
Stops resolving of the host part of an
Urlfrom the list of available services and their accordingly associatedUrlas of the discovery service. Does not update the list of available services and their accordingly associatedUrlfrom the discovery service. This may be achieved by canceling a scheduler.- Specified by:
stopin interfaceHttpDiscovery<B extends HttpDiscoverySidecar<B>>- Specified by:
stopin interfaceStoppable- Throws:
StopException
-
start
Starts resolving of the host part of an
Urlfrom the list of available services and their accordingly associatedUrlas of the discovery service. Takes care to update the list of available services and their accordingly associatedUrlfrom the discovery service. This may be achieved by starting a scheduler. If necessary, the connection is opened.- Specified by:
startin interfaceHttpDiscovery<B extends HttpDiscoverySidecar<B>>- Specified by:
startin interfaceStartable- Throws:
StartException
-
resume
Resumes the resolving of the host part of an
Urlfrom the list of available services and their accordingly associatedUrlas of the discovery service.- Specified by:
resumein interfaceHttpDiscovery<B extends HttpDiscoverySidecar<B>>- Specified by:
resumein interfaceResumable- Throws:
ResumeException
-
initialize
Initially fetches the list of available services and their accordingly associated
Urlfrom the discovery service. Sets up the client according to the current client's state when invokingHttpDiscovery.initialize(Url, LoadBalancingStrategy, TrustStoreDescriptor).- Specified by:
initializein interfaceHttpDiscovery<B extends HttpDiscoverySidecar<B>>- Specified by:
initializein interfaceInitializable- Throws:
InitializeException
-
isStoppable
public boolean isStoppable()- Specified by:
isStoppablein interfaceStoppable.StopAutomaton
-
isPausable
public boolean isPausable()- Specified by:
isPausablein interfacePausable.PauseAutomaton
-
isStartable
public boolean isStartable()- Specified by:
isStartablein interfaceStartable.StartAutomaton
-
isResumable
public boolean isResumable()- Specified by:
isResumablein interfaceResumable.ResumeAutomaton
-
isStopped
public boolean isStopped()- Specified by:
isStoppedin interfaceStoppable.StopAutomaton
-
isPaused
public boolean isPaused()- Specified by:
isPausedin interfacePausable.PauseAutomaton
-
isInitalizable
public boolean isInitalizable()- Specified by:
isInitalizablein interfaceInitializable.InitializeAutomaton
-
destroy
public void destroy()Stops resolving of the host part of an
Urlfrom the list of available services and their accordingly associatedUrlas of the discovery service. Does not update the list of available services and their accordingly associatedUrlfrom the discovery service. This may be achieved by canceling a scheduler. Finally the connection is closed.- Specified by:
destroyin interfaceDestroyable- Specified by:
destroyin interfaceHttpDiscovery<B extends HttpDiscoverySidecar<B>>
-
isDestroyable
public boolean isDestroyable()- Specified by:
isDestroyablein interfaceDestroyable.DestroyAutomaton
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable.DestroyAutomaton
-
getLoadBalancingStrategy
- Specified by:
getLoadBalancingStrategyin interfaceLoadBalancingStrategyAccessor
-
setHttpDiscoveryUrl
Sets the URL for the URL property locating the service discovery discovery.- Specified by:
setHttpDiscoveryUrlin interfaceHttpDiscoveryUrlAccessor.HttpDiscoveryUrlMutator- Parameters:
aUrl- The service discovery discovery URL to be stored by the URL property.
-
setLoadBalancingStrategy
- Specified by:
setLoadBalancingStrategyin interfaceLoadBalancingStrategyAccessor.LoadBalancingStrategyMutator
-
getTrustStoreDescriptor
- Specified by:
getTrustStoreDescriptorin interfaceTrustStoreDescriptorAccessor
-
setTrustStoreDescriptor
- Specified by:
setTrustStoreDescriptorin interfaceTrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
-
getHttpDiscoveryUrl
Retrieves the URL from the URL property locating the service discovery discovery.- Specified by:
getHttpDiscoveryUrlin interfaceHttpDiscoveryUrlAccessor- Returns:
- The URL stored by the URL property.
-
toLoadBalancingStrategy
protected static LoadBalancingStrategy toLoadBalancingStrategy(LoadBalancingStrategy aStrategy, 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 TrustStoreDescriptor toTrustStoreDescriptor(TrustStoreDescriptor aStoreDescriptor, 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 Url toHttpDiscoveryUrl(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.
-