Package org.wildfly.security.audit
Class SyslogAuditEndpoint
- java.lang.Object
- 
- org.wildfly.security.audit.SyslogAuditEndpoint
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException>,- AuditEndpoint
 
 public class SyslogAuditEndpoint extends Object implements AuditEndpoint An audit endpoint that logs to syslog server.- Author:
- Darran Lofthouse
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSyslogAuditEndpoint.BuilderA builder for syslog audit endpoint.private classSyslogAuditEndpoint.TransportErrorManager
 - 
Field SummaryFields Modifier and Type Field Description private booleanacceptingprivate intcurrentReconnectAttemptsprivate SyslogAuditEndpoint.TransportErrorManagererrorManagerprivate static intINFINITE_RECONNECT_ATTEMPTS_OVERFLOW_NUMBERprivate intmaxReconnectAttemptsprivate org.jboss.logmanager.handlers.SyslogHandler.Protocolprotocolprivate org.jboss.logmanager.handlers.SyslogHandlersyslogHandlerprivate org.jboss.logmanager.handlers.TcpOutputStreamtcpOutputStream
 - 
Constructor SummaryConstructors Constructor Description SyslogAuditEndpoint(SyslogAuditEndpoint.Builder builder)Creates a new audit endpoint that logs to syslog server.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(EventPriority priority, String message)static SyslogAuditEndpoint.Builderbuilder()Obtain a newSyslogAuditEndpoint.Buildercapable of building aSyslogAuditEndpoint.private voidcheckAttempts()voidclose()Close the endpoint and stop handling further events immediately.intgetAttempts()Gets the current amount of reconnect attempts, with -1 signifying that the value for infinite reconnect attempts case has overflowed the maximum allowed amountprivate static LeveltoLevel(EventPriority eventPriority)private voidtryPublish(EventPriority priority, String message)
 
- 
- 
- 
Field Detail- 
acceptingprivate volatile boolean accepting 
 - 
syslogHandlerprivate final org.jboss.logmanager.handlers.SyslogHandler syslogHandler 
 - 
errorManagerprivate final SyslogAuditEndpoint.TransportErrorManager errorManager 
 - 
protocolprivate final org.jboss.logmanager.handlers.SyslogHandler.Protocol protocol 
 - 
maxReconnectAttemptsprivate final int maxReconnectAttempts 
 - 
tcpOutputStreamprivate final org.jboss.logmanager.handlers.TcpOutputStream tcpOutputStream 
 - 
INFINITE_RECONNECT_ATTEMPTS_OVERFLOW_NUMBERprivate static final int INFINITE_RECONNECT_ATTEMPTS_OVERFLOW_NUMBER 
 - 
currentReconnectAttemptsprivate int currentReconnectAttempts 
 
- 
 - 
Constructor Detail- 
SyslogAuditEndpointSyslogAuditEndpoint(SyslogAuditEndpoint.Builder builder) throws IOException Creates a new audit endpoint that logs to syslog server.- Throws:
- IOException
 
 
- 
 - 
Method Detail- 
acceptpublic void accept(EventPriority priority, String message) throws IOException - Specified by:
- acceptin interface- org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException>
- Throws:
- IOException
 
 - 
checkAttemptsprivate void checkAttempts() throws IOException- Throws:
- IOException
 
 - 
getAttemptspublic int getAttempts() Gets the current amount of reconnect attempts, with -1 signifying that the value for infinite reconnect attempts case has overflowed the maximum allowed amount- Returns:
- The current reconnect attempts, or -1 if the maximum tracked value for infinite attempts has overflowed
 
 - 
toLevelprivate static Level toLevel(EventPriority eventPriority) 
 - 
closepublic void close() throws IOExceptionDescription copied from interface:AuditEndpointClose the endpoint and stop handling further events immediately.- Specified by:
- closein interface- AuditEndpoint
- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException- if an error occurs closing the endpoint.
 
 - 
builderpublic static SyslogAuditEndpoint.Builder builder() Obtain a newSyslogAuditEndpoint.Buildercapable of building aSyslogAuditEndpoint.- Returns:
- a new SyslogAuditEndpoint.Buildercapable of building aSyslogAuditEndpoint.
 
 - 
tryPublishprivate void tryPublish(EventPriority priority, String message) throws IOException - Throws:
- IOException
 
 
- 
 
-