Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.muc
Interface MUCUser

All Superinterfaces:
ChannelHandler
All Known Implementing Classes:
MUCUserImpl

public interface MUCUser
extends ChannelHandler

The chat user is a separate user abstraction for interacting with the chat server. Centralizing chat users to the Jabber entity that sends and receives the chat messages allows us to create quality of service, authorization, and resource decisions on a real-user basis.

Most chat users in a typical s2s scenario will not be local users.

MUCUsers play one or more roles in one or more chat rooms on the server.

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 removeRole(String roomName)
          Removes the role of the user in a particular room.
 
Methods inherited from interface org.jivesoftware.wildfire.ChannelHandler
process
 

Method Detail

getID

long getID()
Obtain a user ID (useful for database indexing).

Returns:
The user's id number if any (-1 indicates the implementation doesn't support ids)

getAddress

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).

Returns:
the address of the packet handler.

getRole

MUCRole getRole(String roomName)
                throws NotFoundException
Obtain the role of the user in a particular room.

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

getRoles

Iterator<MUCRole> getRoles()
Get all roles for this user.

Returns:
Iterator over all roles for this user

addRole

void addRole(String roomName,
             MUCRole 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

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

isJoined

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.

getLastPacketTime

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

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

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.