Class AuditLogger.Builder

  • Enclosing class:
    AuditLogger

    public static class AuditLogger.Builder
    extends Object
    A builder for audit logger instances.
    • Constructor Detail

      • Builder

        Builder()
    • Method Detail

      • setAuditEndpoint

        public AuditLogger.Builder setAuditEndpoint​(org.wildfly.common.function.ExceptionBiConsumer<EventPriority,​String,​IOException> auditEndpoint)
        Set the endpoint to receive the resulting audit messages.
        Parameters:
        auditEndpoint - the endpoint to receive the resulting audit messages.
        Returns:
        this builder.
      • setPriorityMapper

        public AuditLogger.Builder setPriorityMapper​(Function<SecurityEvent,​EventPriority> priorityMapper)
        Set the priority mapper to assign a priority to the messages.
        Parameters:
        priorityMapper - the priority mapper to assign a priority to the messages.
        Returns:
        this builder.
      • setMessageFormatter

        public AuditLogger.Builder setMessageFormatter​(Function<SecurityEvent,​String> messageFormatter)
        Set the message formatter to convert the messages to formatted Strings.
        Parameters:
        messageFormatter - the message formatter to convert the messages to formatted Strings.
        Returns:
        this builder.
      • build

        public Consumer<SecurityEvent> build()
        Construct a new audit logger instance.
        Returns:
        the built audit logger.