net.sf.ircappender
Class IrcAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by net.sf.ircappender.IrcAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class IrcAppender
extends org.apache.log4j.AppenderSkeleton

appends log-events to an irc channel.


Constructor Summary
IrcAppender()
           
 
Method Summary
 void activateOptions()
          Initializes the system after the options are set
 void close()
          Shuts down the appender.
 int getBuffersize()
          Returns the configured buffersize
 java.lang.String getBuffertype()
          gets the name of the buffer strategy
 java.lang.String getChannel()
          Returns the configured channel
 java.lang.String getHost()
          Returns the configured host
 long getMessageDelay()
          gets the delay between multiple messages
 java.lang.String getNickname()
          gets the IRC nickname of the bot
 java.lang.String getPassword()
          gets the IRC password
 int getPort()
          Returns the configured irc server port
 java.lang.String getUsername()
          gets the IRC username
 boolean isDebug()
          is debugging enabled
 boolean isSsl()
          Is SSL used to secure the connection to the IRC server?
 boolean requiresLayout()
          no layout required
 void setBuffersize(int buffersize)
          Sets the buffersize.
 void setBuffertype(java.lang.String buffertype)
          Sets the buffer strategy.
 void setChannel(java.lang.String channel)
          Sets the channel.
 void setDebug(boolean debug)
          enables or disables debugging messages
 void setHost(java.lang.String host)
          Sets the host.
 void setMessageDelay(long messageDelay)
          Set the delay between messages.
 void setNickname(java.lang.String nickname)
          Sets the nickname.
 void setPassword(java.lang.String password)
          Sets the password.
 void setPort(int port)
          Sets the irc server port
 void setSsl(boolean ssl)
          Enables or disables the use of SSL for the IRC connection
 void setUsername(java.lang.String username)
          Sets the username.
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IrcAppender

public IrcAppender()
Method Detail

activateOptions

public void activateOptions()
Initializes the system after the options are set

Specified by:
activateOptions in interface org.apache.log4j.spi.OptionHandler
Overrides:
activateOptions in class org.apache.log4j.AppenderSkeleton
See Also:
OptionHandler.activateOptions()

close

public void close()
Shuts down the appender. Handles telling the bot to close and waiting for the bot to cleanly close its thread before continuing.

See Also:
Appender.close()

getBuffersize

public int getBuffersize()
Returns the configured buffersize

Returns:
double

getBuffertype

public java.lang.String getBuffertype()
gets the name of the buffer strategy

Returns:
String

getChannel

public java.lang.String getChannel()
Returns the configured channel

Returns:
String

getHost

public java.lang.String getHost()
Returns the configured host

Returns:
String

getMessageDelay

public long getMessageDelay()
gets the delay between multiple messages

Returns:
long delay in milliseconds

getNickname

public java.lang.String getNickname()
gets the IRC nickname of the bot

Returns:
nickname

getPassword

public java.lang.String getPassword()
gets the IRC password

Returns:
password

getPort

public int getPort()
Returns the configured irc server port

Returns:
int

getUsername

public java.lang.String getUsername()
gets the IRC username

Returns:
username

isDebug

public boolean isDebug()
is debugging enabled

Returns:
true, if debugging is enabled, false otherwise

isSsl

public boolean isSsl()
Is SSL used to secure the connection to the IRC server?

Returns:
ssl ussage

requiresLayout

public boolean requiresLayout()
no layout required


setBuffersize

public void setBuffersize(int buffersize)
Sets the buffersize.

Parameters:
buffersize - The buffersize to set

setBuffertype

public void setBuffertype(java.lang.String buffertype)
Sets the buffer strategy.

Parameters:
buffertype - The buffertype to set

setChannel

public void setChannel(java.lang.String channel)
Sets the channel.

Parameters:
channel - The channel to set

setDebug

public void setDebug(boolean debug)
enables or disables debugging messages

Parameters:
debug - should debug message be written to stdout?

setHost

public void setHost(java.lang.String host)
Sets the host.

Parameters:
host - The host to set

setMessageDelay

public void setMessageDelay(long messageDelay)
Set the delay between messages. Note that some IRC servers have a rate limit which may be stricter.

Parameters:
messageDelay - in milliseconds

setNickname

public void setNickname(java.lang.String nickname)
Sets the nickname.

Parameters:
nickname - The nickname to set

setPassword

public void setPassword(java.lang.String password)
Sets the password.

Parameters:
password - The password to set

setPort

public void setPort(int port)
Sets the irc server port

Parameters:
port - port

setSsl

public void setSsl(boolean ssl)
Enables or disables the use of SSL for the IRC connection

Parameters:
ssl - true to enable SSL security

setUsername

public void setUsername(java.lang.String username)
Sets the username.

Parameters:
username - The username to set