Openfire 3.3.2 Javadoc

org.jivesoftware.openfire.muc.spi
Class MUCUserImpl

java.lang.Object
  extended by org.jivesoftware.openfire.muc.spi.MUCUserImpl
All Implemented Interfaces:
ChannelHandler, MUCUser

public class MUCUserImpl
extends Object
implements MUCUser

Implementation of MUCUser. There will be a MUCUser per user that is connected to one or more rooms. A MUCUser contains a collection of MUCRoles for each room where the user has joined.

Author:
Gaston Dombiak

Method Summary
 void addRole(String roomName, MUCRole role)
          Adds the role of the user in a particular room.
 JID getAddress()
          Obtain the address of the user.
 long getID()
          Obtain a user ID (useful for database indexing).
 long getLastPacketTime()
          Get time (in milliseconds from System currentTimeMillis()) since last packet.
 MUCRole getRole(String roomName)
          Obtain the role of the user in a particular room.
 Iterator<MUCRole> getRoles()
          Get all roles for this user.
 boolean isJoined()
          Returns true if the user is currently present in one or more rooms.
 void process(IQ packet)
           
 void process(Message packet)
          This method does all packet routing in the chat server.
 void process(Packet packet)
          Process an XMPP packet.
 void process(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

getID

public long getID()
Description copied from interface: MUCUser
Obtain a user ID (useful for database indexing).

Specified by:
getID in interface MUCUser
Returns:
The user's id number if any (-1 indicates the implementation doesn't support ids)

getRole

public MUCRole getRole(String roomName)
                throws NotFoundException
Description copied from interface: MUCUser
Obtain the role of the user in a particular room.

Specified by:
getRole in interface MUCUser
Parameters:
roomName - The name of the room we're interested in
Returns:
The role the user plays in that room
Throws:
NotFoundException - if the user does not have a role in the given room

isJoined

public boolean isJoined()
Description copied from interface: MUCUser
Returns true if the user is currently present in one or more rooms.

Specified by:
isJoined in interface MUCUser
Returns:
true if the user is currently present in one or more rooms.

getRoles

public Iterator<MUCRole> getRoles()
Description copied from interface: MUCUser
Get all roles for this user.

Specified by:
getRoles in interface MUCUser
Returns:
Iterator over all roles for this user

addRole

public void addRole(String roomName,
                    MUCRole role)
Description copied from interface: MUCUser
Adds the role of the user in a particular room.

Specified by:
addRole in interface MUCUser
Parameters:
roomName - The name of the room.
role - The new role of the user.

removeRole

public void removeRole(String roomName)
Description copied from interface: MUCUser
Removes the role of the user in a particular room.

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

Specified by:
removeRole in interface MUCUser
Parameters:
roomName - The name of the room we're being removed

getLastPacketTime

public long getLastPacketTime()
Description copied from interface: MUCUser
Get time (in milliseconds from System currentTimeMillis()) since last packet.

Specified by:
getLastPacketTime in interface MUCUser
Returns:
The time when the last packet was sent from this user

getAddress

public JID getAddress()
Description copied from interface: MUCUser
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(Packet packet)
             throws UnauthorizedException,
                    PacketException
Description copied from interface: ChannelHandler
Process an XMPP packet.

Specified by:
process in interface ChannelHandler
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(Message packet)
This method does all packet routing in the chat server. Packet routing is actually very simple:

Parameters:
packet - The packet to route.

process

public void process(IQ packet)

process

public void process(Presence packet)

Openfire 3.3.2 Javadoc

Copyright © 2003-2007 Jive Software.