|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.jabber.JabberMessage
com.echomine.jabber.JabberJDOMMessage
com.echomine.jabber.AbstractJabberMessage
com.echomine.jabber.JabberIQMessage
com.echomine.jabber.msg.OOBIQMessage
public class OOBIQMessage
Submits and parses a Out-Of-Band (OOB) IQ message. The message will return the URL to download a file from. The OOB URL does not necessarily have to be http based. However, if it is not, then you may or may not be able to handle the protocol. That is up to you to either accept or reject the OOB request.
Current Implementation: JEP-0066 Version 1.0
Field Summary |
---|
Fields inherited from class com.echomine.jabber.JabberIQMessage |
---|
TYPE_GET, TYPE_RESULT, TYPE_SET |
Fields inherited from class com.echomine.jabber.AbstractJabberMessage |
---|
TYPE_ERROR |
Fields inherited from class com.echomine.jabber.JabberMessage |
---|
messageID |
Constructor Summary | |
---|---|
OOBIQMessage()
defaults to iq type set to initiate a request |
|
OOBIQMessage(java.lang.String type)
this constructor is for messages with type. |
Method Summary | |
---|---|
static OOBIQMessage |
createNotAcceptableErrorMessage(JID to,
java.lang.String msgId)
convenience method to create a OOBIQMessage that sends back a Not Acceptable Error Message to the originator of the OOBIQRequest. |
static OOBIQMessage |
createNotFoundErrorMessage(JID to,
java.lang.String msgId)
creates a request to notify the remote client that the resource at the URL was not found or cannot be retrieved. |
static OOBIQMessage |
createSendUrlMessage(JID to,
java.lang.String url,
java.lang.String desc)
creates a request to notify the remote client to download a file. |
static OOBIQMessage |
createSuccessMessage(JID to,
java.lang.String msgId)
Creates a success message to send to the remote user notifying that file has been successfully transferred |
java.lang.String |
encode()
The default encoding will serialize the DOM Tree. |
java.lang.String |
getDescription()
|
int |
getMessageType()
the default message type is unknown. |
java.lang.String |
getUrl()
|
JabberMessage |
parse(JabberMessageParser parser,
Element msgTree)
parses the message. |
void |
setDescription(java.lang.String description)
sets the description attached to the url |
void |
setUrl(java.lang.String url)
sets the URL for the file to be downloaded |
Methods inherited from class com.echomine.jabber.AbstractJabberMessage |
---|
getErrorMessage, getFrom, getTo, getType, isError, setErrorMessage, setFrom, setTo, setType |
Methods inherited from class com.echomine.jabber.JabberJDOMMessage |
---|
getDOM, getXMLOutputter, setMessageID, toString |
Methods inherited from class com.echomine.jabber.JabberMessage |
---|
getMessageID, getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, setReplyRequired, setSendXMessages, setSynchronized, setTimeout, setXMessage, setXMessages |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OOBIQMessage(java.lang.String type)
public OOBIQMessage()
Method Detail |
---|
public JabberMessage parse(JabberMessageParser parser, Element msgTree) throws ParseException
AbstractJabberMessage
parse
in interface JabberMessageParsable
parse
in class AbstractJabberMessage
ParseException
public java.lang.String getUrl()
public java.lang.String getDescription()
public void setUrl(java.lang.String url)
public void setDescription(java.lang.String description)
public int getMessageType()
JabberJDOMMessage
getMessageType
in class JabberIQMessage
JabberCode
public java.lang.String encode() throws ParseException
JabberJDOMMessage
encode
in class JabberJDOMMessage
ParseException
- if something went wrong during encodingpublic static OOBIQMessage createSuccessMessage(JID to, java.lang.String msgId)
to
- the recipient jid to send the message tomsgId
- the message ID of the original request messagepublic static OOBIQMessage createSendUrlMessage(JID to, java.lang.String url, java.lang.String desc)
to
- the recipient jid to send the message tourl
- the url of the file to be transferreddesc
- an optional description attached with the url. Null if none.public static OOBIQMessage createNotFoundErrorMessage(JID to, java.lang.String msgId)
to
- the recipient jid to send the message tomsgId
- the message id of the original requestpublic static OOBIQMessage createNotAcceptableErrorMessage(JID to, java.lang.String msgId)
to
- the recipient JID to receive this messagemsgId
- the message thread ID associated with the first OOB request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |