org.productivity.java.syslog4j.impl
Class AbstractSyslogConfig

java.lang.Object
  extended by org.productivity.java.syslog4j.impl.AbstractSyslogConfig
All Implemented Interfaces:
java.io.Serializable, AbstractSyslogConfigIF, SyslogCharSetIF, SyslogConfigIF, SyslogConstants
Direct Known Subclasses:
AbstractNetSyslogConfig, UnixSocketSyslogConfig, UnixSyslogConfig

public abstract class AbstractSyslogConfig
extends java.lang.Object
implements AbstractSyslogConfigIF

AbstractSyslog provides a base abstract implementation of the SyslogConfigIF configuration interface.

Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the LGPL license is available in the META-INF folder in all distributions of Syslog4j and in the base directory of the "doc" ZIP.

Version:
$Id: AbstractSyslogConfig.java,v 1.24 2010/11/28 04:43:31 cvs Exp $
Author:
<syslog4j@productivity.org>
See Also:
Serialized Form

Field Summary
protected  java.util.List backLogHandlers
           
protected  java.lang.String charSet
           
protected static java.util.List defaultBackLogHandlers
           
protected  int facility
           
protected  java.lang.String ident
           
protected  boolean includeIdentInMessageModifier
           
protected  java.lang.String localName
           
protected  int maxMessageLength
           
protected  long maxShutdownWait
           
protected  java.util.List messageModifiers
           
protected  boolean sendLocalName
           
protected  boolean sendLocalTimestamp
           
protected  byte[] splitMessageBeginText
           
protected  byte[] splitMessageEndText
           
protected  boolean threaded
           
protected  long threadLoopInterval
           
protected  int threadPriority
           
protected  boolean throwExceptionOnInitialize
           
protected  boolean throwExceptionOnWrite
           
protected  boolean truncateMessage
           
protected  boolean useDaemonThread
           
protected  boolean useStructuredData
           
protected  int writeRetries
           
 
Fields inherited from interface org.productivity.java.syslog4j.SyslogConstants
AF_UNIX, CACHE_HOST_ADDRESS_DEFAULT, CHAR_SET_DEFAULT, CRLF, FACILITY_AUTH, FACILITY_AUTHPRIV, FACILITY_CRON, FACILITY_DAEMON, FACILITY_FTP, FACILITY_KERN, FACILITY_LOCAL0, FACILITY_LOCAL1, FACILITY_LOCAL2, FACILITY_LOCAL3, FACILITY_LOCAL4, FACILITY_LOCAL5, FACILITY_LOCAL6, FACILITY_LOCAL7, FACILITY_LPR, FACILITY_MAIL, FACILITY_NEWS, FACILITY_SYSLOG, FACILITY_USER, FACILITY_UUCP, IDENT_SUFFIX_DEFAULT, INCLUDE_IDENT_IN_MESSAGE_MODIFIER_DEFAULT, JNA_NATIVE_CLASS, LEVEL_ALERT, LEVEL_CRITICAL, LEVEL_DEBUG, LEVEL_EMERGENCY, LEVEL_ERROR, LEVEL_INFO, LEVEL_NOTICE, LEVEL_WARN, LF, MAX_MESSAGE_LENGTH_DEFAULT, MAX_QUEUE_SIZE_DEFAULT, MAX_SHUTDOWN_WAIT_DEFAULT, OPTION_LOG_CONS, OPTION_LOG_NDELAY, OPTION_LOG_NOWAIT, OPTION_LOG_ODELAY, OPTION_LOG_PERROR, OPTION_LOG_PID, OPTION_NONE, SEND_LOCAL_NAME_DEFAULT, SEND_LOCAL_NAME_DEFAULT_VALUE, SEND_LOCAL_TIMESTAMP_DEFAULT, SERVER_SHUTDOWN_WAIT_DEFAULT, SERVER_SOCKET_BACKLOG_DEFAULT, SHUTDOWN_INTERVAL, SOCK_DGRAM, SOCK_STREAM, SPLIT_MESSAGE_BEGIN_TEXT_DEFAULT, SPLIT_MESSAGE_END_TEXT_DEFAULT, STRUCTURED_DATA_APP_NAME_DEFAULT_VALUE, STRUCTURED_DATA_EMPTY_VALUE, STRUCTURED_DATA_NILVALUE, STRUCTURED_DATA_PROCESS_ID_DEFAULT_VALUE, SYSLOG_BUFFER_SIZE, SYSLOG_DATEFORMAT, SYSLOG_FACILITY_DEFAULT, SYSLOG_HOST_DEFAULT, SYSLOG_LIBRARY_DEFAULT, SYSLOG_MESSAGE_MODIFIER_PREFIX_DEFAULT, SYSLOG_MESSAGE_MODIFIER_SUFFIX_DEFAULT, SYSLOG_PATH_DEFAULT, SYSLOG_POOL_CONFIG_MAX_ACTIVE_DEFAULT, SYSLOG_POOL_CONFIG_MAX_IDLE_DEFAULT, SYSLOG_POOL_CONFIG_MAX_WAIT_DEFAULT, SYSLOG_POOL_CONFIG_MIN_EVICTABLE_IDLE_TIME_MILLIS_DEFAULT, SYSLOG_POOL_CONFIG_MIN_IDLE_DEFAULT, SYSLOG_POOL_CONFIG_NUM_TESTS_PER_EVICTION_RUN_DEFAULT, SYSLOG_POOL_CONFIG_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS_DEFAULT, SYSLOG_POOL_CONFIG_TEST_ON_BORROW_DEFAULT, SYSLOG_POOL_CONFIG_TEST_ON_RETURN_DEFAULT, SYSLOG_POOL_CONFIG_TEST_WHILE_IDLE_DEFAULT, SYSLOG_POOL_CONFIG_TIME_BETWEEN_EVICTION_RUNS_MILLIS_DEFAULT, SYSLOG_PORT_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_FIRST_NUMBER_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_LAST_NUMBER_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_PAD_CHAR_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_PREFIX_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_SUFFIX_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_USE_PADDING_DEFAULT, SYSLOG_SOCKET_FAMILY_DEFAULT, SYSLOG_SOCKET_LIBRARY_DEFAULT, SYSLOG_SOCKET_PATH_DEFAULT, SYSLOG_SOCKET_PROTOCOL_DEFAULT, SYSLOG_SOCKET_TYPE_DEFAULT, TCP, TCP_DELIMITER_SEQUENCE_DEFAULT, TCP_FRESH_CONNECTION_INTERVAL_DEFAULT, TCP_KEEP_ALIVE_DEFAULT, TCP_MAX_ACTIVE_SOCKETS_BEHAVIOR_DEFAULT, TCP_MAX_ACTIVE_SOCKETS_DEFAULT, TCP_PERSISTENT_CONNECTION_DEFAULT, TCP_REUSE_ADDRESS_DEFAULT, TCP_SET_BUFFER_SIZE_DEFAULT, TCP_SO_LINGER_DEFAULT, TCP_SO_LINGER_SECONDS_DEFAULT, THREAD_LOOP_INTERVAL_DEFAULT, THREAD_PRIORITY_DEFAULT, THREADED_DEFAULT, THROW_EXCEPTION_ON_INITIALIZE_DEFAULT, THROW_EXCEPTION_ON_WRITE_DEFAULT, TRUNCATE_MESSAGE_DEFAULT, UDP, UNIX_SOCKET, UNIX_SYSLOG, USE_DAEMON_THREAD_DEFAULT, USE_STRUCTURED_DATA_DEFAULT, WRITE_RETRIES_DEFAULT
 
Constructor Summary
AbstractSyslogConfig()
           
 
Method Summary
protected  java.util.List _getBackLogHandlers()
           
protected  java.util.List _getMessageModifiers()
           
 void addBackLogHandler(SyslogBackLogHandlerIF backLogHandler)
           
 void addMessageModifier(SyslogMessageModifierIF messageModifier)
           
 java.util.List getBackLogHandlers()
           
 java.lang.String getCharSet()
           
 int getFacility()
           
 java.lang.String getIdent()
           
 java.lang.String getLocalName()
           
 int getMaxMessageLength()
           
 long getMaxShutdownWait()
           
 java.util.List getMessageModifiers()
           
 byte[] getSplitMessageBeginText()
           
 byte[] getSplitMessageEndText()
           
abstract  java.lang.Class getSyslogClass()
           
 java.lang.Class getSyslogWriterClass()
           
 long getThreadLoopInterval()
           
 int getThreadPriority()
           
 int getWriteRetries()
           
 void insertBackLogHandler(int index, SyslogBackLogHandlerIF backLogHandler)
           
 void insertMessageModifier(int index, SyslogMessageModifierIF messageModifier)
           
 boolean isIncludeIdentInMessageModifier()
           
 boolean isSendLocalName()
           
 boolean isSendLocalTimestamp()
           
 boolean isThreaded()
           
 boolean isThrowExceptionOnInitialize()
           
 boolean isThrowExceptionOnWrite()
           
 boolean isTruncateMessage()
           
 boolean isUseDaemonThread()
           
 boolean isUseStructuredData()
           
 void removeAllBackLogHandlers()
           
 void removeAllMessageModifiers()
           
 void removeBackLogHandler(SyslogBackLogHandlerIF backLogHandler)
           
 void removeMessageModifier(SyslogMessageModifierIF messageModifier)
           
 void setBackLogHandlers(java.util.List backLogHandlers)
           
 void setCharSet(java.lang.String charSet)
           
 void setFacility(int facility)
           
 void setFacility(java.lang.String facilityName)
           
 void setIdent(java.lang.String ident)
           
 void setIncludeIdentInMessageModifier(boolean includeIdentInMessageModifier)
           
 void setLocalName(java.lang.String localName)
           
 void setMaxMessageLength(int maxMessageLength)
           
 void setMaxShutdownWait(long maxShutdownWait)
           
 void setMessageModifiers(java.util.List messageModifiers)
           
 void setSendLocalName(boolean sendLocalName)
           
 void setSendLocalTimestamp(boolean sendLocalTimestamp)
           
 void setSplitMessageBeginText(byte[] splitMessageBeginText)
           
 void setSplitMessageBeginText(java.lang.String splitMessageBeginText)
           
 void setSplitMessageEndText(byte[] splitMessageEndText)
           
 void setSplitMessageEndText(java.lang.String splitMessageEndText)
           
 void setThreaded(boolean threaded)
           
 void setThreadLoopInterval(long threadLoopInterval)
           
 void setThreadPriority(int threadPriority)
           
 void setThrowExceptionOnInitialize(boolean throwExceptionOnInitialize)
           
 void setThrowExceptionOnWrite(boolean throwExceptionOnWrite)
           
 void setTruncateMessage(boolean truncateMessage)
           
 void setUseDaemonThread(boolean useDaemonThread)
           
 void setUseStructuredData(boolean useStructuredData)
           
 void setWriteRetries(int writeRetries)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.productivity.java.syslog4j.impl.AbstractSyslogConfigIF
getMaxQueueSize, setMaxQueueSize
 
Methods inherited from interface org.productivity.java.syslog4j.SyslogConfigIF
getHost, getPort, setHost, setPort
 

Field Detail

defaultBackLogHandlers

protected static final java.util.List defaultBackLogHandlers

facility

protected int facility

charSet

protected java.lang.String charSet

ident

protected java.lang.String ident

localName

protected java.lang.String localName

sendLocalTimestamp

protected boolean sendLocalTimestamp

sendLocalName

protected boolean sendLocalName

includeIdentInMessageModifier

protected boolean includeIdentInMessageModifier

throwExceptionOnWrite

protected boolean throwExceptionOnWrite

throwExceptionOnInitialize

protected boolean throwExceptionOnInitialize

maxMessageLength

protected int maxMessageLength

splitMessageBeginText

protected byte[] splitMessageBeginText

splitMessageEndText

protected byte[] splitMessageEndText

messageModifiers

protected java.util.List messageModifiers

backLogHandlers

protected java.util.List backLogHandlers

threaded

protected boolean threaded

useDaemonThread

protected boolean useDaemonThread

threadPriority

protected int threadPriority

threadLoopInterval

protected long threadLoopInterval

writeRetries

protected int writeRetries

maxShutdownWait

protected long maxShutdownWait

truncateMessage

protected boolean truncateMessage

useStructuredData

protected boolean useStructuredData
Constructor Detail

AbstractSyslogConfig

public AbstractSyslogConfig()
Method Detail

getSyslogClass

public abstract java.lang.Class getSyslogClass()
Specified by:
getSyslogClass in interface SyslogConfigIF

