Class GroupChatInvitation
- java.lang.Object
-
- org.jivesoftware.smackx.muc.packet.GroupChatInvitation
-
- All Implemented Interfaces:
Element
,ExtensionElement
,NamedElement
,XmlElement
,XmlLangElement
public class GroupChatInvitation extends Object implements ExtensionElement
A group chat invitation stanza extension, which is used to invite other users to a group chat room. This implementation now conforms to XEP-0249: Direct MUC Invitations, while staying backwards compatible to legacy MUC invitations.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_CONTINUE
static String
ATTR_JID
static String
ATTR_PASSWORD
static String
ATTR_REASON
static String
ATTR_THREAD
static String
ELEMENT
Element name of the stanza extension.static String
NAMESPACE
Namespace of the stanza extension.static QName
QNAME
-
Constructor Summary
Constructors Constructor Description GroupChatInvitation(EntityBareJid roomAddress)
Creates a new group chat invitation to the specified room address.GroupChatInvitation(EntityBareJid roomAddress, String reason, String password, boolean continueAsOneToOneChat, String thread)
Creates a new group chat invitation to the specified room address.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
continueAsOneToOneChat()
Returns whether the groupchat room continues a one-to-one chat.boolean
equals(Object obj)
static GroupChatInvitation
from(Stanza packet)
Get the group chat invitation from the given stanza.String
getElementName()
Returns the root element name.String
getNamespace()
Returns the root element XML namespace.String
getPassword()
Returns the password needed for entry.String
getReason()
Returns the purpose for the invitation.EntityBareJid
getRoomAddress()
Returns the address of the group chat room.String
getThread()
Returns the thread to continue.int
hashCode()
XmlStringBuilder
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final String ELEMENT
Element name of the stanza extension.- See Also:
- Constant Field Values
-
NAMESPACE
public static final String NAMESPACE
Namespace of the stanza extension.- See Also:
- Constant Field Values
-
ATTR_CONTINUE
public static final String ATTR_CONTINUE
- See Also:
- Constant Field Values
-
ATTR_JID
public static final String ATTR_JID
- See Also:
- Constant Field Values
-
ATTR_PASSWORD
public static final String ATTR_PASSWORD
- See Also:
- Constant Field Values
-
ATTR_REASON
public static final String ATTR_REASON
- See Also:
- Constant Field Values
-
ATTR_THREAD
public static final String ATTR_THREAD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GroupChatInvitation
public GroupChatInvitation(EntityBareJid roomAddress)
Creates a new group chat invitation to the specified room address. GroupChat room addresses are in the formroom@service
, whereservice
is the name of group chat server, such aschat.example.com
.- Parameters:
roomAddress
- the address of the group chat room.
-
GroupChatInvitation
public GroupChatInvitation(EntityBareJid roomAddress, String reason, String password, boolean continueAsOneToOneChat, String thread)
Creates a new group chat invitation to the specified room address. GroupChat room addresses are in the formroom@service
, whereservice
is the name of group chat server, such aschat.example.com
.- Parameters:
roomAddress
- the address of the group chat room.reason
- the purpose for the invitationpassword
- specifies a password needed for entrycontinueAsOneToOneChat
- specifies if the groupchat room continues a one-to-one chat having the designated threadthread
- the thread to continue
-
-
Method Detail
-
getReason
public String getReason()
Returns the purpose for the invitation.- Returns:
- the address of the group chat room.
-
getPassword
public String getPassword()
Returns the password needed for entry.- Returns:
- the password needed for entry
-
getThread
public String getThread()
Returns the thread to continue.- Returns:
- the thread to continue.
-
continueAsOneToOneChat
public boolean continueAsOneToOneChat()
Returns whether the groupchat room continues a one-to-one chat.- Returns:
- whether the groupchat room continues a one-to-one chat.
-
getRoomAddress
public EntityBareJid getRoomAddress()
Returns the address of the group chat room. GroupChat room addresses are in the formroom@service
, whereservice
is the name of group chat server, such aschat.example.com
.- Returns:
- the address of the group chat room.
-
getElementName
public String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
from
public static GroupChatInvitation from(Stanza packet)
Get the group chat invitation from the given stanza.- Parameters:
packet
- TODO javadoc me please- Returns:
- the GroupChatInvitation or null
-
-