com.zerjio.JIRC
Class SimplePINGListener

java.lang.Object
  extended bycom.zerjio.JIRC.SimplePINGListener
All Implemented Interfaces:
PINGListener

public class SimplePINGListener
extends java.lang.Object
implements PINGListener

A basic PINGListener that replies with a PONG message every time it receives a PINGMessage.


Constructor Summary
SimplePINGListener(IRCClient client)
          Constructs a SimplePINGListener.
SimplePINGListener(IRCClient client, boolean removePINGMessages)
          Constructs a SimplePINGListener.
 
Method Summary
 void PINGReceived(PINGMessage msg)
          Handles a PINGMessage by sending a PONG message with the same parameters as the PINGMessage has.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePINGListener

public SimplePINGListener(IRCClient client,
                          boolean removePINGMessages)
Constructs a SimplePINGListener.

Parameters:
client - The IRCClient that will be used to send the PONG replies.
removePINGMessages - Marks if the PINGMessages should be removed (not processed by more listeners.

SimplePINGListener

public SimplePINGListener(IRCClient client)
Constructs a SimplePINGListener. The PINGMessages will not be removed (and then can be processed by other listeners).

Parameters:
client - The IRCClient that will be used to send the PONG replies.
Method Detail

PINGReceived

public void PINGReceived(PINGMessage msg)
Handles a PINGMessage by sending a PONG message with the same parameters as the PINGMessage has. It marks the message as used and sets it to beDiscarded if neceessary.

Specified by:
PINGReceived in interface PINGListener
Parameters:
msg - The PINGMessage that has been received.
See Also:
markAsUsed, mustBeDiscarded