public class GroupChatInvitation extends Object implements ExtensionElement
Message message = new Message("user@chat.example.com"); message.setBody("Join me for a group chat!"); message.addExtension(new GroupChatInvitation("room@chat.example.com");); con.sendStanza(message);To listen for group chat invitations, use a StanzaExtensionFilter for the x element name and jabber:x:conference namespace, as in the following code example:
PacketFilter filter = new StanzaExtensionFilter("x", "jabber:x:conference"); // Create a stanza collector or stanza listeners using the filter...Note: this protocol is outdated now that the Multi-User Chat (MUC) XEP is available (XEP-45). However, most existing clients still use this older protocol. Once MUC support becomes more widespread, this API may be deprecated.
Modifier and Type | Class and Description |
---|---|
static class |
GroupChatInvitation.Provider |
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT
Element name of the stanza extension.
|
static String |
NAMESPACE
Namespace of the stanza extension.
|
Constructor and Description |
---|
GroupChatInvitation(String roomAddress)
Creates a new group chat invitation to the specified room address.
|
Modifier and Type | Method and Description |
---|---|
static GroupChatInvitation |
from(Stanza packet)
Get the group chat invitation from the given stanza.
|
String |
getElementName()
Returns the root element name.
|
static GroupChatInvitation |
getFrom(Stanza packet)
Deprecated.
use
from(Stanza) instead |
String |
getNamespace()
Returns the root element XML namespace.
|
String |
getRoomAddress()
Returns the address of the group chat room.
|
XmlStringBuilder |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
public static final String ELEMENT
public static final String NAMESPACE
public GroupChatInvitation(String roomAddress)
roomAddress
- the address of the group chat room.public String getRoomAddress()
public String getElementName()
NamedElement
getElementName
in interface NamedElement
public String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement
public XmlStringBuilder toXML(String enclosingNamespace)
Element
@Deprecated public static GroupChatInvitation getFrom(Stanza packet)
from(Stanza)
insteadpacket
- public static GroupChatInvitation from(Stanza packet)
packet
-