|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.server.SOCChannelList
public class SOCChannelList
A class for tracking the chat channels. The list itself, and each channel, has a monitor for synchronization.
Field Summary | |
---|---|
protected java.util.Hashtable<java.lang.String,java.util.Vector<StringConnection>> |
channelMembers
key = string, value = Vector of StringConnections |
protected java.util.Hashtable<java.lang.String,MutexFlag> |
channelMutexes
key = string, value = Vector of MutexFlags |
protected java.util.Hashtable<java.lang.String,java.lang.String> |
channelOwners
Each channel's creator/owner name. |
protected boolean |
inUse
track the monitor for this channel list |
Constructor Summary | |
---|---|
SOCChannelList()
constructor |
Method Summary | |
---|---|
void |
addMember(StringConnection conn,
java.lang.String chName)
add a member to the chat channel |
void |
createChannel(java.lang.String chName,
java.lang.String chOwner)
create a new channel. |
void |
deleteChannel(java.lang.String chName)
remove the channel from the list |
java.util.Enumeration<java.lang.String> |
getChannels()
|
java.util.Vector<StringConnection> |
getMembers(java.lang.String chName)
|
java.lang.String |
getOwner(java.lang.String chName)
Get a channel's owner name |
boolean |
isChannel(java.lang.String chName)
|
boolean |
isChannelEmpty(java.lang.String chName)
|
boolean |
isMember(StringConnection 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(StringConnection conn,
java.lang.String chName)
remove member from the chat channel |
void |
replaceMemberAllChannels(StringConnection oldConn,
StringConnection newConn)
Replace member from all chat channels, with a new connection (after a network problem). |
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 |
---|
protected java.util.Hashtable<java.lang.String,MutexFlag> channelMutexes
protected java.util.Hashtable<java.lang.String,java.util.Vector<StringConnection>> channelMembers
protected java.util.Hashtable<java.lang.String,java.lang.String> channelOwners
protected boolean inUse
Constructor Detail |
---|
public SOCChannelList()
Method Detail |
---|
public void takeMonitor()
public void releaseMonitor()
public boolean takeMonitorForChannel(java.lang.String channel)
channel
- the name of the channel
public boolean releaseMonitorForChannel(java.lang.String channel)
channel
- the name of the channel
public java.util.Enumeration<java.lang.String> getChannels()
public java.lang.String getOwner(java.lang.String chName)
chName
- channel name
public java.util.Vector<StringConnection> getMembers(java.lang.String chName)
chName
- channel name
public boolean isMember(StringConnection conn, java.lang.String chName)
chName
- the name of the channelconn
- the member's connection
public void addMember(StringConnection conn, java.lang.String chName)
chName
- the name of the channelconn
- the member's connectionpublic void removeMember(StringConnection conn, java.lang.String chName)
chName
- the name of the channelconn
- the member's connectionpublic void replaceMemberAllChannels(StringConnection oldConn, StringConnection newConn)
oldConn
- the member's old connectionnewConn
- the member's new connectionpublic boolean isChannel(java.lang.String chName)
chName
- the name of the channel
public boolean isChannelEmpty(java.lang.String chName)
chName
- the name of the channel
public void createChannel(java.lang.String chName, java.lang.String chOwner) throws java.lang.NullPointerException
chName
- the name of the channelchOwner
- the game owner/creator's player name (added in 1.1.10)
java.lang.NullPointerException
- if chOwner nullpublic void deleteChannel(java.lang.String chName)
chName
- the name of the channel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |