public class HealthService extends java.lang.Object implements InitializingServiceI
Consumer<HealthStatus>
via getStatusUpdater(java.lang.String, java.lang.String)
method - later it can submit its health status.
Another way to propagate health status is to provide a function which will be periodically called to get the status - it is done via registerPull(java.lang.String, java.util.function.Supplier<Health>, long)
method
We can request health status via @link #getHealthStatusMap} method.
Constructor and Description |
---|
HealthService(java.util.function.Consumer<HealthStatusVO> healthStatusVoConsumer) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,Health> |
getHealthStatusMap()
updates all health statuses (for pull functions, system stats like JVM, parent's status) and returns it as a map
|
java.util.function.Consumer<Health> |
getStatusUpdaterAdapterReconciliation(ConnectorDescriptor connectorDescriptor)
get health updater for reconciliation adapter
|
java.util.function.Consumer<Health> |
getStatusUpdaterAdapterRestSession(ConnectorDescriptor connectorDescriptor)
Deprecated.
|
java.util.function.Consumer<Health> |
getStatusUpdaterAdapterSession(ConnectorDescriptor connectorDescriptor)
Deprecated.
|
java.util.function.Consumer<Health> |
getStatusUpdaterAdapterSession(java.lang.String name,
ConnectorDescriptor connectorDescriptor)
Deprecated.
|
void |
init()
Abstract initialization method that needs to be overwritten by the Service implementing this
Interface
|
LifecyclePhase |
initPhase() |
void |
registerPull(java.lang.String serviceName,
java.util.function.Supplier<Health> healthCheckFunction,
long checkHealthMinimumIntervalSec)
instead of pushing updated health status via Consumer
|
void |
updateConnectorServiceHealth(long accountId,
DiagnosticEvent diagnosticEvent)
Updates Health status of specific adapter's Capabilities basing on DiagnosticEvent
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
lifecycleSubscriptions, onLifecycleEvent
lifeCycleType
public HealthService(java.util.function.Consumer<HealthStatusVO> healthStatusVoConsumer)
public LifecyclePhase initPhase()
initPhase
in interface InitializingServiceI
public void init()
InitializingServiceI
init
in interface InitializingServiceI
@Deprecated public java.util.function.Consumer<Health> getStatusUpdaterAdapterSession(ConnectorDescriptor connectorDescriptor)
connectorDescriptor
- @Deprecated public java.util.function.Consumer<Health> getStatusUpdaterAdapterSession(java.lang.String name, ConnectorDescriptor connectorDescriptor)
name
- connectorDescriptor
- @Deprecated public java.util.function.Consumer<Health> getStatusUpdaterAdapterRestSession(ConnectorDescriptor connectorDescriptor)
connectorDescriptor
- public java.util.function.Consumer<Health> getStatusUpdaterAdapterReconciliation(ConnectorDescriptor connectorDescriptor)
connectorDescriptor
- public java.util.Map<java.lang.String,Health> getHealthStatusMap()
public void updateConnectorServiceHealth(long accountId, DiagnosticEvent diagnosticEvent)
accountId
- diagnosticEvent
- public void registerPull(java.lang.String serviceName, java.util.function.Supplier<Health> healthCheckFunction, long checkHealthMinimumIntervalSec)
serviceName
- healthCheckFunction
- checkHealthMinimumIntervalSec
-