Package org.wildfly.security.audit
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.
-
-
Field Summary
Fields Modifier and Type Field Description private org.jboss.logmanager.handlers.SyslogHandler.SyslogType
format
private String
hostName
private int
maxReconnectAttempts
private int
port
private InetAddress
serverAddress
private SocketFactory
socketFactory
private boolean
ssl
private boolean
tcp
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuditEndpoint
build()
Build a newAuditEndpoint
configured to pass all messages using Syslog.SyslogAuditEndpoint.Builder
setFormat(org.jboss.logmanager.handlers.SyslogHandler.SyslogType format)
Sets the SyslogFormat that will be used.SyslogAuditEndpoint.Builder
setHostName(String hostName)
Set the host name that should be sent within the syslog messages.SyslogAuditEndpoint.Builder
setMaxReconnectAttempts(int maxReconnectAttempts)
Sets the amount of reconnect-attempts that will be used.SyslogAuditEndpoint.Builder
setPort(int port)
Set the port the syslog server is listening on.SyslogAuditEndpoint.Builder
setServerAddress(InetAddress serverAddress)
Set the server address syslog messages should be sent to.SyslogAuditEndpoint.Builder
setSocketFactory(SocketFactory socketFactory)
SetSocketFactory
for TCP connections - usually to provide configuredSSLSocketFactory
.SyslogAuditEndpoint.Builder
setSsl(boolean ssl)
Set if the communication should be using SSL.SyslogAuditEndpoint.Builder
setTcp(boolean tcp)
Set if the communication should be using TCP.
-
-
-
Field Detail
-
serverAddress
private InetAddress serverAddress
-
port
private int port
-
ssl
private boolean ssl
-
tcp
private boolean tcp
-
hostName
private String hostName
-
socketFactory
private SocketFactory socketFactory
-
format
private org.jboss.logmanager.handlers.SyslogHandler.SyslogType format
-
maxReconnectAttempts
private int maxReconnectAttempts
-
-
Method Detail
-
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)
SetSocketFactory
for TCP connections - usually to provide configuredSSLSocketFactory
.- Parameters:
socketFactory
- theSocketFactory
ornull
for defaultSocketFactory
.- 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 newAuditEndpoint
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.
-
-