JSettlers v1.0.6 API
Built ${date}

soc.server
Class SOCChannelList

java.lang.Object
  extended bysoc.server.SOCChannelList

public class SOCChannelList
extends java.lang.Object

A class for tracking the chat channels

Author:
Robert S. Thomas

Field Summary
protected  java.util.Hashtable channelMembers
           
protected  java.util.Hashtable channelMutexes
           
protected  boolean inUse
           
 
Constructor Summary
SOCChannelList()
          constructor
 
Method Summary
 void addMember(Connection conn, java.lang.String chName)
          add a member to the chat channel
 void createChannel(java.lang.String chName)
          create a new channel
 void deleteChannel(java.lang.String chName)
          remove the channel from the list
 java.util.Enumeration getChannels()
           
 java.util.Vector getMembers(java.lang.String chName)
           
 boolean isChannel(java.lang.String chName)
           
 boolean isChannelEmpty(java.lang.String chName)
           
 boolean isMember(Connection conn, java.lang.String chName)
           
 void releaseMonitor()
          release the monitor for this channel list
 boolean releaseMonitorForChannel(java.lang.String channel)
          release the monitor for this channel
 void removeMember(Connection conn, java.lang.String chName)
          remove member from the chat channel
 void takeMonitor()
          take the monitor for this channel list
 boolean takeMonitorForChannel(java.lang.String channel)
          take the monitor for this channel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channelMutexes

protected java.util.Hashtable channelMutexes

channelMembers

protected java.util.Hashtable channelMembers

inUse

protected boolean inUse
Constructor Detail

SOCChannelList

public SOCChannelList()
constructor

Method Detail

takeMonitor

public void takeMonitor()
take the monitor for this channel list


releaseMonitor

public void releaseMonitor()
release the monitor for this channel list


takeMonitorForChannel

public boolean takeMonitorForChannel(java.lang.String channel)
take the monitor for this channel

Parameters:
channel - the name of the channel
Returns:
false if the channel has no mutex

releaseMonitorForChannel

public boolean releaseMonitorForChannel(java.lang.String channel)
release the monitor for this channel

Parameters:
channel - the name of the channel
Returns:
false if the channel has no mutex

getChannels

public java.util.Enumeration getChannels()
Returns:
an enumeration of channel names

getMembers

public java.util.Vector getMembers(java.lang.String chName)
Parameters:
chName - channel name
Returns:
list of members

isMember

public boolean isMember(Connection conn,
                        java.lang.String chName)
Parameters:
chName - the name of the channel
conn - the member's connection
Returns:
true if memName is a member of the channel

addMember

public void addMember(Connection conn,
                      java.lang.String chName)
add a member to the chat channel

Parameters:
chName - the name of the channel
conn - the member's connection

removeMember

public void removeMember(Connection conn,
                         java.lang.String chName)
remove member from the chat channel

Parameters:
chName - the name of the channel
conn - the member's connection

isChannel

public boolean isChannel(java.lang.String chName)
Parameters:
chName - the name of the channel
Returns:
true if the channel exists

isChannelEmpty

public boolean isChannelEmpty(java.lang.String chName)
Parameters:
chName - the name of the channel
Returns:
true if the channel exists and has an empty member list

createChannel

public void createChannel(java.lang.String chName)
create a new channel

Parameters:
chName - the name of the channel

deleteChannel

public void deleteChannel(java.lang.String chName)
remove the channel from the list

Parameters:
chName - the name of the channel

JSettlers v1.0.6 API
Built ${date}