Package org.wildfly.security.audit
Class SyslogAuditEndpoint.Builder
java.lang.Object
org.wildfly.security.audit.SyslogAuditEndpoint.Builder
- Enclosing class:
- SyslogAuditEndpoint
A builder for syslog audit endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newAuditEndpointconfigured to pass all messages using Syslog.setFormat(SyslogHandler.SyslogType format) Sets the SyslogFormat that will be used.setHostName(String hostName) Set the host name that should be sent within the syslog messages.setMaxReconnectAttempts(int maxReconnectAttempts) Sets the amount of reconnect-attempts that will be used.setPort(int port) Set the port the syslog server is listening on.setServerAddress(InetAddress serverAddress) Set the server address syslog messages should be sent to.setSocketFactory(SocketFactory socketFactory) SetSocketFactoryfor TCP connections - usually to provide configuredSSLSocketFactory.setSsl(boolean ssl) Set if the communication should be using SSL.setTcp(boolean tcp) Set if the communication should be using TCP.
-
Method Details
-
setServerAddress
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
Set the port the syslog server is listening on.- Parameters:
port- the port the syslog server is listening on.- Returns:
- this builder.
-
setTcp
Set if the communication should be using TCP.- Parameters:
tcp- if the communication should be using TCP.- Returns:
- this builder.
-
setSsl
Set if the communication should be using SSL.- Parameters:
ssl- if the communication should be using SSL.- Returns:
- this builder.
-
setSocketFactory
SetSocketFactoryfor TCP connections - usually to provide configuredSSLSocketFactory.- Parameters:
socketFactory- theSocketFactoryornullfor defaultSocketFactory.- Returns:
- this builder.
-
setHostName
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
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
Build a newAuditEndpointconfigured to pass all messages using Syslog.- Returns:
- a new
AuditEndpointconfigured to pass all messages using Syslog. - Throws:
IOException- if an error occurs initialising the endpoint.
-