public abstract class StanzaHandler extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
CHARSET
The utf-8 charset for decoding and encoding Jabber packet streams.
|
protected Connection |
connection |
protected LocalSession |
session
Session associated with the socket reader.
|
Constructor and Description |
---|
StanzaHandler(PacketRouter router,
Connection connection)
Creates a dedicated reader for a socket.
|
StanzaHandler(PacketRouter router,
String serverName,
Connection connection)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createSession(org.xmlpull.v1.XmlPullParser xpp)
Uses the XPP to grab the opening stream tag and create an active session
object.
|
org.xmpp.packet.JID |
getAddress()
Obtain the address of the XMPP entity for which this StanzaHandler
handles stanzas.
|
void |
process(String stanza,
org.dom4j.io.XMPPPacketReader reader) |
protected void |
processIQ(org.xmpp.packet.IQ packet)
Process the received IQ packet.
|
protected void |
processMessage(org.xmpp.packet.Message packet)
Process the received Message packet.
|
protected void |
processPresence(org.xmpp.packet.Presence packet)
Process the received Presence packet.
|
protected static String CHARSET
protected Connection connection
protected LocalSession session
public StanzaHandler(PacketRouter router, Connection connection)
router
- the router for sending packets that were read.connection
- the connection being read.@Deprecated public StanzaHandler(PacketRouter router, String serverName, Connection connection)
public void process(String stanza, org.dom4j.io.XMPPPacketReader reader) throws Exception
Exception
protected void processIQ(org.xmpp.packet.IQ packet) throws UnauthorizedException
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.
packet
- the received packet.UnauthorizedException
- if service is not available to sender.protected void processPresence(org.xmpp.packet.Presence packet) throws UnauthorizedException
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.
packet
- the received packet.UnauthorizedException
- if service is not available to sender.protected void processMessage(org.xmpp.packet.Message packet) throws UnauthorizedException
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.
packet
- the received packet.UnauthorizedException
- if service is not available to sender.protected void createSession(org.xmlpull.v1.XmlPullParser xpp) throws org.xmlpull.v1.XmlPullParserException, IOException
org.xmlpull.v1.XmlPullParserException
IOException
public org.xmpp.packet.JID getAddress()
Copyright © 2003-2008 Jive Software.