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();
    }

    ...
 }
 
 
  • Field Details

  • Constructor Details

    • AuthenticationAuditEventBuilder

      public AuthenticationAuditEventBuilder()
  • Method Details

    • authenticationEvent

      public static AuthenticationAuditEventBuilder<?> 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

      public T result(AuthenticationAuditEventBuilder.Status result)
      Sets the authentication audit event overall result.
      Parameters:
      result - the authentication overall result.
      Returns:
      an audit authentication event builder
    • principal

      public T principal(List<String> principals)
      Sets the principals of the authentication event.
      Parameters:
      principals - the list of principals
      Returns:
      an audit authentication event builder
    • context

      public T context(Map<String,Object> context)
      Sets the context used in the authentication event.
      Parameters:
      context - the authentication event context
      Returns:
      an audit authentication event builder
    • entries

      public T entries(List<?> 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