Class MUCUser
- java.lang.Object
-
- org.jivesoftware.smackx.muc.packet.MUCUser
-
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.FullyQualifiedElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlLangElement
public class MUCUser extends java.lang.Object implements org.jivesoftware.smack.packet.ExtensionElementRepresents extended presence information about roles, affiliations, full JIDs, or status codes scoped by the 'http://jabber.org/protocol/muc#user' namespace.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMUCUser.DeclineRepresents a rejection to an invitation from another user to a room.static classMUCUser.InviteRepresents an invitation for another user to a room.static classMUCUser.StatusStatus code assists in presenting notification messages.
-
Constructor Summary
Constructors Constructor Description MUCUser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddStatusCode(MUCUser.Status status)Add a status code which hold a code that assists in presenting notification messages.voidaddStatusCodes(java.util.Set<MUCUser.Status> statusCodes)Add the status codes which holds the codes that assists in presenting notification messages.static MUCUserfrom(org.jivesoftware.smack.packet.Stanza packet)Retrieve the MUCUser PacketExtension from packet, if any.MUCUser.DeclinegetDecline()Returns the rejection to an invitation from another user to a room.DestroygetDestroy()Returns the notification that the room has been destroyed.java.lang.StringgetElementName()static MUCUsergetFrom(org.jivesoftware.smack.packet.Stanza packet)Deprecated.usefrom(Stanza)insteadMUCUser.InvitegetInvite()Returns the invitation for another user to a room.MUCItemgetItem()Returns the item child that holds information about roles, affiliation, jids and nicks.java.lang.StringgetNamespace()java.lang.StringgetPassword()Returns the password to use to enter Password-Protected Room.java.util.Set<MUCUser.Status>getStatus()Returns a set of status which holds the status code that assist in presenting notification messages.booleanhasStatus()Returns true if this MUCUser instance has alsoMUCUser.Statusinformation.voidsetDecline(MUCUser.Decline decline)Sets the rejection to an invitation from another user to a room.voidsetDestroy(Destroy destroy)Sets the notification that the room has been destroyed.voidsetInvite(MUCUser.Invite invite)Sets the invitation for another user to a room.voidsetItem(MUCItem item)Sets the item child that holds information about roles, affiliation, jids and nicks.voidsetPassword(java.lang.String string)Sets the password to use to enter Password-Protected Room.org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
QNAME
public static final javax.xml.namespace.QName QNAME
-
-
Method Detail
-
getElementName
public java.lang.String getElementName()
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.FullyQualifiedElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
- Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
getInvite
public MUCUser.Invite getInvite()
Returns the invitation for another user to a room. The sender of the invitation must be an occupant of the room. The invitation will be sent to the room which in turn will forward the invitation to the invitee.- Returns:
- an invitation for another user to a room.
-
getDecline
public MUCUser.Decline getDecline()
Returns the rejection to an invitation from another user to a room. The rejection will be sent to the room which in turn will forward the refusal to the inviting user.- Returns:
- a rejection to an invitation from another user to a room.
-
getItem
public MUCItem getItem()
Returns the item child that holds information about roles, affiliation, jids and nicks.- Returns:
- an item child that holds information about roles, affiliation, jids and nicks.
-
getPassword
public java.lang.String getPassword()
Returns the password to use to enter Password-Protected Room. A Password-Protected Room is a room that a user cannot enter without first providing the correct password.- Returns:
- the password to use to enter Password-Protected Room.
-
getStatus
public java.util.Set<MUCUser.Status> getStatus()
Returns a set of status which holds the status code that assist in presenting notification messages.- Returns:
- the set of status which holds the status code that assist in presenting notification messages.
-
hasStatus
public boolean hasStatus()
Returns true if this MUCUser instance has alsoMUCUser.Statusinformation.If
trueis returned, thengetStatus()will return a non-empty set.- Returns:
- true if this MUCUser has status information.
- Since:
- 4.1
-
getDestroy
public Destroy getDestroy()
Returns the notification that the room has been destroyed. After a room has been destroyed, the room occupants will receive a Presence stanza of type 'unavailable' with the reason for the room destruction if provided by the room owner.- Returns:
- a notification that the room has been destroyed.
-
setInvite
public void setInvite(MUCUser.Invite invite)
Sets the invitation for another user to a room. The sender of the invitation must be an occupant of the room. The invitation will be sent to the room which in turn will forward the invitation to the invitee.- Parameters:
invite- the invitation for another user to a room.
-
setDecline
public void setDecline(MUCUser.Decline decline)
Sets the rejection to an invitation from another user to a room. The rejection will be sent to the room which in turn will forward the refusal to the inviting user.- Parameters:
decline- the rejection to an invitation from another user to a room.
-
setItem
public void setItem(MUCItem item)
Sets the item child that holds information about roles, affiliation, jids and nicks.- Parameters:
item- the item child that holds information about roles, affiliation, jids and nicks.
-
setPassword
public void setPassword(java.lang.String string)
Sets the password to use to enter Password-Protected Room. A Password-Protected Room is a room that a user cannot enter without first providing the correct password.- Parameters:
string- the password to use to enter Password-Protected Room.
-
addStatusCodes
public void addStatusCodes(java.util.Set<MUCUser.Status> statusCodes)
Add the status codes which holds the codes that assists in presenting notification messages.- Parameters:
statusCodes- the status codes which hold the codes that assists in presenting notification messages.
-
addStatusCode
public void addStatusCode(MUCUser.Status status)
Add a status code which hold a code that assists in presenting notification messages.- Parameters:
status- the status code which olds a code that assists in presenting notification messages.
-
setDestroy
public void setDestroy(Destroy destroy)
Sets the notification that the room has been destroyed. After a room has been destroyed, the room occupants will receive a Presence stanza of type 'unavailable' with the reason for the room destruction if provided by the room owner.- Parameters:
destroy- the notification that the room has been destroyed.
-
getFrom
@Deprecated public static MUCUser getFrom(org.jivesoftware.smack.packet.Stanza packet)
Deprecated.usefrom(Stanza)insteadRetrieve the MUCUser PacketExtension from packet, if any.- Parameters:
packet- TODO javadoc me please- Returns:
- the MUCUser PacketExtension or
null
-
from
public static MUCUser from(org.jivesoftware.smack.packet.Stanza packet)
Retrieve the MUCUser PacketExtension from packet, if any.- Parameters:
packet- TODO javadoc me please- Returns:
- the MUCUser PacketExtension or
null
-
-