jerklib
Class DefaultInternalEventHandler

java.lang.Object
  extended by jerklib.DefaultInternalEventHandler
All Implemented Interfaces:
IRCEventListener

public class DefaultInternalEventHandler
extends Object
implements IRCEventListener

Class that will only handle events that effect internal states/caches. Like channel nick lists. All events will be added to the ConnectionManager for relaying. You can change the internal behavior of Jerklib by overriding methods in this class or by adding/removing event handlers.

Author:
mohadib
See Also:
IRCEventListener

Constructor Summary
DefaultInternalEventHandler(ConnectionManager manager)
          Creates a new DefaultInternalEventHandler associated with the given ConnectionManager
 
Method Summary
 void addEventHandler(IRCEvent.Type type, IRCEventListener listener)
          Adds an IRCEventListener to handle a given event Type.
 void connectionComplete(IRCEvent e)
          Called when ConnectionComplete event is received.
 IRCEventListener getEventHandler(IRCEvent.Type type)
          Returns the event handler registerd to the Type given.
 void join(IRCEvent e)
          Called when a JoinEvent is received.
 void joinComplete(IRCEvent e)
          Called when a JoinCompleteEvent is received
 void kick(IRCEvent e)
          Called when a KickEvent is received
 void mode(IRCEvent event)
          Called when a ModeEvent is received
 void nick(IRCEvent e)
          Called when a NickChangeEvent is received
 void nickInUse(IRCEvent e)
          Called when a NickInUseEvent is received
 void part(IRCEvent e)
          Called when a PartEvent is received.
 void quit(IRCEvent e)
          Called when a QuitEvent is received.
 void receiveEvent(IRCEvent event)
          recieveEvent() - receive IRCEvents
 boolean removeEventHandler(IRCEvent.Type type)
          Removes any internal IRCEventListeners registered to handle the Type passed in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInternalEventHandler

public DefaultInternalEventHandler(ConnectionManager manager)
Creates a new DefaultInternalEventHandler associated with the given ConnectionManager

Parameters:
manager -
Method Detail

addEventHandler

public void addEventHandler(IRCEvent.Type type,
                            IRCEventListener listener)
Adds an IRCEventListener to handle a given event Type. This should only be used if you want to effect the internal behavior of Jerklib.

Parameters:
type -
listener -

removeEventHandler

public boolean removeEventHandler(IRCEvent.Type type)
Removes any internal IRCEventListeners registered to handle the Type passed in. This effects the internal behavior of Jerklib.

Parameters:
type -
Returns:
true if a listener was removed , else false.

getEventHandler

public IRCEventListener getEventHandler(IRCEvent.Type type)
Returns the event handler registerd to the Type given.

Parameters:
type -
Returns:
The handler or null if no handler for Type

receiveEvent

public void receiveEvent(IRCEvent event)
Description copied from interface: IRCEventListener
recieveEvent() - receive IRCEvents

Specified by:
receiveEvent in interface IRCEventListener
Parameters:
event - IRCEvent the event

joinComplete

public void joinComplete(IRCEvent e)
Called when a JoinCompleteEvent is received

Parameters:
e - the event

join

public void join(IRCEvent e)
Called when a JoinEvent is received.

Parameters:
e - the event

quit

public void quit(IRCEvent e)
Called when a QuitEvent is received.

Parameters:
e - the event

part

public void part(IRCEvent e)
Called when a PartEvent is received.

Parameters:
e - the event

nick

public void nick(IRCEvent e)
Called when a NickChangeEvent is received

Parameters:
e - the event

nickInUse

public void nickInUse(IRCEvent e)
Called when a NickInUseEvent is received

Parameters:
e - the event

kick

public void kick(IRCEvent e)
Called when a KickEvent is received

Parameters:
e - the event

connectionComplete

public void connectionComplete(IRCEvent e)
Called when ConnectionComplete event is received.

Parameters:
e - the event

mode

public void mode(IRCEvent event)
Called when a ModeEvent is received

Parameters:
event -