Index
All Classes and Interfaces|All Packages|Serialized Form
A
- acceptAllNewClients - Variable in class nl.andrewl.concord_server.config.ServerConfig
- addChannel(Channel) - Method in class nl.andrewl.concord_server.channel.ChannelManager
- addChannel(ConcordServer, String[]) - Method in class nl.andrewl.concord_server.cli.command.ChannelCommand
- addClient(ClientThread) - Method in class nl.andrewl.concord_server.channel.Channel
-
Adds a client to this channel.
- AuthenticationService - Class in nl.andrewl.concord_server.client
-
This authentication service provides support for managing the client's authentication status, such as registering new clients, generating tokens, and logging in.
- AuthenticationService(ConcordServer, NitriteCollection) - Constructor for class nl.andrewl.concord_server.client.AuthenticationService
- authService - Variable in class nl.andrewl.concord_server.client.ClientManager
-
The service to use to authenticate incoming connections.
B
- broadcast(Message) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Sends a message to every connected client, ignoring any channels.
C
- Channel - Class in nl.andrewl.concord_server.channel
-
Represents a single communication area in which messages are sent by clients and received by all connected clients.
- Channel(ConcordServer, UUID, String) - Constructor for class nl.andrewl.concord_server.channel.Channel
- ChannelCommand - Class in nl.andrewl.concord_server.cli.command
-
Command for interacting with channels on the server.
- ChannelCommand() - Constructor for class nl.andrewl.concord_server.cli.command.ChannelCommand
- ChannelConfig() - Constructor for class nl.andrewl.concord_server.config.ServerConfig.ChannelConfig
- channelIdMap - Variable in class nl.andrewl.concord_server.channel.ChannelManager
- channelManager - Variable in class nl.andrewl.concord_server.ConcordServer
-
Manager that handles the collection of channels in this server.
- ChannelManager - Class in nl.andrewl.concord_server.channel
-
This manager is responsible for keeping track of all the channels in the server, and controlling modifications to them.
- ChannelManager(ConcordServer) - Constructor for class nl.andrewl.concord_server.channel.ChannelManager
- ChannelMoveHandler - Class in nl.andrewl.concord_server.event
-
Handles client requests to move to another channel.
- ChannelMoveHandler() - Constructor for class nl.andrewl.concord_server.event.ChannelMoveHandler
- channelNameMap - Variable in class nl.andrewl.concord_server.channel.ChannelManager
- channels - Variable in class nl.andrewl.concord_server.config.ServerConfig
- ChatHandler - Class in nl.andrewl.concord_server.event
-
This handler is responsible for taking incoming chat messages and saving them to the channel's message collection, and then relaying the new message to all clients in the channel.
- ChatHandler() - Constructor for class nl.andrewl.concord_server.event.ChatHandler
- chatHistoryDefaultCount - Variable in class nl.andrewl.concord_server.config.ServerConfig
- chatHistoryMaxCount - Variable in class nl.andrewl.concord_server.config.ServerConfig
- ChatHistoryRequestHandler - Class in nl.andrewl.concord_server.event
-
Handles client requests for sections of chat history for a particular channel.
- ChatHistoryRequestHandler() - Constructor for class nl.andrewl.concord_server.event.ChatHistoryRequestHandler
- ClientConnectionData - Record Class in nl.andrewl.concord_server.client
-
Some common data that's used when dealing with a client who has just joined the server.
- ClientConnectionData(UUID, String, String, boolean) - Constructor for record class nl.andrewl.concord_server.client.ClientConnectionData
-
Creates an instance of a
ClientConnectionData
record class. - clientId - Variable in class nl.andrewl.concord_server.client.ClientThread
- clientManager - Variable in class nl.andrewl.concord_server.ConcordServer
-
Manager that handles the collection of clients connected to this server.
- ClientManager - Class in nl.andrewl.concord_server.client
-
The client manager is responsible for managing the set of clients connected to a server.
- ClientManager(ConcordServer) - Constructor for class nl.andrewl.concord_server.client.ClientManager
-
Constructs a new client manager for the given server.
- clientNickname - Variable in class nl.andrewl.concord_server.client.ClientThread
- clients - Variable in class nl.andrewl.concord_server.client.ClientManager
-
The set of connected clients, mapped by their id.
- ClientThread - Class in nl.andrewl.concord_server.client
-
This thread is responsible for handling the connection to a single client of a server.
- ClientThread(Socket, ConcordServer) - Constructor for class nl.andrewl.concord_server.client.ClientThread
-
Constructs a new client thread.
- CollectionUtils - Class in nl.andrewl.concord_server.util
- CollectionUtils() - Constructor for class nl.andrewl.concord_server.util.CollectionUtils
- commands - Variable in class nl.andrewl.concord_server.cli.ServerCli
- compareTo(Channel) - Method in class nl.andrewl.concord_server.channel.Channel
- concord_server - module concord_server
- ConcordServer - Class in nl.andrewl.concord_server
-
The main server implementation, which handles accepting new clients.
- ConcordServer() - Constructor for class nl.andrewl.concord_server.ConcordServer
- config - Variable in class nl.andrewl.concord_server.ConcordServer
-
Server configuration data.
- config - Variable in class nl.andrewl.concord_server.DiscoveryServerPublisher
- CONFIG_FILE - Static variable in class nl.andrewl.concord_server.ConcordServer
-
The path to this server's configuration file.
- connectedClients - Variable in class nl.andrewl.concord_server.channel.Channel
-
The set of clients that are connected to this channel.
- currentChannel - Variable in class nl.andrewl.concord_server.client.ClientThread
D
- DATABASE_FILE - Static variable in class nl.andrewl.concord_server.ConcordServer
-
The path to this server's database file.
- db - Variable in class nl.andrewl.concord_server.ConcordServer
-
The database that contains all messages and other server information.
- decidePendingUser(UUID, boolean, String) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Used to accept or reject a pending user's registration.
- defaultChannel - Variable in class nl.andrewl.concord_server.config.ServerConfig
- description - Variable in class nl.andrewl.concord_server.config.ServerConfig.ChannelConfig
- description - Variable in class nl.andrewl.concord_server.config.ServerConfig
- discoveryServerPublisher - Variable in class nl.andrewl.concord_server.ConcordServer
- DiscoveryServerPublisher - Class in nl.andrewl.concord_server
-
This component is responsible for publishing the server's metadata to any discovery servers that have been defined in the server's configuration file.
- DiscoveryServerPublisher(ServerConfig) - Constructor for class nl.andrewl.concord_server.DiscoveryServerPublisher
- discoveryServers - Variable in class nl.andrewl.concord_server.config.ServerConfig
E
- ensureIndexes(NitriteCollection, Map<String, IndexType>) - Static method in class nl.andrewl.concord_server.util.CollectionUtils
-
Ensures that the given nitrite collection has exactly the given set of indexes.
- equals(Object) - Method in class nl.andrewl.concord_server.channel.Channel
- equals(Object) - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Indicates whether some other object is "equal to" this one.
- establishEncryption() - Method in class nl.andrewl.concord_server.client.ClientThread
-
Tries to establish an encrypted connection with a client.
- eventManager - Variable in class nl.andrewl.concord_server.ConcordServer
-
Manager that handles incoming messages and events by clients.
- EventManager - Class in nl.andrewl.concord_server.event
-
The event manager is responsible for the server's ability to respond to various client requests.
- EventManager(ConcordServer) - Constructor for class nl.andrewl.concord_server.event.EventManager
- executorService - Variable in class nl.andrewl.concord_server.ConcordServer
-
A general-purpose executor service that can be used to submit async tasks.
F
- filePath - Variable in class nl.andrewl.concord_server.config.ServerConfig
-
The path at which this config is stored.
- findAndAuthenticateUser(ClientLogin) - Method in class nl.andrewl.concord_server.client.AuthenticationService
- findAndAuthenticateUser(ClientSessionResume) - Method in class nl.andrewl.concord_server.client.AuthenticationService
G
- generateSessionToken(UUID) - Method in class nl.andrewl.concord_server.client.AuthenticationService
- getAsTag() - Method in class nl.andrewl.concord_server.channel.Channel
- getChannelById(UUID) - Method in class nl.andrewl.concord_server.channel.ChannelManager
- getChannelByName(String) - Method in class nl.andrewl.concord_server.channel.ChannelManager
- getChannels() - Method in class nl.andrewl.concord_server.channel.ChannelManager
- getClientById(UUID) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Tries to find a connected client with the given id.
- getConnectedClients() - Method in class nl.andrewl.concord_server.client.ClientManager
- getConnectedIds() - Method in class nl.andrewl.concord_server.client.ClientManager
- getDefaultChannel() - Method in class nl.andrewl.concord_server.channel.ChannelManager
- getMetaData() - Method in class nl.andrewl.concord_server.ConcordServer
- getOrDefault(Map<String, String>, String, Long) - Method in class nl.andrewl.concord_server.event.ChatHistoryRequestHandler
-
Helper method to get a long value or fall back to a default.
- getPendingClientById(UUID) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Tries to find a pending client with the given id.
- getPendingClients() - Method in class nl.andrewl.concord_server.client.ClientManager
- getPrivateChannel(Set<UUID>) - Method in class nl.andrewl.concord_server.channel.ChannelManager
-
Gets or creates a private channel for the given client ids to be able to communicate together.
- getPrivateChannel(UUID, UUID) - Method in class nl.andrewl.concord_server.channel.ChannelManager
-
Gets a private channel, given the id of a client who is part of the channel, and the id of the channel.
- getPrivateChannelFromDatabase(Set<UUID>) - Method in class nl.andrewl.concord_server.channel.ChannelManager
-
Gets and instantiates a private channel from information stored in the "private-channels" collection of the database, or creates it if it does not exist yet.
- getResponse(Channel, long, Long, Long) - Method in class nl.andrewl.concord_server.event.ChatHistoryRequestHandler
-
Gets a response for a standard chat history request, using a standard set of parameters.
- getUserData() - Method in class nl.andrewl.concord_server.channel.Channel
-
Gets a list of information about each user in this channel.
H
- handle(MoveToChannel, ClientThread, ConcordServer) - Method in class nl.andrewl.concord_server.event.ChannelMoveHandler
- handle(ChatHistoryRequest, ClientThread, ConcordServer) - Method in class nl.andrewl.concord_server.event.ChatHistoryRequestHandler
- handle(Chat, ClientThread, ConcordServer) - Method in class nl.andrewl.concord_server.event.ChatHandler
- handle(ConcordServer, String[]) - Method in class nl.andrewl.concord_server.cli.command.ChannelCommand
- handle(ConcordServer, String[]) - Method in class nl.andrewl.concord_server.cli.command.ListClientsCommand
- handle(ConcordServer, String[]) - Method in class nl.andrewl.concord_server.cli.command.StopCommand
- handle(ConcordServer, String[]) - Method in interface nl.andrewl.concord_server.cli.ServerCliCommand
- handle(T, ClientThread) - Method in class nl.andrewl.concord_server.event.EventManager
-
Handles a new message that was sent from a client.
- handle(T, ClientThread, ConcordServer) - Method in interface nl.andrewl.concord_server.event.MessageHandler
- handleIdRequest(ClientThread, Channel, String) - Method in class nl.andrewl.concord_server.event.ChatHistoryRequestHandler
-
Handles a request for a single message from a channel.
- handleLogin(ClientLogin, ClientThread) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Handles an attempt by a new client to login as an existing user to the server.
- handleLogOut(UUID) - Method in class nl.andrewl.concord_server.client.ClientManager
-
De-registers a client from the server, removing them from any channel they're currently in.
- handleRegistration(ClientRegistration, ClientThread) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Handles an attempt by a new client to register as a user for this server.
- handleSessionResume(ClientSessionResume, ClientThread) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Handles an attempt by a new client to login as an existing user to the server with a session token from their previous session.
- hashCode() - Method in class nl.andrewl.concord_server.channel.Channel
- hashCode() - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Returns a hash code value for this object.
- httpClient - Variable in class nl.andrewl.concord_server.DiscoveryServerPublisher
I
- id - Variable in class nl.andrewl.concord_server.channel.Channel
- id - Variable in record class nl.andrewl.concord_server.client.ClientConnectionData
-
The field for the
id
record component. - id - Variable in class nl.andrewl.concord_server.config.ServerConfig.ChannelConfig
- id() - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Returns the value of the
id
record component. - identifyClient() - Method in class nl.andrewl.concord_server.client.ClientThread
-
Initial method that attempts to obtain identification information from a newly-connected client.
- idProvider - Variable in class nl.andrewl.concord_server.ConcordServer
-
The component that generates new user and channel ids.
- IdProvider - Interface in nl.andrewl.concord_server.util
- in - Variable in class nl.andrewl.concord_server.client.ClientThread
- initializeClientConnection(ClientConnectionData, ClientThread) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Standard flow for initializing a connection to a client who has already sent their identification message, and that has been checked to be valid.
- initializePendingClientConnection(UUID, String, ClientThread) - Method in class nl.andrewl.concord_server.client.ClientManager
-
Initializes a connection to a client whose registration is pending, thus they should simply keep their connection alive, and receive a
RegistrationStatus.Type.PENDING
message, instead of aServerWelcome
. - InvalidIdentificationException - Exception in nl.andrewl.concord_server.client
-
Exception that's thrown when a client's identification information is invalid.
- InvalidIdentificationException(String) - Constructor for exception nl.andrewl.concord_server.client.InvalidIdentificationException
- isRunning() - Method in class nl.andrewl.concord_server.ConcordServer
L
- listChannels(ConcordServer) - Method in class nl.andrewl.concord_server.cli.command.ChannelCommand
- ListClientsCommand - Class in nl.andrewl.concord_server.cli.command
-
This command shows a list of all clients that are currently connected to the server.
- ListClientsCommand() - Constructor for class nl.andrewl.concord_server.cli.command.ListClientsCommand
- loadOrCreate(Path, IdProvider) - Static method in class nl.andrewl.concord_server.config.ServerConfig
M
- main(String[]) - Static method in class nl.andrewl.concord_server.ConcordServer
- mapper - Variable in class nl.andrewl.concord_server.DiscoveryServerPublisher
- maxMessageLength - Variable in class nl.andrewl.concord_server.config.ServerConfig
- messageCollection - Variable in class nl.andrewl.concord_server.channel.Channel
-
A document collection which holds all messages created in this channel, indexed on id, timestamp, message, and sender's username.
- MessageHandler<T extends nl.andrewl.concord_core.msg.Message> - Interface in nl.andrewl.concord_server.event
-
Defines a component which can handle messages of a certain type which were received from a client.
- messageHandlers - Variable in class nl.andrewl.concord_server.event.EventManager
- moveToChannel(ClientThread, Channel) - Method in class nl.andrewl.concord_server.channel.ChannelManager
-
Moves a client to the given channel.
N
- name - Variable in class nl.andrewl.concord_server.channel.Channel
- name - Variable in class nl.andrewl.concord_server.config.ServerConfig.ChannelConfig
- name - Variable in class nl.andrewl.concord_server.config.ServerConfig
- newClient - Variable in record class nl.andrewl.concord_server.client.ClientConnectionData
-
The field for the
newClient
record component. - newClient() - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Returns the value of the
newClient
record component. - newId() - Method in interface nl.andrewl.concord_server.util.IdProvider
- newId() - Method in class nl.andrewl.concord_server.util.UUIDProvider
- nl.andrewl.concord_server - package nl.andrewl.concord_server
- nl.andrewl.concord_server.channel - package nl.andrewl.concord_server.channel
- nl.andrewl.concord_server.cli - package nl.andrewl.concord_server.cli
- nl.andrewl.concord_server.cli.command - package nl.andrewl.concord_server.cli.command
- nl.andrewl.concord_server.client - package nl.andrewl.concord_server.client
- nl.andrewl.concord_server.config - package nl.andrewl.concord_server.config
- nl.andrewl.concord_server.event - package nl.andrewl.concord_server.event
- nl.andrewl.concord_server.util - package nl.andrewl.concord_server.util
O
- out - Variable in class nl.andrewl.concord_server.client.ClientThread
P
- pendingClients - Variable in class nl.andrewl.concord_server.client.ClientManager
-
The set of connected pending clients, mapped by their id.
- port - Variable in class nl.andrewl.concord_server.config.ServerConfig
- privateChannelCollection - Variable in class nl.andrewl.concord_server.channel.ChannelManager
- privateChannels - Variable in class nl.andrewl.concord_server.channel.ChannelManager
- publish() - Method in class nl.andrewl.concord_server.DiscoveryServerPublisher
R
- random(int) - Static method in class nl.andrewl.concord_server.util.StringUtils
- read(Document) - Method in class nl.andrewl.concord_server.event.ChatHistoryRequestHandler
-
Helper method to read a
Chat
from a document retrieved from a collection. - registerNewClient(ClientRegistration) - Method in class nl.andrewl.concord_server.client.AuthenticationService
- registerPendingClient(ClientRegistration) - Method in class nl.andrewl.concord_server.client.AuthenticationService
- removeChannel(Channel) - Method in class nl.andrewl.concord_server.channel.ChannelManager
- removeChannel(ConcordServer, String[]) - Method in class nl.andrewl.concord_server.cli.command.ChannelCommand
- removeClient(ClientThread) - Method in class nl.andrewl.concord_server.channel.Channel
-
Removes a client from this channel.
- removeExpiredSessionTokens() - Method in class nl.andrewl.concord_server.client.AuthenticationService
- run() - Method in class nl.andrewl.concord_server.cli.ServerCli
- run() - Method in class nl.andrewl.concord_server.client.ClientThread
- run() - Method in class nl.andrewl.concord_server.ConcordServer
- running - Variable in class nl.andrewl.concord_server.client.ClientThread
- running - Variable in class nl.andrewl.concord_server.ConcordServer
-
Running flag that's used to signal this server's thread to shutdown.
S
- save() - Method in class nl.andrewl.concord_server.config.ServerConfig
- scheduledExecutorService - Variable in class nl.andrewl.concord_server.ConcordServer
- sendMessage(Message) - Method in class nl.andrewl.concord_server.channel.Channel
-
Sends a message to all clients that are currently connected to this channel.
- sendToClient(byte[]) - Method in class nl.andrewl.concord_server.client.ClientThread
-
Sends the given bytes to the client.
- sendToClient(Message) - Method in class nl.andrewl.concord_server.client.ClientThread
-
Sends the given message to the client.
- serializer - Variable in class nl.andrewl.concord_server.ConcordServer
-
A utility serializer that's mostly used when preparing a message to broadcast to a set of users, which is more efficient than having each individual client thread serialize the same message before sending it.
- server - Variable in class nl.andrewl.concord_server.channel.Channel
- server - Variable in class nl.andrewl.concord_server.channel.ChannelManager
- server - Variable in class nl.andrewl.concord_server.cli.ServerCli
- server - Variable in class nl.andrewl.concord_server.client.AuthenticationService
- server - Variable in class nl.andrewl.concord_server.client.ClientManager
-
A reference to the server that this client manager is for.
- server - Variable in class nl.andrewl.concord_server.client.ClientThread
- server - Variable in class nl.andrewl.concord_server.event.EventManager
- ServerCli - Class in nl.andrewl.concord_server.cli
-
Simple command-line interface that's available when running the server.
- ServerCli(ConcordServer) - Constructor for class nl.andrewl.concord_server.cli.ServerCli
- ServerCliCommand - Interface in nl.andrewl.concord_server.cli
- ServerConfig - Class in nl.andrewl.concord_server.config
- ServerConfig() - Constructor for class nl.andrewl.concord_server.config.ServerConfig
- ServerConfig.ChannelConfig - Class in nl.andrewl.concord_server.config
- serverSocket - Variable in class nl.andrewl.concord_server.ConcordServer
-
This server's socket, used to accept new client connections.
- sessionToken - Variable in record class nl.andrewl.concord_server.client.ClientConnectionData
-
The field for the
sessionToken
record component. - sessionToken() - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Returns the value of the
sessionToken
record component. - sessionTokenCollection - Variable in class nl.andrewl.concord_server.client.AuthenticationService
- shutdown() - Method in class nl.andrewl.concord_server.client.ClientThread
-
Shuts down this client thread, closing the underlying socket and setting
ClientThread.running
to false so that the main thread loop will exit shortly. - shutdown() - Method in class nl.andrewl.concord_server.ConcordServer
-
Shuts down the server cleanly by doing the following things: Disconnecting all clients. Shutting down any executor services. Flushing and compacting the message database. Flushing the server configuration one last time.
- socket - Variable in class nl.andrewl.concord_server.client.ClientThread
- stop() - Method in class nl.andrewl.concord_server.ConcordServer
-
Stops the server.
- StopCommand - Class in nl.andrewl.concord_server.cli.command
-
This command forcibly stops the server, disconnecting any clients.
- StopCommand() - Constructor for class nl.andrewl.concord_server.cli.command.StopCommand
- StringUtils - Class in nl.andrewl.concord_server.util
- StringUtils() - Constructor for class nl.andrewl.concord_server.util.StringUtils
T
- toData() - Method in class nl.andrewl.concord_server.client.ClientThread
- toString() - Method in class nl.andrewl.concord_server.channel.Channel
- toString() - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Returns a string representation of this record class.
- toString() - Method in class nl.andrewl.concord_server.client.ClientThread
U
- userCollection - Variable in class nl.andrewl.concord_server.client.AuthenticationService
- userCollection - Variable in class nl.andrewl.concord_server.client.ClientManager
-
The nitrite collection containing user data.
- username - Variable in record class nl.andrewl.concord_server.client.ClientConnectionData
-
The field for the
username
record component. - username() - Method in record class nl.andrewl.concord_server.client.ClientConnectionData
-
Returns the value of the
username
record component. - UUIDProvider - Class in nl.andrewl.concord_server.util
- UUIDProvider() - Constructor for class nl.andrewl.concord_server.util.UUIDProvider
All Classes and Interfaces|All Packages|Serialized Form