Class HealthReport<S,​C extends SecurityContext>

  • All Implemented Interfaces:
    Event<S,​C>

    @Immutable
    public class HealthReport<S,​C extends SecurityContext>
    extends java.lang.Object
    implements Event<S,​C>
    Health report.
    Version:
    2022-08-29
    Author:
    Vladimir Dzhuvinov
    • 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 be null.
        timestamp - The timestamp, in milliseconds since the Unix epoch.
        context - The optional context, null if not specified.
      • HealthReport

        public HealthReport​(S source,
                            HealthStatus status,
                            java.lang.Exception exception,
                            long timestamp,
                            C context)
        Creates a new health report.
        Parameters:
        source - The event source.
        status - The health status. Must not be null.
        exception - The exception in case of a HealthStatus.NOT_HEALTHY, null if not specified.
        timestamp - The timestamp, in milliseconds since the Unix epoch.
        context - The optional context, null if not specified.
    • Method Detail

      • getSource

        public S getSource()
        Description copied from interface: Event
        Returns the event source.
        Specified by:
        getSource in interface Event<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 interface Event<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 java.lang.Exception getException()
        Returns the recorded exception in case of a HealthStatus.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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object