Added more javadocs!

This commit is contained in:
Andrew Lalis 2021-09-28 23:55:08 +02:00
parent 108cc556d7
commit b1fb2cdfb0
2 changed files with 33 additions and 0 deletions

View File

@ -27,10 +27,24 @@ import java.util.concurrent.TimeUnit;
* The main server implementation, which handles accepting new clients. * The main server implementation, which handles accepting new clients.
*/ */
public class ConcordServer implements Runnable { public class ConcordServer implements Runnable {
/**
* The path to this server's configuration file.
*/
private static final Path CONFIG_FILE = Path.of("server-config.json"); private static final Path CONFIG_FILE = Path.of("server-config.json");
/**
* The path to this server's database file.
*/
private static final Path DATABASE_FILE = Path.of("concord-server.db"); private static final Path DATABASE_FILE = Path.of("concord-server.db");
/**
* Running flag that's used to signal this server's thread to shutdown.
*/
private volatile boolean running; private volatile boolean running;
/**
* This server's socket, used to accept new client connections.
*/
private final ServerSocket serverSocket; private final ServerSocket serverSocket;
/** /**

View File

@ -23,10 +23,29 @@ import java.util.stream.Collectors;
* to a server. * to a server.
*/ */
public class ClientManager { public class ClientManager {
/**
* A reference to the server that this client manager is for.
*/
private final ConcordServer server; private final ConcordServer server;
/**
* The set of connected clients, mapped by their id.
*/
private final Map<UUID, ClientThread> clients; private final Map<UUID, ClientThread> clients;
/**
* The set of connected pending clients, mapped by their id.
*/
private final Map<UUID, ClientThread> pendingClients; private final Map<UUID, ClientThread> pendingClients;
/**
* The nitrite collection containing user data.
*/
private final NitriteCollection userCollection; private final NitriteCollection userCollection;
/**
* The service to use to authenticate incoming connections.
*/
private final AuthenticationService authService; private final AuthenticationService authService;
/** /**