|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.wildfire.muc.spi.MUCRoleImpl
public class MUCRoleImpl
Simple in-memory implementation of a role in a chatroom
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jivesoftware.wildfire.muc.MUCRole |
---|
MUCRole.Affiliation, MUCRole.Role |
Constructor Summary | |
---|---|
MUCRoleImpl(MultiUserChatServer chatserver,
MUCRoomImpl chatroom,
String nickname,
MUCRole.Role role,
MUCRole.Affiliation affiliation,
MUCUserImpl chatuser,
Presence presence,
PacketRouter packetRouter)
Create a new role. |
Method Summary | |
---|---|
void |
changeNickname(String nickname)
Changes the nickname of the occupant within the room to the new nickname. |
MUCRole.Affiliation |
getAffiliation()
Obtain the affiliation state of the user. |
MUCRoom |
getChatRoom()
Obtain the chat room that hosts this user's role. |
MUCUser |
getChatUser()
Obtain the chat user that plays this role. |
org.dom4j.Element |
getExtendedPresenceInformation()
Returns the extended presence information that includes information about roles, affiliations, JIDs, etc. |
String |
getNickname()
Obtain the nickname for the user in the chatroom. |
Presence |
getPresence()
Obtain the current presence status of a user in a chatroom. |
MUCRole.Role |
getRole()
Obtain the role state of the user. |
JID |
getRoleAddress()
Obtain the XMPPAddress representing this role in a room: room@server/nickname |
boolean |
isVoiceOnly()
Returns true if the room occupant does not want to get messages broadcasted to all room occupants. |
void |
send(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(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MUCRoleImpl(MultiUserChatServer chatserver, MUCRoomImpl chatroom, String nickname, MUCRole.Role role, MUCRole.Affiliation affiliation, MUCUserImpl chatuser, 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.Method Detail |
---|
public Presence getPresence()
MUCRole
getPresence
in interface MUCRole
public org.dom4j.Element getExtendedPresenceInformation()
MUCRole
getExtendedPresenceInformation
in interface MUCRole
public void setPresence(Presence newPresence)
MUCRole
setPresence
in interface MUCRole
newPresence
- The presence of the user in the room.public void setRole(MUCRole.Role newRole) throws NotAllowedException
MUCRole
Owning ChatUsers should have their membership roles updated.
setRole
in interface MUCRole
newRole
- 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()
MUCRole
getRole
in interface MUCRole
public void setAffiliation(MUCRole.Affiliation newAffiliation) throws NotAllowedException
MUCRole
setAffiliation
in interface MUCRole
newAffiliation
- the new affiliation that the user will play.
NotAllowedException
- thrown if trying to ban an owner or an administrator.public MUCRole.Affiliation getAffiliation()
MUCRole
getAffiliation
in interface MUCRole
public String getNickname()
MUCRole
getNickname
in interface MUCRole
public void changeNickname(String nickname)
MUCRole
changeNickname
in interface MUCRole
nickname
- the new nickname of the occupant in the room.public MUCUser getChatUser()
MUCRole
getChatUser
in interface MUCRole
public MUCRoom getChatRoom()
MUCRole
getChatRoom
in interface MUCRole
public JID getRoleAddress()
MUCRole
getRoleAddress
in interface MUCRole
public boolean isVoiceOnly()
MUCRole
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.
isVoiceOnly
in interface MUCRole
public void send(Packet packet)
MUCRole
send
in interface MUCRole
packet
- The packet to send
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |