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.SyslogTypeformatprivate StringhostNameprivate intmaxReconnectAttemptsprivate intportprivate InetAddressserverAddressprivate SocketFactorysocketFactoryprivate booleansslprivate booleantcp
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuditEndpointbuild()Build a newAuditEndpointconfigured to pass all messages using Syslog.SyslogAuditEndpoint.BuildersetFormat(org.jboss.logmanager.handlers.SyslogHandler.SyslogType format)Sets the SyslogFormat that will be used.SyslogAuditEndpoint.BuildersetHostName(String hostName)Set the host name that should be sent within the syslog messages.SyslogAuditEndpoint.BuildersetMaxReconnectAttempts(int maxReconnectAttempts)Sets the amount of reconnect-attempts that will be used.SyslogAuditEndpoint.BuildersetPort(int port)Set the port the syslog server is listening on.SyslogAuditEndpoint.BuildersetServerAddress(InetAddress serverAddress)Set the server address syslog messages should be sent to.SyslogAuditEndpoint.BuildersetSocketFactory(SocketFactory socketFactory)SetSocketFactoryfor TCP connections - usually to provide configuredSSLSocketFactory.SyslogAuditEndpoint.BuildersetSsl(boolean ssl)Set if the communication should be using SSL.SyslogAuditEndpoint.BuildersetTcp(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)
SetSocketFactoryfor TCP connections - usually to provide configuredSSLSocketFactory.- Parameters:
socketFactory- theSocketFactoryornullfor 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 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.
-
-