Class RemoteMUCRole
- java.lang.Object
-
- org.jivesoftware.openfire.muc.spi.RemoteMUCRole
-
- All Implemented Interfaces:
Externalizable,Serializable,MUCRole
public class RemoteMUCRole extends Object implements MUCRole, Externalizable
Representation of a room occupant of a local room that is being hosted by another cluster node. An instance of this class will exist for each room occupant that is hosted by another cluster node. Local rooms keep track of local and remote occupants in a transparent way.- Author:
- Gaston Dombiak
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jivesoftware.openfire.muc.MUCRole
MUCRole.Affiliation, MUCRole.Role
-
-
Constructor Summary
Constructors Constructor Description RemoteMUCRole()Do not use this constructor.RemoteMUCRole(MultiUserChatService server, OccupantAddedEvent event)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeNickname(String nickname)Changes the nickname of the occupant within the room to the new nickname.voiddestroy()Destroys this role after the occupant left the room.MUCRole.AffiliationgetAffiliation()Obtain the affiliation state of the user.MUCRoomgetChatRoom()Obtain the chat room that hosts this user's role.StringgetNickname()Obtain the nickname for the user in the chatroom.NodeIDgetNodeID()Returns the id of the node that is hosting the room occupant.org.xmpp.packet.PresencegetPresence()Obtain the current presence status of a user in a chatroom.org.xmpp.packet.JIDgetReportedFmucAddress()Obtain the XMPPAddress representing this role in a room in context of FMUC.MUCRole.RolegetRole()Obtain the role state of the user.org.xmpp.packet.JIDgetRoleAddress()Obtain the XMPPAddress representing this role in a room: room@server/nicknameorg.xmpp.packet.JIDgetUserAddress()Obtain the XMPPAddress of the user that joined the room.booleanisLocal()Returns true if this room occupant is hosted by this JVM.booleanisVoiceOnly()Returns true if the room occupant does not want to get messages broadcasted to all room occupants.voidreadExternal(ObjectInput in)voidsend(org.xmpp.packet.Packet packet)Sends a packet to the user.voidsetAffiliation(MUCRole.Affiliation newAffiliation)Call this method to promote or demote a user's affiliation in a chatroom.voidsetPresence(org.xmpp.packet.Presence presence)Set the current presence status of a user in a chatroom.voidsetRole(MUCRole.Role newRole)Call this method to promote or demote a user's role in a chatroom.voidwriteExternal(ObjectOutput out)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.openfire.muc.MUCRole
augmentOutboundStanzaWithFMUCData, isRemoteFmuc
-
-
-
-
Constructor Detail
-
RemoteMUCRole
public RemoteMUCRole()
Do not use this constructor. Only used for Externalizable.
-
RemoteMUCRole
public RemoteMUCRole(MultiUserChatService server, OccupantAddedEvent event)
-
-
Method Detail
-
getPresence
public org.xmpp.packet.Presence getPresence()
Description copied from interface:MUCRoleObtain the current presence status of a user in a chatroom.- Specified by:
getPresencein interfaceMUCRole- Returns:
- The presence of the user in the room.
-
setPresence
public void setPresence(org.xmpp.packet.Presence presence)
Description copied from interface:MUCRoleSet the current presence status of a user in a chatroom.- Specified by:
setPresencein interfaceMUCRole- Parameters:
presence- The presence of the user in the room.
-
setRole
public void setRole(MUCRole.Role newRole)
Description copied from interface:MUCRoleCall this method to promote or demote a user's role in a chatroom. It is common for the chatroom or other chat room members to change the role of users (a moderator promoting another user to moderator status for example).Owning ChatUsers should have their membership roles updated.
-
getRole
public MUCRole.Role getRole()
Description copied from interface:MUCRoleObtain the role state of the user.
-
setAffiliation
public void setAffiliation(MUCRole.Affiliation newAffiliation)
Description copied from interface:MUCRoleCall this method to promote or demote a user's affiliation in a chatroom.- Specified by:
setAffiliationin interfaceMUCRole- Parameters:
newAffiliation- the new affiliation that the user will play.
-
getAffiliation
public MUCRole.Affiliation getAffiliation()
Description copied from interface:MUCRoleObtain the affiliation state of the user.- Specified by:
getAffiliationin interfaceMUCRole- Returns:
- The affiliation status of this user.
-
changeNickname
public void changeNickname(String nickname)
Description copied from interface:MUCRoleChanges the nickname of the occupant within the room to the new nickname.- Specified by:
changeNicknamein interfaceMUCRole- Parameters:
nickname- the new nickname of the occupant in the room.
-
getNickname
public String getNickname()
Description copied from interface:MUCRoleObtain the nickname for the user in the chatroom.- Specified by:
getNicknamein interfaceMUCRole- Returns:
- The user's nickname in the room or null if invisible.
-
destroy
public void destroy()
Description copied from interface:MUCRoleDestroys this role after the occupant left the room. This role will be removed from MUCUser.
-
isVoiceOnly
public boolean isVoiceOnly()
Description copied from interface:MUCRoleReturns true if the room occupant does not want to get messages broadcasted to all room occupants. This type of users are called "deaf" occupants. Deaf occupants will still be able to get private messages, presences, IQ packets or room history.To be a deaf occupant the initial presence sent to the room while joining the room has to include the following child element:
<x xmlns='http://jivesoftware.org/protocol/muc'> <deaf-occupant/> </x>Note that this is a custom extension to the MUC specification.- Specified by:
isVoiceOnlyin interfaceMUCRole- Returns:
- true if the room occupant does not want to get messages broadcasted to all room occupants.
-
getChatRoom
public MUCRoom getChatRoom()
Description copied from interface:MUCRoleObtain the chat room that hosts this user's role.- Specified by:
getChatRoomin interfaceMUCRole- Returns:
- The chatroom hosting this role.
-
getRoleAddress
public org.xmpp.packet.JID getRoleAddress()
Description copied from interface:MUCRoleObtain the XMPPAddress representing this role in a room: room@server/nickname- Specified by:
getRoleAddressin interfaceMUCRole- Returns:
- The Jabber ID that represents this role in the room.
-
getUserAddress
public org.xmpp.packet.JID getUserAddress()
Description copied from interface:MUCRoleObtain the XMPPAddress of the user that joined the room. Anullnull value represents the room's role.- Specified by:
getUserAddressin interfaceMUCRole- Returns:
- The address of the user that joined the room or null if this role belongs to the room itself.
-
getReportedFmucAddress
public org.xmpp.packet.JID getReportedFmucAddress()
Description copied from interface:MUCRoleObtain the XMPPAddress representing this role in a room in context of FMUC. This typically represents the XMPPAddress as it is known locally at the joining FMUC node. For users that are joined through FMUC from a remote node, this method will return the value as reported by the joining FMUC node. For users that are in the room, but connected directly to this instance of Openfire, this method returns null, even if the room is part of an FMUC node. Users that joined through server-to-server federation (as opposed to FMUC), will not have a FMUC address. Null is returned by this method for these users.- Specified by:
getReportedFmucAddressin interfaceMUCRole- Returns:
- The address of the user that joined the room through FMUC from a remote domain, or null.
-
isLocal
public boolean isLocal()
Description copied from interface:MUCRoleReturns true if this room occupant is hosted by this JVM.
-
getNodeID
public NodeID getNodeID()
Description copied from interface:MUCRoleReturns the id of the node that is hosting the room occupant.
-
send
public void send(org.xmpp.packet.Packet packet)
Description copied from interface:MUCRoleSends a packet to the user.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-