|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.realtime.xmpp.dom.DomPacketRouter
Interprets incoming packets and issues callbacks for particular packet types.
Field Summary | |
protected DomComponent |
m_component
The Jabber component we are routing packets for. |
Constructor Summary | |
DomPacketRouter(DomComponent component)
Create a router to serve one component. |
Method Summary | |
void |
doHandshake(org.dom4j.Element packet)
Accept incoming handshake packets. |
void |
doInfoQuery(org.dom4j.Element packet)
Process an incoming IQ packet. |
void |
doIqRegister(org.dom4j.Element packet,
org.dom4j.Element query)
Process a register query. |
void |
doIqRegisterSet(org.dom4j.Element packet,
org.dom4j.Element query)
Process a register 'set' query. |
void |
doIqTime(org.dom4j.Element packet,
org.dom4j.Element child)
Process a time query. |
void |
doIqVersion(org.dom4j.Element packet,
org.dom4j.Element queryIn)
Process a version query. |
void |
doMessage(org.dom4j.Element packet)
Handle a message packet. |
void |
doPresence(org.dom4j.Element packet)
Handle a presence packet. |
DomComponent |
getComponent()
Provide the component we are serving. |
java.lang.String |
getGatewayName()
Provide the name of this gateway for building an iq:version response. |
java.lang.String |
getGatewayOperatingSystem()
Provide the operating system of this gateway for building an iq:version response. |
java.lang.String |
getGatewayVersion()
Provide the version of this gateway for building an iq:version response. |
Presence |
getPresence()
Provide our presence information. |
java.lang.String[] |
getRegistrationFields()
Provide the required registration fields. |
java.lang.String |
getRegistrationInstructions()
Provide instructions for filling out the registration form. |
void |
incomingPacket(org.dom4j.Element packet)
Crack open the incoming packet and route to the appropriate handler. |
protected boolean |
send(XmppStanza packet)
Send a response packet and consume any errors. |
protected void |
sendError(org.dom4j.Element packet,
int nError,
java.lang.String sReason)
Send an error in response to the given packet. |
void |
unhandledIncomingPacket(org.dom4j.Element packet,
java.lang.String sReason)
Signal we couldn't handle the incoming packet because we haven't implemented a handler for the request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DomComponent m_component
Constructor Detail |
public DomPacketRouter(DomComponent component)
Create a router to serve one component.
component
- The jabber component to route packets for.Method Detail |
public DomComponent getComponent()
Provide the component we are serving.
public void incomingPacket(org.dom4j.Element packet)
Crack open the incoming packet and route to the appropriate handler. Supports iq, message, and presence packets.
incomingPacket
in interface DomPacketListener
packet
- The XMPP packet as a DOM element.public void unhandledIncomingPacket(org.dom4j.Element packet, java.lang.String sReason)
Signal we couldn't handle the incoming packet because we haven't implemented a handler for the request.
packet
- The packet that could not be routed.sReason
- The reason the packet was not routed.protected void sendError(org.dom4j.Element packet, int nError, java.lang.String sReason)
Send an error in response to the given packet.
packet
- The packet to send an error in response to.nError
- The error code.sReason
- An optional message giving the reason the packet failed.protected boolean send(XmppStanza packet)
Send a response packet and consume any errors.
* @param packet The packet to send.
public void doHandshake(org.dom4j.Element packet)
Accept incoming handshake packets. These are usually responses to accept components sending a handshake, and as such should be ignored.
packet
- Handshake packet.public void doInfoQuery(org.dom4j.Element packet)
Process an incoming IQ packet.
packet
- The incoming packet to process.public void doIqRegister(org.dom4j.Element packet, org.dom4j.Element query)
Process a register query.
packet
- The root packet.query
- The packets query child element.public void doIqRegisterSet(org.dom4j.Element packet, org.dom4j.Element query)
Process a register 'set' query.
packet
- The root packet.query
- The packets query child element.public java.lang.String[] getRegistrationFields()
Provide the required registration fields.
public java.lang.String getRegistrationInstructions()
Provide instructions for filling out the registration form.
public void doIqVersion(org.dom4j.Element packet, org.dom4j.Element queryIn)
Process a version query.
packet
- The root packet.queryIn
- The packets query child element.public java.lang.String getGatewayName()
Provide the name of this gateway for building an iq:version response.
public java.lang.String getGatewayVersion()
Provide the version of this gateway for building an iq:version response.
public java.lang.String getGatewayOperatingSystem()
Provide the operating system of this gateway for building an iq:version response.
public void doIqTime(org.dom4j.Element packet, org.dom4j.Element child)
Process a time query. Being nice, we provide an implementation :)
packet
- The root packet.child
- The packets query child element.public void doMessage(org.dom4j.Element packet)
Handle a message packet.
packet
- A message packet.public void doPresence(org.dom4j.Element packet)
Handle a presence packet.
packet
- A presence packet.public Presence getPresence()
Provide our presence information.
* @return Our presence info.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |