A B C D E G H I M P R S T V 

A

allowsPayload(Command.Type) - Static method in enum Command.Type
 
assertErrorToUser(int, Set<ServerErrorCode>, Broadcast) - Static method in class TestUtil
When several error codes apply to an invalid command, your ServerModel may send any one of them in reply.
assertErrorToUser(int, ServerErrorCode, Broadcast) - Static method in class TestUtil
This convenience method calls assertErrorToUser(int, Set, Broadcast) with a singleton set, for cases where only a single error code is allowed by the specification.

B

Broadcast - Class in <Unnamed>
Represents a collection of ServerResponses to be sent from the server to one or more client(s) as the result of a user registration or deregistration, or in response to a command received from some client.
Broadcast() - Constructor for class Broadcast
Constructs an empty Broadcast.

C

ClientConnectionTest - Class in <Unnamed>
 
ClientConnectionTest() - Constructor for class ClientConnectionTest
 
Command - Class in <Unnamed>
Represents a command string sent from a client to the server, after being parsed into a more convenient data structure.
Command(Command.Type, String, String, String) - Constructor for class Command
Constructs a Command with the provided components.
Command(Command.Type, String) - Constructor for class Command
Convenience constructor for Commands with no parameters.
Command.Type - Enum in <Unnamed>
This enumeration defines the various types of commands that the clients and server operate with.
CommandParser - Class in <Unnamed>
A class to contain the static method CommandParser.parse(String).
CommandParserTest - Class in <Unnamed>
 
CommandParserTest() - Constructor for class CommandParserTest
 

D

deregisterUser(int) - Method in class ServerModel
Informs the model that the client with the given user ID has disconnected from the server.

E

equals(Object) - Method in class Broadcast
 
equals(Object) - Method in class Command
 
equals(Object) - Method in class ServerResponse
 

G

generateNamesPayload(String, Collection<String>) - Static method in class ServerUtil
Generates a correct payload for a NAMES response for some channel given the owner nick for that channel and a collection of all users on that channel, including the owner.
getChannels() - Method in class ServerModel
Returns a collection of the names of all channels that are present on the server.
getCode(ServerErrorCode) - Static method in enum ServerErrorCode
Returns the numeric error code corresponding to the specified ServerErrorCode enum constant.
getCommand() - Method in class ServerResponse
 
getNumParams(Command.Type) - Static method in enum Command.Type
 
getOwner(String) - Method in class ServerModel
Returns the nickname of the owner of the given channel.
getParameter(int) - Method in class Command
Returns the specified parameter.
getParameterCount() - Method in class Command
Counts the number of parameters in this command.
getPayload() - Method in class Command
Returns the payload.
getRegisteredUsers() - Method in class ServerModel
Returns a collection of the nicknames of all users that are registered with the server.
getSender() - Method in class ServerResponse
 
getType() - Method in class Command
Returns the command type.
getUsers(String) - Method in class ServerModel
Returns a collection of the nicknames of all users in a given channel.

H

handle(int, Command) - Method in class ServerModel
Passes a command along to the model for processing.
hashCode() - Method in class Broadcast
 
hashCode() - Method in class Command
 
hashCode() - Method in class ServerResponse
 

I

isValidNickname(String) - Static method in class ServerUtil
Determines if a given nickname is valid (contains 1 or more alphanumeric characters).

M

makeConnect() - Static method in class ServerUtil
Convenience method to generate a CONNECT Command.
makeCreate(String, boolean) - Static method in class ServerUtil
Convenience method to generate a CREATE Command.
makeInvite(String, String) - Static method in class ServerUtil
Convenience method to generate an INVITE Command.
makeJoin(String) - Static method in class ServerUtil
Convenience method to generate a JOIN Command.
makeKick(String, String, String) - Static method in class ServerUtil
Convenience method to generate a KICK Command.
makeLeave(String, String) - Static method in class ServerUtil
Convenience method to generate a LEAVE Command.
makeMesg(String, String) - Static method in class ServerUtil
Convenience method to generate a MESG Command.
makeNames(String, String) - Static method in class ServerUtil
Convenience method to generate a NAMES Command.
makeNick(String) - Static method in class ServerUtil
Convenience method to generate a NICK Command.
makeQuit() - Static method in class ServerUtil
Convenience method to generate a QUIT Command.

P

parse(String) - Static method in class CommandParser
Parses a string command received from a client into its component parts, the type, parameters, and payload, and constructs a Command object to represent these components.

R

registerUser(int) - Method in class ServerModel
Informs the model that a client has connected to the server with the given user ID.
requiresPayload(Command.Type) - Static method in enum Command.Type
 

S

send(int, ServerResponse) - Method in class Broadcast
Adds a ServerResponse to the list of responses to be broadcast to the user with specified user ID.
sendAll(Broadcast) - Method in class Broadcast
Appends all responses in other to this broadcast, excluding any duplicates sent to the same user ID in both broadcasts.
sendError(int, String, ServerErrorCode, String) - Method in class Broadcast
A convenience method which constructs an ERROR response and sends it to the user with specified user ID, exactly as if using Broadcast.send(int, ServerResponse).
ServerErrorCode - Enum in <Unnamed>
An enum to represent the various categories of error which are specified by the protocol.
ServerModel - Class in <Unnamed>
Represents the model for a chat server, storing information about users and channels on the server.
ServerModel() - Constructor for class ServerModel
Constructs a ServerModel with any collections needed for modeling the server state initialized.
ServerModelTest - Class in <Unnamed>
Use this class to write your own unit tests for ServerModel.
ServerModelTest() - Constructor for class ServerModelTest
 
ServerResponse - Class in <Unnamed>
Represents responses sent from the server to the client in response to a client Command, a user registration, or a user deregistration.
ServerResponse(String, Command) - Constructor for class ServerResponse
Constructs a ServerResponse from a base Command and the sender.
ServerResponse(String, Command.Type, String, String, String) - Constructor for class ServerResponse
A convenience constructor which builds a new Command from its components to create the ServerResponse.
ServerResponse(String, Command.Type, String) - Constructor for class ServerResponse
A convenience constructor which builds a new Command without parameters from its (other) components to create the ServerResponse.
ServerUtil - Class in <Unnamed>
Class providing static utility methods to help in creating and testing the ServerModel.
setUp() - Method in class ClientConnectionTest
 
setUp() - Method in class ServerModelTest
 

T

testCreateNewChannel() - Method in class ServerModelTest
 
testDeregisterSendsQuitWhereMember() - Method in class ServerModelTest
 
testDeregisterSingleUserErasesFromRegisteredUsers() - Method in class ClientConnectionTest
 
testEmptyOnInit() - Method in class ClientConnectionTest
 
testInviteByOwnerFollowedByJoin() - Method in class ServerModelTest
 
testInviteOnlyPossibleByOwner() - Method in class ServerModelTest
 
testJoinChannelExistsNotMember() - Method in class ServerModelTest
 
testKickOneChannel() - Method in class ServerModelTest
 
testLeaveChannelExistsMember() - Method in class ServerModelTest
 
testMesgChannelExistsMember() - Method in class ServerModelTest
 
testNamesUnsupportedOperation() - Method in class ServerModelTest
 
testNickBroadcastsToChannelWhereMember() - Method in class ServerModelTest
 
testNickCollision() - Method in class ClientConnectionTest
 
testNickCollisionOnConnect() - Method in class ClientConnectionTest
 
testNickInvalidParameter() - Method in class ClientConnectionTest
 
testNickNotInChannels() - Method in class ClientConnectionTest
 
testNickRedundant() - Method in class ClientConnectionTest
 
testParseNoParametersNoPayload() - Method in class CommandParserTest
 
testParseOneParameterNoPayload() - Method in class CommandParserTest
 
testParseThreeParametersNoPayload() - Method in class CommandParserTest
 
testParseTwoParametersNoPayload() - Method in class CommandParserTest
 
testRegisterMultipleUsers() - Method in class ClientConnectionTest
 
testRegisterSingleUser() - Method in class ClientConnectionTest
 
TestUtil - Class in <Unnamed>
Class providing static utility methods to help in testing the ServerModel
toString() - Method in class Broadcast
 
toString() - Method in class Command
Returns the representation of the Command as it would be sent over the wire to the server.
toString() - Method in class ServerResponse
 

V

valueOf(String) - Static method in enum Command.Type
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum ServerErrorCode
Returns the enum constant of this type with the specified name.
values() - Static method in enum Command.Type
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum ServerErrorCode
Returns an array containing the constants of this enum type, in the order they are declared.
A B C D E G H I M P R S T V