Package org.forgerock.audit.events
Class AuthenticationAuditEventBuilder<T extends AuthenticationAuditEventBuilder<T>>
java.lang.Object
org.forgerock.audit.events.AuditEventBuilder<T>
org.forgerock.audit.events.AuthenticationAuditEventBuilder<T>
- Type Parameters:
T
- the type of the builder
public class AuthenticationAuditEventBuilder<T extends AuthenticationAuditEventBuilder<T>>
extends AuditEventBuilder<T>
Builder for audit authentication events.
This builder should not be used directly but be specialized for each product to allow to define new specific fields, e.g
class OpenProductAuthenticationAuditEventBuilder<T extends OpenProductAuthenticationAuditEventBuilder<T>>
extends AuthenticationAuditEventBuilder<T> {
protected OpenProductAuthenticationAuditEventBuilder(DnsUtils dnsUtils) {
super(dnsUtils);
}
public static <T> OpenProductAuthenticationAuditEventBuilder<?> productAuthenticationEvent() {
return new OpenProductAuthenticationAuditEventBuilder(new DnsUtils());
}
public T someField(String v) {
jsonValue.put("someField", v);
return self();
}
...
}
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines a fixed set of authentication statuses that can be logged. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Defines the context key.static final String
Defines the entries key.static final String
Defines the principal key.static final String
Defines the authentication result key.Fields inherited from class org.forgerock.audit.events.AuditEventBuilder
EVENT_NAME, ISO_OFFSET_DATE_TIME_FORMAT, jsonValue, TIMESTAMP, TRACKING_IDS, TRANSACTION_ID, USER_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationAuditEventBuilder<?>
Starts to build an audit authentication event.Sets the context used in the authentication event.Sets the list of auth modules used in the authentication event and their state.Sets the principals of the authentication event.Sets the authentication audit event overall result.Methods inherited from class org.forgerock.audit.events.AuditEventBuilder
eventName, requireField, self, setDefaults, timestamp, toEvent, trackingId, trackingIds, transactionId, transactionIdFromContext, userId, validate
-
Field Details
-
RESULT
Defines the authentication result key.- See Also:
-
PRINCIPAL
Defines the principal key.- See Also:
-
CONTEXT
Defines the context key.- See Also:
-
ENTRIES
Defines the entries key.- See Also:
-
-
Constructor Details
-
AuthenticationAuditEventBuilder
public AuthenticationAuditEventBuilder()
-
-
Method Details
-
authenticationEvent
Starts to build an audit authentication event.Note: it is preferable to use a specialized builder that allow to add fields specific to a product.
- Returns:
- an audit authentication event builder
-
result
Sets the authentication audit event overall result.- Parameters:
result
- the authentication overall result.- Returns:
- an audit authentication event builder
-
principal
Sets the principals of the authentication event.- Parameters:
principals
- the list of principals- Returns:
- an audit authentication event builder
-
context
Sets the context used in the authentication event.- Parameters:
context
- the authentication event context- Returns:
- an audit authentication event builder
-
entries
Sets the list of auth modules used in the authentication event and their state.- Parameters:
entries
- the list of authentication modules and their state- Returns:
- an audit authentication event builder
-