Index
All Classes and Interfaces|All Packages
A
- addMessage(Response) - Method in class org.cis1200.ResponseSet
-
Add a response to the set
C
- changeNickname(NicknameCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a user wants to change their nickname.
- CHANNEL_ALREADY_EXISTS - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a client attempts to create a channel whose name is already used by another channel on the server.
- Command - Class in org.cis1200
-
A
Command
represents a string sent from a client to the server, after parsing it into a more convenient form. - Command(Integer) - Constructor for class org.cis1200.Command
-
Constructor; initializes the private fields of the object.
- CommandParser - Class in org.cis1200
-
The
CommandParser
class includes a single static method that can convert a String into the appropriateCommand
object that it represents. - compareTo(Response) - Method in class org.cis1200.Response
- connected(Integer, String) - Static method in class org.cis1200.Response
-
A
Response
for the case when a user first connects to the server and should be informed of their new nickname - createChannel(CreateCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a user wants to create a channel.
- CreateCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to create a new channel. - CreateCommand(int, String, boolean) - Constructor for class org.cis1200.CreateCommand
-
Constructor; initializes the private fields of the object.
D
- deregisterUser(int) - Method in class org.cis1200.ServerModel
-
This method is automatically called when a client disconnects from the server.
- disconnected(Integer, String) - Static method in class org.cis1200.Response
-
A
Response
for the case when a user disconnects from the server and other clients should be informed of this fact.
E
- empty() - Static method in class org.cis1200.ResponseSet
-
Convenience method for creating an empty response set.
- equals(Object) - Method in class org.cis1200.Command
-
Compare two commands Returns
true
if twoCommand
s are equal; that is, if they produce the same string representation. - equals(Object) - Method in class org.cis1200.Response
- equals(Object) - Method in class org.cis1200.ResponseSet
- error(Command, ErrorCode) - Static method in class org.cis1200.Response
-
Constructs an error
Response
for the case where a client'sCommand
is invalid, and the client should be informed. - ErrorCode - Enum Class in org.cis1200
-
ErrorCode
is an enumerated type (enum) that lists all possible response codes a server can send to a client in the case of an erroneous command. - existingNickname(String) - Method in class org.cis1200.ServerModel
-
Is this an existing nickname?
- existingUserId(Integer) - Method in class org.cis1200.ServerModel
-
Is this a userId that is known to the server?
G
- getChannel() - Method in class org.cis1200.CreateCommand
- getChannel() - Method in class org.cis1200.InviteCommand
- getChannel() - Method in class org.cis1200.JoinCommand
- getChannel() - Method in class org.cis1200.KickCommand
- getChannel() - Method in class org.cis1200.LeaveCommand
- getChannel() - Method in class org.cis1200.MessageCommand
- getChannels() - Method in class org.cis1200.ServerModel
-
Gets a collection of the names of all the channels that are present on the server.
- getCode() - Method in enum class org.cis1200.ErrorCode
- getNewNickname() - Method in class org.cis1200.NicknameCommand
- getNickname(int) - Method in class org.cis1200.ServerModel
-
Gets the nickname currently associated with the given userId.
- getOwner(String) - Method in class org.cis1200.ServerModel
-
Gets the nickname of the owner of the given channel.
- getRecipientId() - Method in class org.cis1200.Response
- getRegisteredUsers() - Method in class org.cis1200.ServerModel
-
Gets a collection of the nicknames of all users who are registered with the server.
- getResponses() - Method in class org.cis1200.ResponseSet
-
You should not call this method yourself.
- getSenderId() - Method in class org.cis1200.Command
-
Get the userId of the client who issued the
Command
. - getText() - Method in class org.cis1200.Response
- getUserId(String) - Method in class org.cis1200.ServerModel
-
Gets the userId currently associated with the given nickname.
- getUserIdsInChannel(String) - Method in class org.cis1200.ServerModel
-
Gets a collection of the userIds of all users who are in the channel.
- getUserNicknamesInChannel(String) - Method in class org.cis1200.ServerModel
-
Gets an alphabetically sorted set of the nicknames of all the users in a given channel.
- getUserToInvite() - Method in class org.cis1200.InviteCommand
- getUserToKick() - Method in class org.cis1200.KickCommand
H
- hashCode() - Method in class org.cis1200.Response
- hashCode() - Method in class org.cis1200.ResponseSet
I
- INVALID_NAME - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a user tries to change his/her nickname to an invalid string.
- INVITE_TO_PUBLIC_CHANNEL - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a client attempts to issue an invitation to a channel that is not invite-only.
- InviteCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to add another client to an invite-only channel owned by the sender. - InviteCommand(int, String, String) - Constructor for class org.cis1200.InviteCommand
-
Constructor; initializes the private fields of the object.
- inviteUser(InviteCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a channel's owner adds a user to that channel.
- isInviteOnly() - Method in class org.cis1200.CreateCommand
- isRunning() - Method in class org.cis1200.ServerBackend
- isValidName(String) - Static method in class org.cis1200.ServerModel
-
Determines if a given name is valid or invalid (contains at least one alphanumeric character, and no non-alphanumeric characters).
J
- JOIN_PRIVATE_CHANNEL - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a client attempts to join a channel to which he or she has not been invited.
- joinChannel(JoinCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a user wants to join a channel.
- JoinCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to join an existing channel. - JoinCommand(int, String) - Constructor for class org.cis1200.JoinCommand
-
Constructor; initializes the private fields of the object.
K
- KickCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to remove another client from a channel owned by the sender. - KickCommand(int, String, String) - Constructor for class org.cis1200.KickCommand
-
Constructor; initializes the private fields of the object.
- kickUser(KickCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a channel's owner removes a user from that channel.
L
- leaveChannel(LeaveCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a user wants to leave a channel.
- LeaveCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to leave a channel. - LeaveCommand(int, String) - Constructor for class org.cis1200.LeaveCommand
-
Constructor; initializes the private fields of the object.
M
- main(String[]) - Static method in class org.cis1200.ServerMain
-
Entry point for the server
- MessageCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to send a message to all other clients in the channel. - MessageCommand(int, String, String) - Constructor for class org.cis1200.MessageCommand
-
Constructor; initializes the private fields of the object.
N
- NAME_ALREADY_IN_USE - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a client attempts to change his or her nick to a nickname that is already in use by another user.
- names(Integer, String, String, String) - Static method in class org.cis1200.Response
-
Generate a
NAMES
response that informs a client of the users that are present in a channel. - names(Integer, String, String, SortedSet<String>, String) - Static method in class org.cis1200.Response
-
Generate a
NAMES
response that informs a client of the users that are present in a channel. - NicknameCommand - Class in org.cis1200
-
Represents a
Command
issued by a client to change his or her nickname. - NicknameCommand(Integer, String) - Constructor for class org.cis1200.NicknameCommand
-
Constructor; initializes the private fields of the object.
- NO_SUCH_CHANNEL - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when the channel specified in a command is not recognized by the server.
- NO_SUCH_USER - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when the target specified in the command is not registered on the server.
O
- okay(Integer, String, Command) - Static method in class org.cis1200.Response
-
Response indicating no error has occurred when processing the specified command.
- org.cis1200 - package org.cis1200
P
- parse(int, String) - Static method in class org.cis1200.CommandParser
-
Parses a string received from a client into its component parts, and creates a
Command
object representing it.
R
- registerUser(int) - Method in class org.cis1200.ServerModel
-
This method is automatically called when a new client connects to the server.
- Response - Class in org.cis1200
-
A message that the server sends to a client in response to a command Each response has two parts: the userId for the recipient of the response and a string containing the text of the message itself.
- ResponseSet - Class in org.cis1200
-
A
ResponseSet
stores a set of messages that should be sent in response to processing a command. - ResponseSet() - Constructor for class org.cis1200.ResponseSet
- run() - Method in class org.cis1200.ServerBackend
S
- sendMessage(MessageCommand) - Method in class org.cis1200.ServerModel
-
This method is called when a user wants to send a message to a channel.
- ServerBackend - Class in org.cis1200
-
The
ServerBackend
handles networking and communication with clients, and is responsible for managing the server state and executing tasks. - ServerBackend(ServerModel) - Constructor for class org.cis1200.ServerBackend
-
Create the backend
- ServerMain - Class in org.cis1200
-
Initializes and starts a
ServerBackend
, aServerModel
, and a very basic UI to indicate that the server is running. - ServerModel - Class in org.cis1200
-
The
ServerModel
is the class responsible for tracking the state of the server, including its current users and the channels they are in. - ServerModel() - Constructor for class org.cis1200.ServerModel
-
Constructs a
ServerModel
. - singleMessage(Response) - Static method in class org.cis1200.ResponseSet
-
Convenience method for sending a single response.
- stop() - Method in class org.cis1200.ServerBackend
-
Ends the execution of the server
T
- toString() - Method in class org.cis1200.CreateCommand
- toString() - Method in class org.cis1200.InviteCommand
- toString() - Method in class org.cis1200.JoinCommand
- toString() - Method in class org.cis1200.KickCommand
- toString() - Method in class org.cis1200.LeaveCommand
- toString() - Method in class org.cis1200.MessageCommand
- toString() - Method in class org.cis1200.NicknameCommand
- toString() - Method in class org.cis1200.Response
- toString() - Method in class org.cis1200.ResponseSet
U
- updateServerModel(ServerModel) - Method in class org.cis1200.Command
-
Process the command and update the server model accordingly.
- updateServerModel(ServerModel) - Method in class org.cis1200.CreateCommand
- updateServerModel(ServerModel) - Method in class org.cis1200.InviteCommand
- updateServerModel(ServerModel) - Method in class org.cis1200.JoinCommand
- updateServerModel(ServerModel) - Method in class org.cis1200.KickCommand
- updateServerModel(ServerModel) - Method in class org.cis1200.LeaveCommand
- updateServerModel(ServerModel) - Method in class org.cis1200.MessageCommand
- updateServerModel(ServerModel) - Method in class org.cis1200.NicknameCommand
- USER_NOT_IN_CHANNEL - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a client attempts to send a command requiring the sender to be in the specified channel to a channel in which he or she is not a member.
- USER_NOT_OWNER - Enum constant in enum class org.cis1200.ErrorCode
-
Response by the server when a client which does not own a channel attempts to send a command that is restricted to the owner; currently, the only such command is KICK.
V
- valueOf(String) - Static method in enum class org.cis1200.ErrorCode
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class org.cis1200.ErrorCode
-
Returns an array containing the constants of this enum class, in the order they are declared.
All Classes and Interfaces|All Packages