Package org.apache.camel.health
Interface HealthCheck
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
HealthCheck.Kind
static interface
HealthCheck.Result
Response to a health check invocation.static class
HealthCheck.State
-
Field Summary
Fields Modifier and Type Field Description static String
CHECK_ENABLED
static String
CHECK_GROUP
static String
CHECK_ID
static String
CHECK_KIND
static String
ENDPOINT_URI
static String
FAILURE_COUNT
static String
FAILURE_ENDPOINT_URI
Deprecated.static String
FAILURE_ERROR_COUNT
static String
FAILURE_START_TIME
static String
FAILURE_TIME
static String
HTTP_RESPONSE_CODE
static String
INVOCATION_ATTEMPT_TIME
Deprecated.static String
INVOCATION_COUNT
static String
INVOCATION_TIME
static String
SUCCESS_COUNT
static String
SUCCESS_START_TIME
static String
SUCCESS_TIME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default HealthCheck.Result
call()
Invoke the check.HealthCheck.Result
call(Map<String,Object> options)
Invoke the check.default HealthCheck.Result
callLiveness()
Invoke the check as liveness check.default HealthCheck.Result
callReadiness()
Invoke the check as readiness check.default Map<String,Object>
getMetaData()
Return metadata associated with thisHealthCheck
.default int
getOrder()
Gets the order.boolean
isEnabled()
Whether this health check is enableddefault boolean
isLiveness()
Whether this health check can be used for liveness checks Liveness check is not default, and must be explicit enabled.default boolean
isReadiness()
Whether this health check can be used for readiness checks.void
setEnabled(boolean enabled)
Used for enabling or disabling this health check
-
-
-
Field Detail
-
CHECK_ID
static final String CHECK_ID
- See Also:
- Constant Field Values
-
CHECK_GROUP
static final String CHECK_GROUP
- See Also:
- Constant Field Values
-
CHECK_KIND
static final String CHECK_KIND
- See Also:
- Constant Field Values
-
CHECK_ENABLED
static final String CHECK_ENABLED
- See Also:
- Constant Field Values
-
INVOCATION_COUNT
static final String INVOCATION_COUNT
- See Also:
- Constant Field Values
-
INVOCATION_TIME
static final String INVOCATION_TIME
- See Also:
- Constant Field Values
-
INVOCATION_ATTEMPT_TIME
@Deprecated static final String INVOCATION_ATTEMPT_TIME
Deprecated.- See Also:
- Constant Field Values
-
FAILURE_COUNT
static final String FAILURE_COUNT
- See Also:
- Constant Field Values
-
FAILURE_START_TIME
static final String FAILURE_START_TIME
- See Also:
- Constant Field Values
-
FAILURE_TIME
static final String FAILURE_TIME
- See Also:
- Constant Field Values
-
FAILURE_ERROR_COUNT
static final String FAILURE_ERROR_COUNT
- See Also:
- Constant Field Values
-
ENDPOINT_URI
static final String ENDPOINT_URI
- See Also:
- Constant Field Values
-
SUCCESS_COUNT
static final String SUCCESS_COUNT
- See Also:
- Constant Field Values
-
SUCCESS_START_TIME
static final String SUCCESS_START_TIME
- See Also:
- Constant Field Values
-
SUCCESS_TIME
static final String SUCCESS_TIME
- See Also:
- Constant Field Values
-
HTTP_RESPONSE_CODE
static final String HTTP_RESPONSE_CODE
- See Also:
- Constant Field Values
-
FAILURE_ENDPOINT_URI
@Deprecated static final String FAILURE_ENDPOINT_URI
Deprecated.Use ENDPOINT_URI- See Also:
- Constant Field Values
-
-
Method Detail
-
getOrder
default int getOrder()
Description copied from interface:Ordered
Gets the order. Use low numbers for higher priority. Normally the sorting will start from 0 and move upwards. So if you want to be last then useInteger.MAX_VALUE
or egOrdered.LOWEST
.
-
isEnabled
boolean isEnabled()
Whether this health check is enabled
-
setEnabled
void setEnabled(boolean enabled)
Used for enabling or disabling this health check
-
getMetaData
default Map<String,Object> getMetaData()
Return metadata associated with thisHealthCheck
.
-
isReadiness
default boolean isReadiness()
Whether this health check can be used for readiness checks. Readiness check is default.
-
isLiveness
default boolean isLiveness()
Whether this health check can be used for liveness checks Liveness check is not default, and must be explicit enabled.
-
call
default HealthCheck.Result call()
Invoke the check.- See Also:
call(Map)
-
callReadiness
default HealthCheck.Result callReadiness()
Invoke the check as readiness check.- See Also:
call(Map)
-
callLiveness
default HealthCheck.Result callLiveness()
Invoke the check as liveness check.- See Also:
call(Map)
-
call
HealthCheck.Result call(Map<String,Object> options)
Invoke the check. The implementation is responsible to eventually perform the check according to the limitation of the third party system i.e. it should not be performed too often to avoid rate limiting. The options argument can be used to pass information specific to the check like forcing the check to be performed against the policies. The implementation is responsible to catch and handle any exception thrown by the underlying technology, including unchecked ones.
-
-