com.lyrisoft.chat.server.remote
Class RoomServer

java.lang.Object
  |
  +--com.lyrisoft.chat.server.remote.RoomServer
All Implemented Interfaces:
ICommands

public class RoomServer
extends java.lang.Object
implements ICommands

RoomServer. This represents a room in the system, and is sort of a little server of its own.


Field Summary
protected  java.util.HashMap _ops
           
protected  java.lang.String _roomName
           
protected  ChatServer _server
           
protected  java.util.HashMap _users
           
 
Fields inherited from interface com.lyrisoft.chat.ICommands
ACCESS_DENIED, ACK_KILL, ALREADY_SIGNED_ON, DELIMITER, EMOTE_TO_ROOM, EMOTE_TO_USER, ERROR, GET_ROOMS, GET_USERS_IN_ROOM, GET_USERS_ON_SERVER, HELP, HYPERLINK, IGNORE, INVALID_CHARACTER, INVITE, JOIN_ROOM, JOIN_ROOM_ACK, KICK, KILL, NO_INVITE, NO_SUCH_USER, OP, PART_ROOM, PART_ROOM_ACK, PING, PONG, REMOTE_CLIENT_MESSAGE, ROOM_ACCESS_DENIED, ROOM_DIFF, ROOM_MSG, ROOM_USER_DIFF, SAY_TO_ROOM, SAY_TO_USER, SHUTDOWN, SIGNOFF, SIGNON, SIGNON_ACK, STATS, UNIGNORE, UNINVITE, USER_DIFF, VERSION, WHOIS
 
Constructor Summary
RoomServer(java.lang.String name, ChatServer server)
           
RoomServer(java.lang.String name, java.lang.String password, ChatServer server)
           
 
Method Summary
 void broadcast(java.lang.String message)
          Send a general message to all the clients in this room
 boolean contains(ChatClient client)
           
 void deop(ChatClient client)
           
 void deop(ChatClient op, ChatClient newOp)
           
 void emote(ChatClient sender, java.lang.String message)
          Send an emote to the room.
 void emote(java.lang.String from, java.lang.String message)
           
 java.lang.String getName()
          Get the name of this room
 int getUserCount()
          Get the number of users in this room
 java.lang.String[] getUsers()
          Get a string array containing the names of all the users in this room
 void invite(ChatClient inviter, java.lang.String invitee)
           
 boolean isEmpty()
          Tells whether or not this room is empty
 void join(ChatClient client)
          Add a user to this room.
 void join(ChatClient client, java.lang.String password)
           
 void kick(ChatClient kicker, java.lang.String victim)
           
protected  void notifyJoin(java.lang.String userId)
           
protected  void notifyPart(java.lang.String userId, boolean isSignoff)
           
 void op(ChatClient client)
           
 void op(ChatClient op, ChatClient newOp)
           
 void part(ChatClient client, boolean isSignoff)
          Remove a user from this room.
 void part(java.lang.String userId, boolean isSignoff)
           
 void remoteJoin(java.lang.String username, java.lang.String password)
           
 void remotePart(java.lang.String username, boolean isSignoff)
           
 void say(ChatClient sender, java.lang.String message)
          Say something to everyone in the room
 void say(java.lang.String from, java.lang.String message)
           
 void uninvite(ChatClient inviter, java.lang.String invitee)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_roomName

protected java.lang.String _roomName

_users

protected java.util.HashMap _users

_ops

protected java.util.HashMap _ops

_server

protected ChatServer _server
Constructor Detail

RoomServer

public RoomServer(java.lang.String name,
                  ChatServer server)

RoomServer

public RoomServer(java.lang.String name,
                  java.lang.String password,
                  ChatServer server)
Method Detail

getName

public java.lang.String getName()
Get the name of this room

isEmpty

public boolean isEmpty()
Tells whether or not this room is empty
Returns:
true if emtpy, false otherwise

broadcast

public void broadcast(java.lang.String message)
Send a general message to all the clients in this room
Parameters:
message - the general message

emote

public void emote(ChatClient sender,
                  java.lang.String message)
Send an emote to the room.
Parameters:
sender - the person doing the emote
message - the emote text

emote

public void emote(java.lang.String from,
                  java.lang.String message)

say

public void say(ChatClient sender,
                java.lang.String message)
Say something to everyone in the room
Parameters:
sender - the person doing the talking
message - the message text

say

public void say(java.lang.String from,
                java.lang.String message)

notifyJoin

protected void notifyJoin(java.lang.String userId)

remoteJoin

public void remoteJoin(java.lang.String username,
                       java.lang.String password)

notifyPart

protected void notifyPart(java.lang.String userId,
                          boolean isSignoff)

remotePart

public void remotePart(java.lang.String username,
                       boolean isSignoff)

join

public void join(ChatClient client)
          throws RoomJoinException
Add a user to this room. All other room members are notified
Parameters:
client - the client that is joining
See Also:
ChatClient.userJoinedRoom(java.lang.String, java.lang.String)

join

public void join(ChatClient client,
                 java.lang.String password)
          throws RoomJoinException

op

public void op(ChatClient client)

deop

public void deop(ChatClient client)

op

public void op(ChatClient op,
               ChatClient newOp)

deop

public void deop(ChatClient op,
                 ChatClient newOp)

part

public void part(ChatClient client,
                 boolean isSignoff)
Remove a user from this room. All other room members are notified
Parameters:
client - the client that is leaving
isSignoff - true if the client is signing off; false if the client is leaving only this room.
See Also:
ChatClient.userPartedRoom(java.lang.String, java.lang.String, boolean)

part

public void part(java.lang.String userId,
                 boolean isSignoff)

kick

public void kick(ChatClient kicker,
                 java.lang.String victim)

getUserCount

public int getUserCount()
Get the number of users in this room

getUsers

public java.lang.String[] getUsers()
Get a string array containing the names of all the users in this room

contains

public boolean contains(ChatClient client)

invite

public void invite(ChatClient inviter,
                   java.lang.String invitee)

uninvite

public void uninvite(ChatClient inviter,
                     java.lang.String invitee)


Copyright © 2000-2002 Taso Lyristis