public interface HealthService
HealthMonitorable
's.Modifier and Type | Method and Description |
---|---|
void |
addHealthListener(HealthListener listener)
Add a health listener.
|
void |
addHealthMonitor(HealthMonitorable monitor)
Add a new HealthMonitorable.
|
void |
addHealthMonitorableListener(HealthMonitorableListener listener)
Add a health monitorable listener.
|
Health |
fetchImmediateHealth(String monitorId)
Immediately interrogate the health monitorable for the given monitorid
to retrieve the health at this time.
|
Health |
getHealth(String id)
Retrieve the last-known health reported by the HealthMonitorable with
the given id.
|
boolean |
hasHealthListener(HealthListener listener)
Check to see if the given HealthListener has been registered with the
HealthService yet.
|
boolean |
hasHealthMonitor(String monitorId)
Check to see if the HealthMonitorable with the given id has been
registered already.
|
Map<String,Health> |
listHealth()
Retrieve all the last-known health reported.
|
void |
removeHealthListener(HealthListener listener)
Remove a health listener.
|
void |
removeHealthMonitor(String monitorId)
Remove a HealthMonitorable.
|
void |
removeHealthMonitorableListener(HealthMonitorableListener listener)
Remove a listener for health monitorable events.
|
void |
updateHealth(String monitorId,
Health health)
Inject a Health status.
|
boolean hasHealthMonitor(String monitorId)
monitorId
- id of monitor to checkvoid addHealthMonitor(HealthMonitorable monitor)
removeHealthMonitor(String)
for any HealthMonitorable it
registers with the HealthService upon its departure.monitor
- HealthMonitorablevoid removeHealthMonitor(String monitorId)
monitorId
- id of the HealthMonitorable to removevoid updateHealth(String monitorId, Health health)
monitorId
- id of the HealthMonitorablehealth
- healthHealth getHealth(String id) throws NotFoundException
id
- id of HealthMonitorableNotFoundException
- if the given id is not foundHealth fetchImmediateHealth(String monitorId)
Note: This call
will not update the last-known health value for this health monitorable
so the value obtained by the getHealth(String)
may be
different. Normal operation is to use the getHealth(String)
method.
monitorId
- THe ID of the monitorable to get health for.NotFoundException
- if there is no health monitorable
registered with the given idMap<String,Health> listHealth()
boolean hasHealthListener(HealthListener listener)
listener
- HealthListenervoid addHealthListener(HealthListener listener)
removeHealthListener(HealthListener)
with the HealthService
upon its departure.listener
- listener to be addedvoid removeHealthListener(HealthListener listener)
listener
- listener to be removedvoid addHealthMonitorableListener(HealthMonitorableListener listener)
removeHealthMonitorableListener(HealthMonitorableListener)
with
the HealthService upon its departure.listener
- listener to be addedvoid removeHealthMonitorableListener(HealthMonitorableListener listener)
listener
- listener to be removedCopyright © 2016. All Rights Reserved.