Class MucUser
- java.lang.Object
-
- rocks.xmpp.extensions.muc.model.user.MucUser
-
public final class MucUser extends Object
The implementation of the<x/>element in thehttp://jabber.org/protocol/muc#usernamespace.Usage
This class is immutable.// To create an element with an item of 'owner' and 'moderator' MucUser mucUser = MucUser.withItem(Affiliation.OWNER, Role.MODERATOR);- See Also:
- XEP-0045: Multi-User Chat, XML Schema
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DeclinegetDecline()Gets the decline.DestroygetDestroy()Gets the destroy element.List<Invite>getInvites()Gets the invitesItemgetItem()Gets the item.StringgetPassword()Gets the password for the room.Set<Status>getStatusCodes()Gets the status codes.static MucUserwithDecline(Jid to, String reason)Creates a<x/>element with a<decline/>child element.static MucUserwithDestroy(Affiliation affiliation, Role role, Jid jid, String reason)Creates a<x/>element with an<item/>and a<destroy/>child element.static MucUserwithInvite(String password, Invite... invite)Creates a<x/>element with an<invite/>and a<password/>child element.static MucUserwithInvites(Invite... invite)Creates a<x/>element with an<invite/>child element.static MucUserwithItem(Affiliation affiliation, Role role, String nick, String reason)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithItem(Affiliation affiliation, Role role, Jid jid, String nick, Actor actor, String reason, Status... status)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithItem(Affiliation affiliation, Role role, Jid jid, String nick, Status... status)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithItem(Affiliation affiliation, Role role, Jid jid, Status... status)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithItem(Affiliation affiliation, Role role, Actor actor, String reason, Status... status)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithItem(Affiliation affiliation, Role role, Status... status)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithItem(Role role, String nick, String reason, Status... status)Creates a<x/>element with an<item/>and a<status/>child element.static MucUserwithStatus(Status... status)Creates a<x/>element with one or more<status/>child elements.
-
-
-
Method Detail
-
withItem
public static MucUser withItem(Affiliation affiliation, Role role, Status... status)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='owner' role='moderator'/> <status code='110'/> </x>- Parameters:
affiliation- The affiliation.role- The role.status- The status.- Returns:
- The
MucUserinstance.
-
withItem
public static MucUser withItem(Affiliation affiliation, Role role, Jid jid, Status... status)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' jid='hag66@shakespeare.lit/pda' role='participant'/> </x>- Parameters:
affiliation- The affiliation.role- The role.jid- The JID.status- The status.- Returns:
- The
MucUserinstance.
-
withItem
public static MucUser withItem(Affiliation affiliation, Role role, Jid jid, String nick, Status... status)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='member' jid='hag66@shakespeare.lit/pda' nick='oldhag' role='participant'/> <status code='303'/> </x>- Parameters:
affiliation- The affiliation.role- The role.jid- The JID.nick- The nick.status- The status.- Returns:
- The
MucUserinstance.
-
withItem
public static MucUser withItem(Role role, String nick, String reason, Status... status)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='member' jid='hag66@shakespeare.lit/pda' nick='oldhag' role='participant'/> <status code='303'/> </x>- Parameters:
role- The role.nick- The nick.reason- The reason.status- The status.- Returns:
- The
MucUserinstance.
-
withItem
public static MucUser withItem(Affiliation affiliation, Role role, Actor actor, String reason, Status... status)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none'> <actor nick='Fluellen'/> <reason>Avaunt, you cullion!</reason> </item> <status code='307'/> </x>- Parameters:
affiliation- The affiliation.role- The role.actor- The actor.reason- The reason.status- The status.- Returns:
- The
MucUserinstance.
-
withItem
public static MucUser withItem(Affiliation affiliation, Role role, String nick, String reason)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='member' nick='thirdwitch' role='participant'> <reason>A worthy witch indeed!</reason> </item> </x>- Parameters:
affiliation- The affiliation.role- The role.nick- The nick.reason- The reason.- Returns:
- The
MucUserinstance.
-
withItem
public static MucUser withItem(Affiliation affiliation, Role role, Jid jid, String nick, Actor actor, String reason, Status... status)
Creates a<x/>element with an<item/>and a<status/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none' jid='hag66@shakespeare.lit/pda' nick='oldhag'> <actor nick='Fluellen'/> <reason>Avaunt, you cullion!</reason> </item> <status code='307'/> </x>- Parameters:
affiliation- The affiliation.role- The role.jid- The JID.nick- The nick.actor- The actor.reason- The reason.status- The status.- Returns:
- The
MucUserinstance.
-
withDestroy
public static MucUser withDestroy(Affiliation affiliation, Role role, Jid jid, String reason)
Creates a<x/>element with an<item/>and a<destroy/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none'/> <destroy jid='coven@chat.shakespeare.lit'> <reason>Macbeth doth come.</reason> </destroy> </x>- Parameters:
affiliation- The affiliation.role- The role.jid- The JID.reason- The reason.- Returns:
- The
MucUserinstance.
-
withInvites
public static MucUser withInvites(Invite... invite)
Creates a<x/>element with an<invite/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <invite to='hecate@shakespeare.lit'/> </x>- Parameters:
invite- The invites.- Returns:
- The
MucUserinstance.
-
withInvite
public static MucUser withInvite(String password, Invite... invite)
Creates a<x/>element with an<invite/>and a<password/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <invite to='hecate@shakespeare.lit'/> <password>cauldronburn</password> </x>- Parameters:
password- The password.invite- The invites.- Returns:
- The
MucUserinstance.
-
withDecline
public static MucUser withDecline(Jid to, String reason)
Creates a<x/>element with a<decline/>child element.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <decline to='crone1@shakespeare.lit'> <reason> Sorry, I'm too busy right now. </reason> </decline> </x>- Parameters:
to- The to attribute.reason- The reason.- Returns:
- The
MucUserinstance.
-
withStatus
public static MucUser withStatus(Status... status)
Creates a<x/>element with one or more<status/>child elements.Sample:
<x xmlns='http://jabber.org/protocol/muc#user'> <status code='170'/> </x>- Parameters:
status- The status.- Returns:
- The
MucUserinstance.
-
getStatusCodes
public Set<Status> getStatusCodes()
Gets the status codes.- Returns:
- The status codes.
-
getItem
public Item getItem()
Gets the item.- Returns:
- The item.
-
getDecline
public Decline getDecline()
Gets the decline.- Returns:
- The decline.
-
getDestroy
public Destroy getDestroy()
Gets the destroy element.- Returns:
- The destroy element.
-
getPassword
public String getPassword()
Gets the password for the room.- Returns:
- The password for the room.
-
-