getCharSet

public java.lang.String getCharSet()
Specified by:
getCharSet in interface SyslogCharSetIF
Specified by:
getCharSet in interface SyslogConfigIF

setCharSet

public void setCharSet(java.lang.String charSet)
Specified by:
setCharSet in interface SyslogCharSetIF
Specified by:
setCharSet in interface SyslogConfigIF

getLocalName

public java.lang.String getLocalName()
Specified by:
getLocalName in interface SyslogConfigIF

setLocalName

public void setLocalName(java.lang.String localName)
Specified by:
setLocalName in interface SyslogConfigIF

isThrowExceptionOnWrite

public boolean isThrowExceptionOnWrite()
Specified by:
isThrowExceptionOnWrite in interface SyslogConfigIF

setThrowExceptionOnWrite

public void setThrowExceptionOnWrite(boolean throwExceptionOnWrite)
Specified by:
setThrowExceptionOnWrite in interface SyslogConfigIF

isThrowExceptionOnInitialize

public boolean isThrowExceptionOnInitialize()
Specified by:
isThrowExceptionOnInitialize in interface SyslogConfigIF

setThrowExceptionOnInitialize

public void setThrowExceptionOnInitialize(boolean throwExceptionOnInitialize)
Specified by:
setThrowExceptionOnInitialize in interface SyslogConfigIF

getSplitMessageBeginText

public byte[] getSplitMessageBeginText()
Specified by:
getSplitMessageBeginText in interface AbstractSyslogConfigIF

setSplitMessageBeginText

public void setSplitMessageBeginText(byte[] splitMessageBeginText)
Specified by:
setSplitMessageBeginText in interface AbstractSyslogConfigIF

setSplitMessageBeginText

public void setSplitMessageBeginText(java.lang.String splitMessageBeginText)
                              throws SyslogRuntimeException
Throws:
SyslogRuntimeException

getSplitMessageEndText

public byte[] getSplitMessageEndText()
Specified by:
getSplitMessageEndText in interface AbstractSyslogConfigIF

setSplitMessageEndText

public void setSplitMessageEndText(byte[] splitMessageEndText)
Specified by:
setSplitMessageEndText in interface AbstractSyslogConfigIF

setSplitMessageEndText

public void setSplitMessageEndText(java.lang.String splitMessageEndText)
                            throws SyslogRuntimeException
Throws:
SyslogRuntimeException

getMaxMessageLength

public int getMaxMessageLength()
Specified by:
getMaxMessageLength in interface SyslogConfigIF

setMaxMessageLength

public void setMaxMessageLength(int maxMessageLength)
Specified by:
setMaxMessageLength in interface SyslogConfigIF

isSendLocalTimestamp

public boolean isSendLocalTimestamp()
Specified by:
isSendLocalTimestamp in interface SyslogConfigIF

setSendLocalTimestamp

public void setSendLocalTimestamp(boolean sendLocalTimestamp)
Specified by:
setSendLocalTimestamp in interface SyslogConfigIF

isSendLocalName

public boolean isSendLocalName()
Specified by:
isSendLocalName in interface SyslogConfigIF

setSendLocalName

public void setSendLocalName(boolean sendLocalName)
Specified by:
setSendLocalName in interface SyslogConfigIF

getFacility

public int getFacility()
Specified by:
getFacility in interface SyslogConfigIF

setFacility

public void setFacility(int facility)
Specified by:
setFacility in interface SyslogConfigIF

setFacility

public void setFacility(java.lang.String facilityName)
Specified by:
setFacility in interface SyslogConfigIF

getIdent

public java.lang.String getIdent()
Specified by:
getIdent in interface SyslogConfigIF

setIdent

public void setIdent(java.lang.String ident)
Specified by:
setIdent in interface SyslogConfigIF

_getMessageModifiers

protected java.util.List _getMessageModifiers()

addMessageModifier

public void addMessageModifier(SyslogMessageModifierIF messageModifier)
Specified by:
addMessageModifier in interface SyslogConfigIF

insertMessageModifier

public void insertMessageModifier(int index,
                                  SyslogMessageModifierIF messageModifier)
Specified by:
insertMessageModifier in interface SyslogConfigIF

removeMessageModifier

public void removeMessageModifier(SyslogMessageModifierIF messageModifier)
Specified by:
removeMessageModifier in interface SyslogConfigIF

getMessageModifiers

public java.util.List getMessageModifiers()
Specified by:
getMessageModifiers in interface AbstractSyslogConfigIF

setMessageModifiers

public void setMessageModifiers(java.util.List messageModifiers)

removeAllMessageModifiers

public void removeAllMessageModifiers()
Specified by:
removeAllMessageModifiers in interface SyslogConfigIF

_getBackLogHandlers

protected java.util.List _getBackLogHandlers()

addBackLogHandler

public void addBackLogHandler(SyslogBackLogHandlerIF backLogHandler)
Specified by:
addBackLogHandler in interface SyslogConfigIF

insertBackLogHandler

public void insertBackLogHandler(int index,
                                 SyslogBackLogHandlerIF backLogHandler)
Specified by:
insertBackLogHandler in interface SyslogConfigIF

removeBackLogHandler

public void removeBackLogHandler(SyslogBackLogHandlerIF backLogHandler)
Specified by:
removeBackLogHandler in interface SyslogConfigIF

getBackLogHandlers

public java.util.List getBackLogHandlers()
Specified by:
getBackLogHandlers in interface AbstractSyslogConfigIF

setBackLogHandlers

public void setBackLogHandlers(java.util.List backLogHandlers)

removeAllBackLogHandlers

public void removeAllBackLogHandlers()
Specified by:
removeAllBackLogHandlers in interface SyslogConfigIF

isIncludeIdentInMessageModifier

public boolean isIncludeIdentInMessageModifier()
Specified by:
isIncludeIdentInMessageModifier in interface SyslogConfigIF

setIncludeIdentInMessageModifier

public void setIncludeIdentInMessageModifier(boolean includeIdentInMessageModifier)
Specified by:
setIncludeIdentInMessageModifier in interface SyslogConfigIF

isThreaded

public boolean isThreaded()
Specified by:
isThreaded in interface AbstractSyslogConfigIF

setThreaded

public void setThreaded(boolean threaded)
Specified by:
setThreaded in interface AbstractSyslogConfigIF

isUseDaemonThread

public boolean isUseDaemonThread()
Specified by:
isUseDaemonThread in interface AbstractSyslogConfigIF

setUseDaemonThread

public void setUseDaemonThread(boolean useDaemonThread)
Specified by:
setUseDaemonThread in interface AbstractSyslogConfigIF

getThreadPriority

public int getThreadPriority()
Specified by:
getThreadPriority in interface AbstractSyslogConfigIF

setThreadPriority

public void setThreadPriority(int threadPriority)
Specified by:
setThreadPriority in interface AbstractSyslogConfigIF

getThreadLoopInterval

public long getThreadLoopInterval()
Specified by:
getThreadLoopInterval in interface AbstractSyslogConfigIF

setThreadLoopInterval

public void setThreadLoopInterval(long threadLoopInterval)
Specified by:
setThreadLoopInterval in interface AbstractSyslogConfigIF

getMaxShutdownWait

public long getMaxShutdownWait()
Specified by:
getMaxShutdownWait in interface AbstractSyslogConfigIF

setMaxShutdownWait

public void setMaxShutdownWait(long maxShutdownWait)
Specified by:
setMaxShutdownWait in interface AbstractSyslogConfigIF

getWriteRetries

public int getWriteRetries()
Specified by:
getWriteRetries in interface AbstractSyslogConfigIF

setWriteRetries

public void setWriteRetries(int writeRetries)
Specified by:
setWriteRetries in interface AbstractSyslogConfigIF

isTruncateMessage

public boolean isTruncateMessage()
Specified by:
isTruncateMessage in interface SyslogConfigIF

setTruncateMessage

public void setTruncateMessage(boolean truncateMessage)
Specified by:
setTruncateMessage in interface SyslogConfigIF

isUseStructuredData

public boolean isUseStructuredData()
Specified by:
isUseStructuredData in interface SyslogConfigIF

setUseStructuredData

public void setUseStructuredData(boolean useStructuredData)
Specified by:
setUseStructuredData in interface SyslogConfigIF

getSyslogWriterClass

public java.lang.Class getSyslogWriterClass()
Specified by:
getSyslogWriterClass in interface AbstractSyslogConfigIF