|
||||||||||
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.JabberPresenceMessage
public class JabberPresenceMessage
This parses the presence message and makes it easy to retrieve the information. The Presence Message support X Namespaces and by default will add those X Namespaces into outgoing messages.
This is how presence works. You declare yourself to be available, then you can set your state to away, extended away, do not disturb, etc. If you set yourself unavailable, then no one will see you online (essentially, you are "invisible"). If you set your state to one of the mentioned states, then you can set a descriptive text by setting the status.
The type indicates what kind of presence this is, either to be available or unavailable, or if it's a subscription request.
The to and from are used to indicate where the presence is going to or where it's coming from, respectively. These two fields are not always available, depending on what the type is.
The show tells others about you current state, whether you are away, extended away, etc.
The status is the descriptive text that tells others what you're doing. You may put anything for status when you set yourself to away/extended away/do not disturb.
The priority is used when you have multiple logins. The "default" is the highest priority and will receive the private messages. Negative priority is a preference that the sender should not be used for direct or immediate contact.
Current Implementation: JEP-0018 Version 0.1
Conforms with: XMPP Presence protocol
Field Summary |
---|
Fields inherited from class com.echomine.jabber.AbstractJabberMessage |
---|
TYPE_ERROR |
Fields inherited from class com.echomine.jabber.JabberMessage |
---|
messageID |
Fields inherited from interface com.echomine.jabber.PresenceCode |
---|
SHOW_AWAY, SHOW_CHAT, SHOW_DO_NOT_DISTURB, SHOW_EXTENDED_AWAY, SHOW_ONLINE, TYPE_AVAILABLE, TYPE_INVISIBLE, TYPE_PROBE, TYPE_SUBSCRIBE, TYPE_SUBSCRIBED, TYPE_UNAVAILABLE, TYPE_UNSUBSCRIBE, TYPE_UNSUBSCRIBED |
Constructor Summary | |
---|---|
JabberPresenceMessage()
constructs a default type of AVAILABLE |
|
JabberPresenceMessage(java.lang.String type)
Normally used for creating an outgoing message |
Method Summary | |
---|---|
DelayXMessage |
getDelayMessage()
convenience method to retrieve the Delay X Message (you can get the message by calling getXMessage() as well) |
int |
getMessageType()
the default message type is unknown. |
PGPSignedXMessage |
getPGPSignedMessage()
Convenience method to retrieve the signature of the presence message signed in PGP. |
int |
getPriority()
|
java.lang.String |
getShowState()
Retrieve the show string that is included with the presence message. |
java.lang.String |
getStatus()
|
JabberMessage |
parse(JabberMessageParser parser,
Element msgTree)
parses the message. |
void |
setPriority(int priority)
The "default" is the highest priority and will receive the private messages. |
void |
setShowState(java.lang.String showState)
sets the string for show state. |
void |
setStatus(java.lang.String status)
sets the status string when available. |
void |
setType(java.lang.String type)
The method is overridden to conform properly with XMPP protocol standards. |
Methods inherited from class com.echomine.jabber.AbstractJabberMessage |
---|
getErrorMessage, getFrom, getTo, getType, isError, setErrorMessage, setFrom, setTo |
Methods inherited from class com.echomine.jabber.JabberJDOMMessage |
---|
encode, 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 JabberPresenceMessage(java.lang.String type)
public JabberPresenceMessage()
Method Detail |
---|
public JabberMessage parse(JabberMessageParser parser, Element msgTree) throws ParseException
AbstractJabberMessage
parse
in interface JabberMessageParsable
parse
in class AbstractJabberMessage
ParseException
public void setType(java.lang.String type)
setType
in class AbstractJabberMessage
type
- the type of presence (available, unavailable, dnd, etc)public void setStatus(java.lang.String status)
public java.lang.String getStatus()
public java.lang.String getShowState()
public void setShowState(java.lang.String showState)
public int getPriority()
public void setPriority(int priority)
public int getMessageType()
JabberJDOMMessage
getMessageType
in class JabberJDOMMessage
JabberCode
public DelayXMessage getDelayMessage()
public PGPSignedXMessage getPGPSignedMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |