Package org.wildfly.security.audit
Class FileAuditEndpoint.Builder
- java.lang.Object
-
- org.wildfly.security.audit.FileAuditEndpoint.Builder
-
- Direct Known Subclasses:
PeriodicRotatingFileAuditEndpoint.Builder,SizeRotatingFileAuditEndpoint.Builder
- Enclosing class:
- FileAuditEndpoint
public static class FileAuditEndpoint.Builder extends Object
A builder for file audit endpoints.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuditEndpointbuild()Construct a new file audit endpoint.FileAuditEndpoint.BuildersetCharset(Charset charset)Set the file's character set.FileAuditEndpoint.BuildersetDateTimeFormatterSupplier(Supplier<DateTimeFormatter> dateTimeFormatterSupplier)Set the supplier to obtain theDateTimeFormatterfor dates.FileAuditEndpoint.BuildersetFlushOnAccept(boolean flushOnAccept)Sets if the output should be flushed on each event accepted.FileAuditEndpoint.BuildersetLocation(Path location)Set the location to write the audit events to.FileAuditEndpoint.BuildersetSyncOnAccept(boolean syncOnAccept)Sets if the system output buffers should be forced to be synchronized on each event accepted.
-
-
-
Method Detail
-
setDateTimeFormatterSupplier
public FileAuditEndpoint.Builder setDateTimeFormatterSupplier(Supplier<DateTimeFormatter> dateTimeFormatterSupplier)
Set the supplier to obtain theDateTimeFormatterfor dates. The supplied formatter has to have a time zone configured.- Parameters:
dateTimeFormatterSupplier- the supplier to obtain theDateTimeFormatter- Returns:
- this builder.
-
setLocation
public FileAuditEndpoint.Builder setLocation(Path location)
Set the location to write the audit events to.- Parameters:
location- the location to write the audit events to.- Returns:
- this builder.
-
setFlushOnAccept
public FileAuditEndpoint.Builder setFlushOnAccept(boolean flushOnAccept)
Sets if the output should be flushed on each event accepted. If not set, flushing is done when output buffers synchronization is set.- Parameters:
flushOnAccept- should the output be flushed on each event accepted.- Returns:
- this builder.
- Since:
- 1.3.0
-
setSyncOnAccept
public FileAuditEndpoint.Builder setSyncOnAccept(boolean syncOnAccept)
Sets if the system output buffers should be forced to be synchronized on each event accepted. Enabled by default. Output flushing can be set independently usingsetFlushOnAccept(boolean)but defaults to this value.- Parameters:
syncOnAccept- should the system output buffers be forced to be synchronized on each event accepted.- Returns:
- this builder.
-
setCharset
public FileAuditEndpoint.Builder setCharset(Charset charset)
Set the file's character set.- Parameters:
charset- the character set- Returns:
- this builder.
-
build
public AuditEndpoint build() throws IOException
Construct a new file audit endpoint.- Returns:
- the built file audit endpoint.
- Throws:
IOException
-
-