|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.realtime.xmpp.dom.DomPacketFactory
Helper class to manufacture XMPP packets. Use the DomPacketTools to further modify the packets.
Constructor Summary | |
DomPacketFactory()
|
Method Summary | |
static XmppWrapper |
createErrorResponse(org.dom4j.Element packet,
int nError,
java.lang.String sMessage)
Create an error response from an incoming packet. |
static XmppWrapper |
createInfoQueryRequest(java.lang.String sFrom,
java.lang.String sTo,
java.lang.String sType,
org.dom4j.Element query)
Create an infoquery (iq) packet. |
static XmppWrapper |
createMessage(java.lang.String sFrom,
java.lang.String sTo,
java.lang.String sSubject,
java.lang.String sBody)
Create a simple message. |
static XmppWrapper |
createPresencePacket(java.lang.String sFrom,
java.lang.String sTo,
Presence presence)
Create a presence packet. |
static XmppWrapper |
createPresenceProbe(java.lang.String sFrom,
java.lang.String sTo)
Create a presence probe. |
static XmppQuery |
createPresenceRequest(java.lang.String sFrom,
java.lang.String sTo,
java.lang.String sType)
Create a presence request. |
static XmppStanza |
createPresenceStatus(java.lang.String sFrom,
java.lang.String sTo,
java.lang.String sStatus)
Create a presence status packet. |
static XmppQuery |
createRegistrationRequirementsResponse(org.dom4j.Element request,
java.lang.String sInstructions,
java.lang.String[] sRequiredFields)
Create a user registration query packet response. |
static XmppWrapper |
createRoutePacket(java.lang.String sFrom,
java.lang.String sTo)
Create a route packet. |
static XmppWrapper |
createXdbGetRequest(java.lang.String sFrom,
java.lang.String sTo,
java.lang.String sNamespace)
Create an XDB get request. |
static XmppWrapper |
createXdbSetRequest(java.lang.String sFrom,
java.lang.String sTo,
org.dom4j.Element root)
Create an XDB set request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DomPacketFactory()
Method Detail |
public static XmppWrapper createMessage(java.lang.String sFrom, java.lang.String sTo, java.lang.String sSubject, java.lang.String sBody)
Create a simple message.
* @param sFrom The sender. * @param sTo The recipient. * @param sSubject An optional subject, may be null. * @param sBody The text of the message. * @return The message.
public static XmppWrapper createErrorResponse(org.dom4j.Element packet, int nError, java.lang.String sMessage)
Create an error response from an incoming packet.
* @param packet The incoming packet we are responding to. * @param nError The error code to issue. * @param sMessage A detailed message about the error. This may be null. * @return The response packet.
public static XmppWrapper createPresenceProbe(java.lang.String sFrom, java.lang.String sTo)
Create a presence probe.
sFrom
- The sending node.sTo
- The node we are requesting presence info from.
public static XmppWrapper createPresencePacket(java.lang.String sFrom, java.lang.String sTo, Presence presence)
Create a presence packet. This is usually in responce to a probe, but does not use the id field.
sFrom
- The sending node.sTo
- The node we are sending presence info to.presence
- Our presence.
public static XmppWrapper createXdbGetRequest(java.lang.String sFrom, java.lang.String sTo, java.lang.String sNamespace)
Create an XDB get request.
sFrom
- The node sending the request.sTo
- The name of the database entry to access, in the form
user@server.sNamespace
- The namespace to retrieve data from, or send data to.
* @return An XmppWrapper. Use getRoot() to access the root element in order
to add child elements.public static XmppWrapper createXdbSetRequest(java.lang.String sFrom, java.lang.String sTo, org.dom4j.Element root)
Create an XDB set request.
sFrom
- The node sending the request.sTo
- The name of the database entry to access, in the form
user@server.root
- The root element of the graph we are placing in the database.
public static XmppWrapper createInfoQueryRequest(java.lang.String sFrom, java.lang.String sTo, java.lang.String sType, org.dom4j.Element query)
Create an infoquery (iq) packet.
* @param sFrom The entity sending this packet. * @param sTo The destination. * @param sType The type, as in get, set, result, or error. * @param query The child query element. * @return An XMPP request.
public static XmppWrapper createRoutePacket(java.lang.String sFrom, java.lang.String sTo)
Create a route packet.
sFrom
- The entity sending this packet.sTo
- The destination.
public static XmppQuery createRegistrationRequirementsResponse(org.dom4j.Element request, java.lang.String sInstructions, java.lang.String[] sRequiredFields)
Create a user registration query packet response. This packet describes which fields are required to register.
sInstructions
- The instructions to provide the user.sRequiredFields
- An array of required field names.
public static final XmppQuery createPresenceRequest(java.lang.String sFrom, java.lang.String sTo, java.lang.String sType)
Create a presence request.
* @param sFrom The node sending the request.
sTo
- The recipient as a JID.
* @param sType The type of the request, usually one of subscribe, unsubscribe,
subscribed, or unsubscribed.
* @return The packet.public static final XmppStanza createPresenceStatus(java.lang.String sFrom, java.lang.String sTo, java.lang.String sStatus)
Create a presence status packet. This is usually sent from a gateway to a client after successful regsitration.
sFrom
- The node sending the request.sTo
- The recipient.sStatus
- The status message.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |