Class SyslogAuditEndpoint.Builder

java.lang.Object
org.wildfly.security.audit.SyslogAuditEndpoint.Builder
Enclosing class:
SyslogAuditEndpoint

public static class SyslogAuditEndpoint.Builder extends Object
A builder for syslog audit endpoint.
  • Method Details

    • setServerAddress

      public SyslogAuditEndpoint.Builder setServerAddress(InetAddress serverAddress)
      Set the server address syslog messages should be sent to.
      Parameters:
      serverAddress - the server address syslog messages should be sent to.
      Returns:
      this builder.
    • setPort

      public SyslogAuditEndpoint.Builder setPort(int port)
      Set the port the syslog server is listening on.
      Parameters:
      port - the port the syslog server is listening on.
      Returns:
      this builder.
    • setTcp

      public SyslogAuditEndpoint.Builder setTcp(boolean tcp)
      Set if the communication should be using TCP.
      Parameters:
      tcp - if the communication should be using TCP.
      Returns:
      this builder.
    • setSsl

      public SyslogAuditEndpoint.Builder setSsl(boolean ssl)
      Set if the communication should be using SSL.
      Parameters:
      ssl - if the communication should be using SSL.
      Returns:
      this builder.
    • setSocketFactory

      public SyslogAuditEndpoint.Builder setSocketFactory(SocketFactory socketFactory)
      Set SocketFactory for TCP connections - usually to provide configured SSLSocketFactory.
      Parameters:
      socketFactory - the SocketFactory or null for default SocketFactory.
      Returns:
      this builder.
    • setHostName

      public SyslogAuditEndpoint.Builder setHostName(String hostName)
      Set the host name that should be sent within the syslog messages.
      Parameters:
      hostName - the host name that should be sent within the syslog messages.
      Returns:
      this builder.
    • setFormat

      public SyslogAuditEndpoint.Builder setFormat(org.jboss.logmanager.handlers.SyslogHandler.SyslogType format)
      Sets the SyslogFormat that will be used.
      Parameters:
      format - The SyslogFormat that should be used
      Returns:
      this builder.
    • setMaxReconnectAttempts

      public SyslogAuditEndpoint.Builder setMaxReconnectAttempts(int maxReconnectAttempts) throws IllegalArgumentException
      Sets the amount of reconnect-attempts that will be used.
      Parameters:
      maxReconnectAttempts - The maximum number of reconnect-attempts attempts with: -1 meaning indefinite attempts 0 meaning no attempts Any positive integer meaning that number of attempts
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - throws an error in the case of a bad reconnect-attempts value of < -1
    • build

      public AuditEndpoint build() throws IOException
      Build a new AuditEndpoint configured to pass all messages using Syslog.
      Returns:
      a new AuditEndpoint configured to pass all messages using Syslog.
      Throws:
      IOException - if an error occurs initialising the endpoint.