Package org.wildfly.security.audit
Class AuditLogger.Builder
- java.lang.Object
-
- org.wildfly.security.audit.AuditLogger.Builder
-
- Enclosing class:
- AuditLogger
public static class AuditLogger.Builder extends Object
A builder for audit logger instances.
-
-
Field Summary
Fields Modifier and Type Field Description private org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException>
auditEndpoint
private Function<SecurityEvent,String>
messageFormatter
private Function<SecurityEvent,EventPriority>
priorityMapper
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer<SecurityEvent>
build()
Construct a new audit logger instance.AuditLogger.Builder
setAuditEndpoint(org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException> auditEndpoint)
Set the endpoint to receive the resulting audit messages.AuditLogger.Builder
setMessageFormatter(Function<SecurityEvent,String> messageFormatter)
Set the message formatter to convert the messages to formatted Strings.AuditLogger.Builder
setPriorityMapper(Function<SecurityEvent,EventPriority> priorityMapper)
Set the priority mapper to assign a priority to the messages.
-
-
-
Field Detail
-
auditEndpoint
private org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException> auditEndpoint
-
priorityMapper
private Function<SecurityEvent,EventPriority> priorityMapper
-
messageFormatter
private Function<SecurityEvent,String> messageFormatter
-
-
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.
-
-