| java.lang.Object server.ChannelManager
ChannelManager | final public class ChannelManager (Code) | | This class manages the channels for the server. It allows 3 types
of channels. The first of which, defaultChannel, is limited to
one and is the default channel that users are sent to when
connecting. The second, systemChannels, is a collection of channels
that are perminent and created upon program initialization from
the configuration file. The third, userChannels, are created by users
and can only exist if specified in the system configuration file. When
a userChannel is empty it is deleted.
author: Joseph Monti countjoe@users.sourceforge.net version: 0.8 |
Inner Class :public class ChannelManagerItem | |
allowUserChannels | public static char allowUserChannels(Code) | | |
ChannelManager | ChannelManager()(Code) | | Constructor to setup variables
|
addSystemChannel | public boolean addSystemChannel(String name, String pass)(Code) | | creates a new system channel (if valid name)
Parameters: name - the name of the channel Parameters: pass - the password for the channel, can be null if nopassword required true on success, false otherwise (if its not a valid channeL) |
addUserChannel | public String addUserChannel(String name, String pass, ClientConnection cc)(Code) | | creates a new user channel (if valid name and is allowed)
Parameters: name - the name of the channel Parameters: pass - the password for the channel, can be null if nopassword required Parameters: cc - the client requesting the channel null on success, reason otherwise (if its not a valid channeL) |
channelExists | public boolean channelExists(String name)(Code) | | checks to see if the channel exists
Parameters: name - the name of the channel true if channel exists |
channelHasPass | public String channelHasPass(String name)(Code) | | checks to see if channel has password
"" if name has pass, null otherwise |
enumerate | public Enumeration enumerate()(Code) | | returns an enumeration of all the contained channels
an enumeration of all contained channels |
isValidChannel | public boolean isValidChannel(String name)(Code) | | checks to see if the channel can be created
Parameters: name - the name of the channel true if valid channel |
setDefaultChannel | public boolean setDefaultChannel(String name)(Code) | | sets the default channel for the server
Parameters: name - the name of the channel true on success, false otherwise (if its not a valid channeL) |
userAdd | public boolean userAdd(String name, String pass)(Code) | | adds a user to the specified channel
Parameters: name - the name of the channel Parameters: pass - the password to use for the channel, can be null true on success, false otherwise (if its not a valid channel,or invalied passphrase) |
userDel | public boolean userDel(String name)(Code) | | removes a user from the specified channel, only used on user channels
Parameters: name - the name of the channel true when the operation emptied the channel and the channelwas removed, false if failed or did not empty channel |
|
|