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
Constructors Constructor Description HealthReport(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description C
getContext()
Returns the optional context.Exception
getException()
Returns the recorded exception in case of aHealthStatus.NOT_HEALTHY
.HealthStatus
getHealthStatus()
Returns the health status.S
getSource()
Returns the event source.long
getTimestamp()
Returns the timestamp.String
toString()
-
-
-
Constructor Detail
-
HealthReport
public HealthReport(S source, HealthStatus status, long timestamp, C context)
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
public HealthReport(S source, HealthStatus status, Exception exception, long timestamp, C context)
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 Detail
-
getSource
public S getSource()
Description copied from interface:Event
Returns the event source.- Specified by:
getSource
in interfaceEvent<S,C extends SecurityContext>
- Returns:
- The event source.
-
getContext
public C 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
public HealthStatus getHealthStatus()
Returns the health status.- Returns:
- The health status.
-
getException
public Exception getException()
Returns the recorded exception in case of aHealthStatus.NOT_HEALTHY
.- Returns:
- The exception,
null
if not specified.
-
getTimestamp
public long getTimestamp()
Returns the timestamp.- Returns:
- The timestamp, in milliseconds since the Unix epoch.
-
-