Package com.nimbusds.jose.util.health
Class HealthReport<S,C extends SecurityContext>
java.lang.Object
com.nimbusds.jose.util.health.HealthReport<S,C>
- All Implemented Interfaces:
Event<S,
C>
@Immutable
public class HealthReport<S,C extends SecurityContext>
extends Object
implements Event<S,C>
Health report.
- Version:
- 2022-08-29
- Author:
- Vladimir Dzhuvinov
-
Constructor Summary
ConstructorsConstructorDescriptionHealthReport
(S source, HealthStatus status, long timestamp, C context) Creates a new health report.HealthReport
(S source, HealthStatus status, Exception exception, long timestamp, C context) Creates a new health report. -
Method Summary
Modifier and TypeMethodDescriptionReturns the optional context.Returns the recorded exception in case of aHealthStatus.NOT_HEALTHY
.Returns the health status.Returns the event source.long
Returns the timestamp.toString()
-
Constructor Details
-
HealthReport
Creates a new health report.- Parameters:
source
- The event source.status
- The health status. Must not benull
.timestamp
- The timestamp, in milliseconds since the Unix epoch.context
- The optional context,null
if not required.
-
HealthReport
Creates a new health report.- Parameters:
source
- The event source.status
- The health status. Must not benull
.exception
- The exception in case of aHealthStatus.NOT_HEALTHY
,null
if not specified.timestamp
- The timestamp, in milliseconds since the Unix epoch.context
- The optional context,null
if not required.
-
-
Method Details
-
getSource
Description copied from interface:Event
Returns the event source.- Specified by:
getSource
in interfaceEvent<S,
C extends SecurityContext> - Returns:
- The event source.
-
getContext
Description copied from interface:Event
Returns the optional context.- Specified by:
getContext
in interfaceEvent<S,
C extends SecurityContext> - Returns:
- The optional context,
null
if not specified.
-
getHealthStatus
Returns the health status.- Returns:
- The health status.
-
getException
Returns the recorded exception in case of aHealthStatus.NOT_HEALTHY
.- Returns:
- The exception,
null
if not specified.
-
getTimestamp
Returns the timestamp.- Returns:
- The timestamp, in milliseconds since the Unix epoch.
-
toString
-