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 Details

    • setDateTimeFormatterSupplier

      public FileAuditEndpoint.Builder setDateTimeFormatterSupplier(Supplier<DateTimeFormatter> dateTimeFormatterSupplier)
      Set the supplier to obtain the DateTimeFormatter for dates. The supplied formatter has to have a time zone configured.
      Parameters:
      dateTimeFormatterSupplier - the supplier to obtain the DateTimeFormatter
      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 using setFlushOnAccept(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