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

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

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

All Implemented Interfaces:
  ChannelHandler<org.xmpp.packet.Packet>, MUCUser

    public class LocalMUCUser

extends Object
implements MUCUser

Representation of users interacting with the chat service. A user may join serveral rooms hosted by the chat service. That means that we are going to have an instance of this class for the user and several MUCRoles for each joined room.

This room occupant is being hosted by this JVM. When the room occupant is hosted by another cluster node then an instance of `RemoteMUCRole` will be used instead.

Author:
  Gaston Dombiak

Method Summary
`void` | `addRole(String roomName, LocalMUCRole role)` Adds the role of the user in a particular room.
`org.xmpp.packet.JID` | `getAddress()` Obtain the address of the user.
`long` | `getLastPacketTime()` Get time (in milliseconds from System currentTimeMillis()) since last packet.
`Collection<LocalMUCRole>` | `getRoles()` Get all roles for this user.
`boolean` | `isJoined()` Returns true if the user is currently present in one or more rooms.
`void` | `process(org.xmpp.packet.IQ packet)`
`void` | `process(org.xmpp.packet.Message packet)` This method does all packet routing in the chat server.
`void` | `process(org.xmpp.packet.Packet packet)` Process an XMPP packet.
`void` | `process(org.xmpp.packet.Presence packet)`
`void` | `removeRole(String roomName)` Removes the role of the user in a particular room.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### isJoined

    public boolean isJoined()

  Returns true if the user is currently present in one or more rooms.

  Returns:
    true if the user is currently present in one or more rooms.

### getRoles

    public Collection<LocalMUCRole> getRoles()

  Get all roles for this user.

  Returns:
    Iterator over all roles for this user

### addRole

    public void addRole(String roomName,
                        LocalMUCRole role)

  Adds the role of the user in a particular room.

  Parameters:
    `roomName` - The name of the room.
    `role` - The new role of the user.

### removeRole

    public void removeRole(String roomName)

  Removes the role of the user in a particular room.

  Note: PREREQUISITE: A lock on this object has already been obtained.

  Parameters:
    `roomName` - The name of the room we're being removed

### getLastPacketTime

    public long getLastPacketTime()

  Get time (in milliseconds from System currentTimeMillis()) since last packet.

  Returns:
    The time when the last packet was sent from this user

### getAddress

    public org.xmpp.packet.JID getAddress()

  Obtain the address of the user. The address is used by services like the core server packet router to determine if a packet should be sent to the handler. Handlers that are working on behalf of the server should use the generic server hostname address (e.g. server.com).

  Specified by:
    `getAddress` in interface `MUCUser`
  Returns:
    the address of the packet handler.

### process

    public void process(org.xmpp.packet.Packet packet)
                 throws UnauthorizedException,
                        PacketException

  Description copied from interface: `ChannelHandler`
  Process an XMPP packet.

  Specified by:
    `process` in interface `ChannelHandler<org.xmpp.packet.Packet>`
  Parameters:
    `packet` - a packet to process.
  Throws:
    `UnauthorizedException` - if not allowed to process the packet.
    `PacketException` - thrown if the packet is malformed (results in the sender's session being shutdown).

### process

    public void process(org.xmpp.packet.Message packet)

  This method does all packet routing in the chat server. Packet routing is actually very simple:
  - Discover the room the user is talking to (server packets are dropped)
  - If the room is not registered and this is a presence "available" packet, try to join the room
  - If the room is registered, and presence "unavailable" leave the room
  - Otherwise, rewrite the sender address and send to the room.

  Parameters:
    `packet` - The packet to route.

### process

    public void process(org.xmpp.packet.IQ packet)

### process

    public void process(org.xmpp.packet.Presence packet)

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

Copyright © 2003-2008 Jive Software.