|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.smackx.packet.MessageEvent
public class MessageEvent
Represents message events relating to the delivery, display, composition and cancellation of messages.
There are four message events currently defined in this namespace:
Field Summary | |
---|---|
static String |
CANCELLED
|
static String |
COMPOSING
|
static String |
DELIVERED
|
static String |
DISPLAYED
|
static String |
OFFLINE
|
Constructor Summary | |
---|---|
MessageEvent()
|
Method Summary | |
---|---|
String |
getElementName()
Returns the XML element name of the extension sub-packet root element. |
Iterator |
getEventTypes()
Returns the types of events. |
String |
getNamespace()
Returns the XML namespace of the extension sub-packet root element. |
String |
getPacketID()
Returns the unique ID of the message that requested to be notified of the event. |
boolean |
isCancelled()
When the message is a notification returns if the receiver of the message cancelled composing a reply. |
boolean |
isComposing()
When the message is a request returns if the sender of the message requests to be notified when the receiver is composing a reply. |
boolean |
isDelivered()
When the message is a request returns if the sender of the message requests to be notified when the message is delivered. |
boolean |
isDisplayed()
When the message is a request returns if the sender of the message requests to be notified when the message is displayed. |
boolean |
isMessageEventRequest()
Returns true if this MessageEvent is a request for notifications. |
boolean |
isOffline()
When the message is a request returns if the sender of the message requests to be notified when the receiver of the message is offline. |
void |
setCancelled(boolean cancelled)
When the message is a notification sets if the receiver of the message cancelled composing a reply. |
void |
setComposing(boolean composing)
When the message is a request sets if the sender of the message requests to be notified when the receiver is composing a reply. |
void |
setDelivered(boolean delivered)
When the message is a request sets if the sender of the message requests to be notified when the message is delivered. |
void |
setDisplayed(boolean displayed)
When the message is a request sets if the sender of the message requests to be notified when the message is displayed. |
void |
setOffline(boolean offline)
When the message is a request sets if the sender of the message requests to be notified when the receiver of the message is offline. |
void |
setPacketID(String packetID)
Sets the unique ID of the message that requested to be notified of the event. |
String |
toXML()
Returns the XML representation of a Message Event according the specification. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String OFFLINE
public static final String COMPOSING
public static final String DISPLAYED
public static final String DELIVERED
public static final String CANCELLED
Constructor Detail |
---|
public MessageEvent()
Method Detail |
---|
public String getElementName()
getElementName
in interface PacketExtension
public String getNamespace()
getNamespace
in interface PacketExtension
public boolean isComposing()
public boolean isDelivered()
public boolean isDisplayed()
public boolean isOffline()
public boolean isCancelled()
public String getPacketID()
public Iterator getEventTypes()
public void setComposing(boolean composing)
composing
- sets if the sender is requesting to be notified when composing or when
notifying that the receiver of the message is composing a replypublic void setDelivered(boolean delivered)
delivered
- sets if the sender is requesting to be notified when delivered or when
notifying that the message was deliveredpublic void setDisplayed(boolean displayed)
displayed
- sets if the sender is requesting to be notified when displayed or when
notifying that the message was displayedpublic void setOffline(boolean offline)
offline
- sets if the sender is requesting to be notified when offline or when
notifying that the receiver of the message is offlinepublic void setCancelled(boolean cancelled)
cancelled
- sets if the receiver of the message cancelled composing a replypublic void setPacketID(String packetID)
packetID
- the message id that requested to be notified of the event.public boolean isMessageEventRequest()
public String toXML()
Request to be notified when displayed:
<message to='romeo@montague.net/orchard' from='juliet@capulet.com/balcony' id='message22'> <x xmlns='jabber:x:event'> <displayed/> </x> </message>Notification of displayed:
<message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <displayed/> <id>message22</id> </x> </message>
toXML
in interface PacketExtension
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |