Index
A B C D E G H I J M N O P R S T U V
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- addUserToChannel(String, String) - Method in class ServerModel
B
C
- changeNickname(NicknameCommand) - Method in class ServerModel
- CHANNEL_ALREADY_EXISTS - ServerError
-
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 <Unnamed>
-
Represents a command string sent from a client to the server, after it has been parsed into a more convenient form.
- CommandParser - Class in <Unnamed>
- connected(String) - Static method in class Broadcast
-
Creates a
Broadcast
for the case when a user first connects to the server and should be informed of their new nickname - createChannel(String, String, boolean) - Method in class ServerModel
D
- deregisterUser(int) - Method in class ServerModel
-
Informs the model that the client with the given user ID has disconnected from the server.
- deregisterUser(int) - Method in interface ServerModelApi
-
Informs the model that the client with the given user ID has disconnected from the server.
- disconnected(String, Collection<String>) - Static method in class Broadcast
-
Creates a
Broadcast
for the case when a user disconnects from the server and other clients should be informed of this fact.
E
- equals(Object) - Method in class Broadcast
- equals(Object) - Method in class Command
-
Returns
true
if twoCommand
s are equal; that is, they produce the same string representation. - error(Command, ServerError) - Static method in class Broadcast
-
Creates a
Broadcast
for the case where a client'sCommand
is invalid, and the client should be informed.
G
- getChannels() - Method in class ServerModel
-
Gets a collection of the names of all the channels that are present on the server.
- getChannels() - Method in interface ServerModelApi
-
Gets a collection of the names of all the channels that are present on the server.
- getCode() - Method in enum ServerError
- getNickname(int) - Method in class ServerModel
-
Gets the nickname currently associated with the given user ID.
- getNickname(int) - Method in interface ServerModelApi
-
Gets the nickname currently associated with the given user ID.
- getOwner(String) - Method in class ServerModel
-
Gets the nickname of the owner of the given channel.
- getOwner(String) - Method in interface ServerModelApi
-
Gets the nickname of the owner of the given channel.
- getRegisteredUsers() - Method in class ServerModel
-
Gets a collection of the nicknames of all users who are registered with the server.
- getRegisteredUsers() - Method in interface ServerModelApi
-
Gets a collection of the nicknames of all users who are registered with the server.
- getResponses(ServerModelApi) - Method in class Broadcast
-
You should not call this method yourself.
- getSender() - Method in class Command
-
Gets the nickname of the client who issued the
Command
. - getSenderId() - Method in class Command
-
Gets the user ID of the client who issued the
Command
. - getUserId(String) - Method in class ServerModel
-
Gets the user ID currently associated with the given nickname.
- getUserId(String) - Method in interface ServerModelApi
-
Gets the user ID currently associated with the given nickname.
- getUsersInChannel(String) - Method in class ServerModel
-
Gets a collection of the nicknames of all the users in a given channel.
- getUsersInChannel(String) - Method in interface ServerModelApi
-
Gets a collection of the nicknames of all the users in a given channel.
H
- hashCode() - Method in class Broadcast
I
- INVALID_NAME - ServerError
-
Response by the server when a user tries to change his/her nickname to an invalid string.
- INVITE_TO_PUBLIC_CHANNEL - ServerError
-
Response by the server when a client attempts to issue an invite to a channel that is not invite-only.
- isPublicChannel(String) - Method in class ServerModel
- isValidName(String) - Static method in class ServerModel
-
Determines if a given nickname is valid or invalid (contains at least one alphanumeric character, and no non-alphanumeric characters).
J
- JOIN_PRIVATE_CHANNEL - ServerError
-
Response by the server when a client attempts to join a channel to which he or she has not been invited.
M
- main(String[]) - Static method in class ServerMain
-
Initializes and starts a
ServerBackend
, aServerModel
, and a very basic UI to indicate that the server is running.
N
- NAME_ALREADY_IN_USE - ServerError
-
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(Command, Collection<String>, String) - Static method in class Broadcast
-
A specialized method for creating a
Broadcast
in the event that a user is added to a channel as the result of aJoinCommand
orInviteCommand
. - NO_SUCH_CHANNEL - ServerError
-
Response by the server when the channel specified in a command is not recognized by the server.
- NO_SUCH_USER - ServerError
-
Response by the server when the target specified in the command is not registered on the server.
O
- okay(Command, Collection<String>) - Static method in class Broadcast
-
Creates a
Broadcast
for the general case where a client'sCommand
is accepted by the server and should be relayed to the appropriate clients. - OKAY - ServerError
-
Response indicating no error has occurred.
P
- parse(int, String, String) - Static method in class CommandParser
-
Parses a string command received from a client into its component parts, and creates a
Command
object representing it.
R
- registerUser(int) - Method in class ServerModel
-
Informs the model that a client has connected to the server with the given user ID.
- registerUser(int) - Method in interface ServerModelApi
-
Informs the model that a client has connected to the server with the given user ID.
- removeUserFromChannel(String, String) - Method in class ServerModel
S
- ServerError - Enum in <Unnamed>
-
ServerError
is an enumerated type that lists all possible response codes a server can send to a client. - ServerMain - Class in <Unnamed>
- ServerModel - Class in <Unnamed>
-
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 ServerModel
-
Constructs a
ServerModel
and initializes any collections needed for modeling the server state. - ServerModelApi - Interface in <Unnamed>
-
Defines a collection of methods that should be available in the
ServerModel
class.
T
- toString() - Method in class Broadcast
U
- updateServerModel(ServerModel) - Method in class Command
-
Processes the command and updates the server model accordingly.
- USER_NOT_IN_CHANNEL - ServerError
-
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 - ServerError
-
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 ServerError
-
Returns the enum constant of this type with the specified name.
- values() - Static method in enum ServerError
-
Returns an array containing the constants of this enum type, in the order they are declared.
All Classes All Packages