|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smack.packet.Packet org.jivesoftware.smack.packet.Message
public class Message
Represents XMPP message packets. A message can be one of several types:
Message type | |||||
Field | Normal | Chat | Group Chat | Headline | XMPPError |
subject | SHOULD | SHOULD NOT | SHOULD NOT | SHOULD NOT | SHOULD NOT |
thread | OPTIONAL | SHOULD | OPTIONAL | OPTIONAL | SHOULD NOT |
body | SHOULD | SHOULD | SHOULD | SHOULD | SHOULD NOT |
error | MUST NOT | MUST NOT | MUST NOT | MUST NOT | MUST |
Nested Class Summary | |
---|---|
static class |
Message.Type
Represents the type of a message. |
Field Summary |
---|
Fields inherited from class org.jivesoftware.smack.packet.Packet |
---|
ID_NOT_AVAILABLE |
Constructor Summary | |
---|---|
Message()
Creates a new, "normal" message. |
|
Message(String to)
Creates a new "normal" message to the specified recipient. |
|
Message(String to,
Message.Type type)
Creates a new message of the specified type to a recipient. |
Method Summary | |
---|---|
String |
getBody()
Returns the body of the message, or null if the body has not been set. |
String |
getSubject()
Returns the subject of the message, or null if the subject has not been set. |
String |
getThread()
Returns the thread id of the message, which is a unique identifier for a sequence of "chat" messages. |
Message.Type |
getType()
Returns the type of the message. |
void |
setBody(String body)
Sets the body of the message. |
void |
setSubject(String subject)
Sets the subject of the message. |
void |
setThread(String thread)
Sets the thread id of the message, which is a unique identifier for a sequence of "chat" messages. |
void |
setType(Message.Type type)
Sets the type of the message. |
String |
toXML()
Returns the packet as XML. |
Methods inherited from class org.jivesoftware.smack.packet.Packet |
---|
addExtension, deleteProperty, getError, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, removeExtension, setError, setFrom, setPacketID, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Message()
public Message(String to)
to
- the recipient of the message.public Message(String to, Message.Type type)
to
- the user to send the message to.type
- the message type.Method Detail |
---|
public Message.Type getType()
public void setType(Message.Type type)
type
- the type of the message.public String getSubject()
public void setSubject(String subject)
subject
- the subject of the message.public String getBody()
public void setBody(String body)
body
- public String getThread()
public void setThread(String thread)
thread
- the thread id of the message.public String toXML()
Packet
toXML
in class Packet
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |