public class GroupChatInvitation extends java.lang.Object implements PacketExtension
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.sendPacket(message);To listen for group chat invitations, use a PacketExtensionFilter for the x element name and jabber:x:conference namespace, as in the following code example:
PacketFilter filter = new PacketExtensionFilter("x", "jabber:x:conference"); // Create a packet collector or packet listeners using the filter...Note: this protocol is outdated now that the Multi-User Chat (MUC) JEP is available (JEP-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 java.lang.String |
ELEMENT_NAME
Element name of the packet extension.
|
static java.lang.String |
NAMESPACE
Namespace of the packet extension.
|
Constructor and Description |
---|
GroupChatInvitation(java.lang.String roomAddress)
Creates a new group chat invitation to the specified room address.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getElementName()
Returns the root element name.
|
java.lang.String |
getNamespace()
Returns the root element XML namespace.
|
java.lang.String |
getRoomAddress()
Returns the address of the group chat room.
|
java.lang.String |
toXML()
Returns the XML representation of the PacketExtension.
|
public static final java.lang.String ELEMENT_NAME
public static final java.lang.String NAMESPACE
public GroupChatInvitation(java.lang.String roomAddress)
roomAddress
- the address of the group chat room.public java.lang.String getRoomAddress()
public java.lang.String getElementName()
PacketExtension
getElementName
in interface PacketExtension
public java.lang.String getNamespace()
PacketExtension
getNamespace
in interface PacketExtension
public java.lang.String toXML()
PacketExtension
toXML
in interface PacketExtension