MUCRole.Affiliation, MUCRole.Role| Constructor and Description |
|---|
LocalMUCRole(MultiUserChatService chatserver,
LocalMUCRoom chatroom,
String nickname,
MUCRole.Role role,
MUCRole.Affiliation affiliation,
LocalMUCUser chatuser,
org.xmpp.packet.Presence presence,
PacketRouter packetRouter)
Create a new role.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeNickname(String nickname)
Changes the nickname of the occupant within the room to the new nickname.
|
void |
destroy()
Destroys this role after the occupant left the room.
|
boolean |
equals(Object obj) |
MUCRole.Affiliation |
getAffiliation()
Obtain the affiliation state of the user.
|
MUCRoom |
getChatRoom()
Obtain the chat room that hosts this user's role.
|
String |
getNickname()
Obtain the nickname for the user in the chatroom.
|
NodeID |
getNodeID()
Returns the id of the node that is hosting the room occupant.
|
org.xmpp.packet.Presence |
getPresence()
Obtain the current presence status of a user in a chatroom.
|
MUCRole.Role |
getRole()
Obtain the role state of the user.
|
org.xmpp.packet.JID |
getRoleAddress()
Obtain the XMPPAddress representing this role in a room: room@server/nickname
|
org.xmpp.packet.JID |
getUserAddress()
Obtain the XMPPAddress of the user that joined the room.
|
int |
hashCode() |
boolean |
isLocal()
Returns true if this room occupant is hosted by this JVM.
|
boolean |
isVoiceOnly()
Returns true if the room occupant does not want to get messages broadcasted to all
room occupants.
|
void |
send(org.xmpp.packet.Packet packet)
Sends a packet to the user.
|
void |
setAffiliation(MUCRole.Affiliation newAffiliation)
Call this method to promote or demote a user's affiliation in a chatroom.
|
void |
setPresence(org.xmpp.packet.Presence newPresence)
Set the current presence status of a user in a chatroom.
|
void |
setRole(MUCRole.Role newRole)
Call this method to promote or demote a user's role in a chatroom.
|
public LocalMUCRole(MultiUserChatService chatserver, LocalMUCRoom chatroom, String nickname, MUCRole.Role role, MUCRole.Affiliation affiliation, LocalMUCUser chatuser, org.xmpp.packet.Presence presence, PacketRouter packetRouter)
chatserver - the server hosting the role.chatroom - the room the role is valid in.nickname - the nickname of the user in the role.role - the role of the user in the room.affiliation - the affiliation of the user in the room.chatuser - the user on the chat server.presence - the presence sent by the user to join the room.packetRouter - the packet router for sending messages from this role.public org.xmpp.packet.Presence getPresence()
MUCRolegetPresence in interface MUCRolepublic void setPresence(org.xmpp.packet.Presence newPresence)
MUCRolesetPresence in interface MUCRolenewPresence - The presence of the user in the room.public void setRole(MUCRole.Role newRole) throws NotAllowedException
MUCRoleOwning ChatUsers should have their membership roles updated.
setRole in interface MUCRolenewRole - The new role that the user will play.NotAllowedException - Thrown if trying to change the moderator role to an owner or
administrator.public MUCRole.Role getRole()
MUCRolepublic void setAffiliation(MUCRole.Affiliation newAffiliation) throws NotAllowedException
MUCRolesetAffiliation in interface MUCRolenewAffiliation - the new affiliation that the user will play.NotAllowedException - thrown if trying to ban an owner or an administrator.public MUCRole.Affiliation getAffiliation()
MUCRolegetAffiliation in interface MUCRolepublic String getNickname()
MUCRolegetNickname in interface MUCRolepublic void changeNickname(String nickname)
MUCRolechangeNickname in interface MUCRolenickname - the new nickname of the occupant in the room.public void destroy()
MUCRolepublic MUCRoom getChatRoom()
MUCRolegetChatRoom in interface MUCRolepublic org.xmpp.packet.JID getRoleAddress()
MUCRolegetRoleAddress in interface MUCRolepublic org.xmpp.packet.JID getUserAddress()
MUCRolegetUserAddress in interface MUCRolepublic boolean isLocal()
MUCRolepublic NodeID getNodeID()
MUCRolepublic boolean isVoiceOnly()
MUCRoleTo 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.isVoiceOnly in interface MUCRolepublic void send(org.xmpp.packet.Packet packet)
MUCRoleCopyright © 2003-2008 Jive Software.