Class DuoHealthCheck
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.duo.model.DuoHealthCheck
-
@Immutable @ThreadSafe public final class DuoHealthCheck extends Object
Represents a health check response from Duo's 2FA endpoint.
Includes a staged builder for fluent generation. Compatible with Jackson deserialization.
Is immutable, can only be built using the builder and not changed thereafter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDuoHealthCheck.BuilderBuilder to buildDuoHealthCheck.static interfaceDuoHealthCheck.IBuildStageRequired fields builder.static interfaceDuoHealthCheck.IStatusStageStatus builder.
-
Field Summary
Fields Modifier and Type Field Description private StringcodeThe error response code.private StringmessageThe error response message.private StringmessageDetailThe error response detailed message.private DuoHealthCheckResponseresponseWhen a successful response was issued, as seconds since Unix EPOCH.private StringstatusA successful 'OK' or unsuccessful 'FAIL' response.private StringtimestampWhen an unsuccessful response was issued, as seconds since Unix EPOCH.
-
Constructor Summary
Constructors Modifier Constructor Description privateDuoHealthCheck(DuoHealthCheck.Builder builder)Private constructor, can only be called by this builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DuoHealthCheck.IStatusStagebuilder()Creates builder to buildDuoHealthCheck.StringgetCode()Get the response code.StringgetMessage()Get the response message.StringgetMessageDetail()Get a detailed response message.DuoHealthCheckResponsegetResponse()Get the response object.StringgetStatus()Get the health status of the 2FA endpoint.StringgetTimestamp()Get the timestamp!!StringtoString()
-
-
-
Field Detail
-
status
@Nonnull @NotEmpty private final String status
A successful 'OK' or unsuccessful 'FAIL' response.
-
response
@Nullable private final DuoHealthCheckResponse response
When a successful response was issued, as seconds since Unix EPOCH.
-
timestamp
@Nullable private final String timestamp
When an unsuccessful response was issued, as seconds since Unix EPOCH.
-
message
@Nullable private final String message
The error response message.
-
messageDetail
@Nullable private final String messageDetail
The error response detailed message.
-
-
Constructor Detail
-
DuoHealthCheck
private DuoHealthCheck(DuoHealthCheck.Builder builder)
Private constructor, can only be called by this builder.- Parameters:
builder- the builder to build the instance with
-
-
Method Detail
-
getStatus
@Nonnull public String getStatus()
Get the health status of the 2FA endpoint.- Returns:
- Returns the status.
-
getResponse
@Nullable public DuoHealthCheckResponse getResponse()
Get the response object.- Returns:
- Returns the response.
-
getCode
@Nullable public String getCode()
Get the response code.- Returns:
- Returns the code.
-
getTimestamp
@Nullable public String getTimestamp()
Get the timestamp!!- Returns:
- Returns the timestamp.
-
getMessage
@Nullable public String getMessage()
Get the response message.- Returns:
- Returns the message.
-
getMessageDetail
@Nullable public String getMessageDetail()
Get a detailed response message.- Returns:
- Returns the messageDetail.
-
builder
public static DuoHealthCheck.IStatusStage builder()
Creates builder to buildDuoHealthCheck.- Returns:
- created builder
-
-