Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.muc.spi
Class LocalMUCRole

    java.lang.Object
      org.jivesoftware.openfire.muc.spi.LocalMUCRole

All Implemented Interfaces:
  MUCRole

    public class LocalMUCRole

extends Object
implements MUCRole

Implementation of a local room occupant.

Author:
  Gaston Dombiak

Nested Class Summary

Nested classes/interfaces inherited from interface org.jivesoftware.openfire.muc.MUCRole
`MUCRole.Affiliation, MUCRole.Role`

Constructor Summary
`LocalMUCRole(MultiUserChatServer chatserver, LocalMUCRoom chatroom, String nickname, MUCRole.Role role, MUCRole.Affiliation affiliation, LocalMUCUser 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.
`void` | `destroy()` Destroys this role after the occupant left the room.
`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.
`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
`JID` | `getUserAddress()` Obtain the XMPPAddress of the user that joined the room.
`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(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

### LocalMUCRole

    public LocalMUCRole(MultiUserChatServer chatserver,
                        LocalMUCRoom chatroom,
                        String nickname,
                        MUCRole.Role role,
                        MUCRole.Affiliation affiliation,
                        LocalMUCUser chatuser,
                        Presence presence,
                        PacketRouter packetRouter)

  Create a new role.

  Parameters:
    `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

### getPresence

    public Presence getPresence()

  Description copied from interface: `MUCRole`
  Obtain the current presence status of a user in a chatroom.

  Specified by:
    `getPresence` in interface `MUCRole`
  Returns:
    The presence of the user in the room.

### setPresence

    public void setPresence(Presence newPresence)

  Description copied from interface: `MUCRole`
  Set the current presence status of a user in a chatroom.

  Specified by:
    `setPresence` in interface `MUCRole`
  Parameters:
    `newPresence` - The presence of the user in the room.

### setRole

    public void setRole(MUCRole.Role newRole)
                 throws NotAllowedException

  Description copied from interface: `MUCRole`
  Call 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.

  Specified by:
    `setRole` in interface `MUCRole`
  Parameters:
    `newRole` - The new role that the user will play.
  Throws:
    `NotAllowedException` - Thrown if trying to change the moderator role to an owner or administrator.

### getRole

    public MUCRole.Role getRole()

  Description copied from interface: `MUCRole`
  Obtain the role state of the user.

  Specified by:
    `getRole` in interface `MUCRole`
  Returns:
    The role status of this user.

### setAffiliation

    public void setAffiliation(MUCRole.Affiliation newAffiliation)
                        throws NotAllowedException

  Description copied from interface: `MUCRole`
  Call this method to promote or demote a user's affiliation in a chatroom.

  Specified by:
    `setAffiliation` in interface `MUCRole`
  Parameters:
    `newAffiliation` - the new affiliation that the user will play.
  Throws:
    `NotAllowedException` - thrown if trying to ban an owner or an administrator.

### getAffiliation

    public MUCRole.Affiliation getAffiliation()

  Description copied from interface: `MUCRole`
  Obtain the affiliation state of the user.

  Specified by:
    `getAffiliation` in interface `MUCRole`
  Returns:
    The affiliation status of this user.

### getNickname

    public String getNickname()

  Description copied from interface: `MUCRole`
  Obtain the nickname for the user in the chatroom.

  Specified by:
    `getNickname` in interface `MUCRole`
  Returns:
    The user's nickname in the room or null if invisible.

### changeNickname

    public void changeNickname(String nickname)

  Description copied from interface: `MUCRole`
  Changes the nickname of the occupant within the room to the new nickname.

  Specified by:
    `changeNickname` in interface `MUCRole`
  Parameters:
    `nickname` - the new nickname of the occupant in the room.

### destroy

    public void destroy()

  Description copied from interface: `MUCRole`
  Destroys this role after the occupant left the room. This role will be removed from MUCUser.

  Specified by:
    `destroy` in interface `MUCRole`

### getChatRoom

    public MUCRoom getChatRoom()

  Description copied from interface: `MUCRole`
  Obtain the chat room that hosts this user's role.

  Specified by:
    `getChatRoom` in interface `MUCRole`
  Returns:
    The chatroom hosting this role.

### getRoleAddress

    public JID getRoleAddress()

  Description copied from interface: `MUCRole`
  Obtain the XMPPAddress representing this role in a room: room@server/nickname

  Specified by:
    `getRoleAddress` in interface `MUCRole`
  Returns:
    The Jabber ID that represents this role in the room.

### getUserAddress

    public JID getUserAddress()

  Description copied from interface: `MUCRole`
  Obtain the XMPPAddress of the user that joined the room. A `null` null value represents the room's role.

  Specified by:
    `getUserAddress` in interface `MUCRole`
  Returns:
    The address of the user that joined the room or null if this role belongs to the room itself.

### isLocal

    public boolean isLocal()

  Description copied from interface: `MUCRole`
  Returns true if this room occupant is hosted by this JVM.

  Specified by:
    `isLocal` in interface `MUCRole`
  Returns:
    true if this room occupant is hosted by this JVM

### getNodeID

    public NodeID getNodeID()

  Description copied from interface: `MUCRole`
  Returns the id of the node that is hosting the room occupant.

  Specified by:
    `getNodeID` in interface `MUCRole`
  Returns:
    the id of the node that is hosting the room occupant.

### isVoiceOnly

    public boolean isVoiceOnly()

  Description copied from interface: `MUCRole`
  Returns 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:
    `isVoiceOnly` in interface `MUCRole`
  Returns:
    true if the room occupant does not want to get messages broadcasted to all room occupants.

### send

    public void send(Packet packet)

  Description copied from interface: `MUCRole`
  Sends a packet to the user.

  Specified by:
    `send` in interface `MUCRole`
  Parameters:
    `packet` - The packet to send

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.