|
Openfire 3.5.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.net.StanzaHandler
public abstract class StanzaHandler
A StanzaHandler is the main responsible for handling incoming stanzas. Some stanzas like startTLS are totally managed by this class. The rest of the stanzas are just forwarded to the router.
Field Summary | |
---|---|
protected static String |
CHARSET
The utf-8 charset for decoding and encoding Jabber packet streams. |
protected Connection |
connection
|
protected String |
serverName
Server name for which we are attending clients. |
protected LocalSession |
session
Session associated with the socket reader. |
Constructor Summary | |
---|---|
StanzaHandler(PacketRouter router,
String serverName,
Connection connection)
Creates a dedicated reader for a socket. |
Method Summary | |
---|---|
protected void |
createSession(org.xmlpull.v1.XmlPullParser xpp)
Uses the XPP to grab the opening stream tag and create an active session object. |
void |
process(String stanza,
org.dom4j.io.XMPPPacketReader reader)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static String CHARSET
protected Connection connection
protected LocalSession session
protected String serverName
Constructor Detail |
---|
public StanzaHandler(PacketRouter router, String serverName, Connection connection)
router
- the router for sending packets that were read.serverName
- the name of the server this socket is working for.connection
- the connection being read.Method Detail |
---|
public void process(String stanza, org.dom4j.io.XMPPPacketReader reader) throws Exception
Exception
protected void processIQ(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(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(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
|
Openfire 3.5.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |