Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger.net
Class ClientSocketReader

java.lang.Object
  extended by org.jivesoftware.messenger.net.SocketReader
      extended by org.jivesoftware.messenger.net.ClientSocketReader
All Implemented Interfaces:
Runnable

public class ClientSocketReader
extends SocketReader

A SocketReader specialized for client connections. This reader will be used when the open stream contains a jabber:client namespace. Received packet will have their FROM attribute overriden to avoid spoofing.

Author:
Gaston Dombiak

Field Summary
 
Fields inherited from class org.jivesoftware.messenger.net.SocketReader
connection, open, serverName, session
 
Constructor Summary
ClientSocketReader(PacketRouter router, String serverName, Socket socket, SocketConnection connection)
           
 
Method Summary
protected  void processIQ(IQ packet)
          Process the received IQ packet.
protected  void processMessage(Message packet)
          Process the received Message packet.
protected  void processPresence(Presence packet)
          Process the received Presence packet.
protected  boolean processUnknowPacket(org.dom4j.Element doc)
          Only packets of type Message, Presence and IQ can be processed by this class.
 
Methods inherited from class org.jivesoftware.messenger.net.SocketReader
run, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSocketReader

public ClientSocketReader(PacketRouter router,
                          String serverName,
                          Socket socket,
                          SocketConnection connection)
Method Detail

processIQ

protected void processIQ(IQ packet)
                  throws UnauthorizedException
Description copied from class: SocketReader
Process the received IQ packet. Registered PacketInterceptor will be invoked before and after the packet was routed.

Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.

Overrides:
processIQ in class SocketReader
Parameters:
packet - the received packet.
Throws:
UnauthorizedException

processPresence

protected void processPresence(Presence packet)
                        throws UnauthorizedException
Description copied from class: SocketReader
Process the received Presence packet. Registered PacketInterceptor will be invoked before and after the packet was routed.

Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.

Overrides:
processPresence in class SocketReader
Parameters:
packet - the received packet.
Throws:
UnauthorizedException

processMessage

protected void processMessage(Message packet)
                       throws UnauthorizedException
Description copied from class: SocketReader
Process the received Message packet. Registered PacketInterceptor will be invoked before and after the packet was routed.

Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.

Overrides:
processMessage in class SocketReader
Parameters:
packet - the received packet.
Throws:
UnauthorizedException

processUnknowPacket

protected boolean processUnknowPacket(org.dom4j.Element doc)
Only packets of type Message, Presence and IQ can be processed by this class. Any other type of packet is unknown and thus rejected generating the connection to be closed.

Parameters:
doc - the unknown DOM element that was received
Returns:
always false.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.