From 259173a809ddb3441508db3f366ce7be9dd556d7 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 13:39:07 +0200 Subject: [PATCH 01/22] Docs: Initial protocol document outlining execution pipeline with possible error responses --- .../networking/commands/protocol-document.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 documents/docs/networking/commands/protocol-document.md diff --git a/documents/docs/networking/commands/protocol-document.md b/documents/docs/networking/commands/protocol-document.md new file mode 100644 index 0000000..489a1ce --- /dev/null +++ b/documents/docs/networking/commands/protocol-document.md @@ -0,0 +1,105 @@ +# Protocol Document +This document describes the protocol for client-server communication in our application. It defines the structure of requests and responses, the supported commands along with thier request parameters, response formats and possible errors. + + +# Table of Contents +- [Protocol Document](#protocol-document) +- [Table of Contents](#table-of-contents) +- [General structure of requests](#general-structure-of-requests) +- [Preconditions](#preconditions) + - [Parsing](#parsing) + - [Error Response](#error-response) + - [Command dispatching](#command-dispatching) + - [Error Response](#error-response-1) + - [Command parsing](#command-parsing) + - [Error Response](#error-response-2) +- [Pre executions checks](#pre-executions-checks) +- [Commands](#commands) + + + +# General structure of requests +As mentioned before, our protocol is based on POP3. +Each command is represented as a single line of text, starting with the command name followed by parameters. The server responds with a status line indicating success or failure, followed by the body. + +Requests can have parameters that provide additional information for the command. Parameters are key-value pairs separated by a equal sign (`=`). + +Responses are collections of key-value pairs, containing either a value or another collection, allowing for nested structures. +Each collection is ended with the `END` keyword. + + + +# Preconditions +The serverside pipeline to process incomming requests consists of multiple stages. +Each of these stages can yield an error response if the request does not meet the requirements of that stage. + +## Parsing +One of these stages is the parsing. It is responsible for parsing the raw request into a structured format that can be easily processed by the command handlers. It validates the syntax of the request aswell. + +### Error Response +| Code | Discription | +| :-------------- | :---------------------------------------------------------------------------------------------- | +| `PARSING_ERROR` | The body of the request contains syntax errors (see message field of response for more details) | + + +## Command dispatching +After the request has been successfully parsed, the next stage is to dispatch the `PrimitiveRequest` to the appropriate `CommandParser`. This is done by the `CommandDispatcherDispatcher`, which uses the command name to determine which parser to use. + +### Error Response +| Code | Discription | +| :---------------- | :---------------------------------------------------------------- | +| `UNKNOWN_COMMAND` | The command is unknown to this server. No parser has been defined | + + +## Command parsing +Once the `PrimitiveRequest` has been dispatched to the appropriate `CommandParser`, the parser is responsible for parsing the parameters of the request and creating a `Request` that can be executed by the responsible `CommandHandler`. + +### Error Response +| Code | Discription | +| :------------------ | :------------------------------------------------------------------------------------------------ | +| `MISSING_PARAMETER` | A required parameter is missing from the request (see message field of response for more details) | + + + +# Pre executions checks +Pre-execution checks are reusable validation steps that can be registered on command handlers. +They are implemented as `HandlerCheck` instances and are executed by the `CommandHandlerExecutor` before the handler's main logic is invoked. + + + + + +# Commands +Commands are the core of our protocol, representing the various actions that clients can request from the server. Each command has a unique name and may require specific parameters in addition to pre-execution checks. +The server processes these commands and responds accordingly. + + From 0afa1d65e92571ab954ddb0d4b859f9a07cd524a Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 13:39:26 +0200 Subject: [PATCH 02/22] Docs: Link to protocol document from section README --- documents/docs/networking/commands/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documents/docs/networking/commands/README.md b/documents/docs/networking/commands/README.md index 391ec9d..3a85340 100644 --- a/documents/docs/networking/commands/README.md +++ b/documents/docs/networking/commands/README.md @@ -17,6 +17,10 @@ The concrete implementations for each command live in `app/commands/` and are wi - [Command Infrastructure](./commands-deep-dive.md) - Technical deep-dive into the `CommandParser`, `CommandParserDispatcher`, `CommandHandler`, `CommandRouter`, `Request`, and the response hierarchy. +### Protocol document +- [Protocol Document](./protocol-document.md) - + List of all supported commands by the server, along with descriptions, required pre-execution checks, and an example for both request and response. + ## Key Concepts **Each command is self-contained.** A command's Parser, Request, Handler, and Response all live in the same package under `app/commands//`. From 8bcd4dd0333a9fe125de6647271a4d148cecd033 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 14:09:24 +0200 Subject: [PATCH 03/22] Docs: Update copy n' paste command section with enum example, and error response --- .../docs/networking/commands/protocol-document.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/documents/docs/networking/commands/protocol-document.md b/documents/docs/networking/commands/protocol-document.md index 489a1ce..b3ca069 100644 --- a/documents/docs/networking/commands/protocol-document.md +++ b/documents/docs/networking/commands/protocol-document.md @@ -93,13 +93,23 @@ Description of the command, what it does and when it should be used. | :------------- | :----- | :---------------------------------- | :-------------------- | | `param1` | `type` | If the parameter is optional or not | Description of param1 | -### Response +### Success Response | Field | Type | Description | | :------- | :------------------ | :-------------------- | | `field1` | `type` | Description of field1 | | `field2` | `Collection` | | +| `field3` | `Enum` | Description of field3 | | Fields of `type2` | Type | Description | | :---------------- | :----- | :-------------------- | | `field1` | `type` | Description of field1 | + +| Members of `type` | Description | +| :---------------- | :--------------------- | +| `MEMBER1` | Description of member1 | + +### Error Response +| Code | Discription | +| :----------- | :----------------------- | +| `ERROR_CODE` | Description of the error | --> From 62bc75b46b361ef4b8c81203dd86f5ac9d3bf2e7 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 14:21:18 +0200 Subject: [PATCH 04/22] Docs: Write documentation for already existing commands and pre-execution checks --- .../networking/commands/protocol-document.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/documents/docs/networking/commands/protocol-document.md b/documents/docs/networking/commands/protocol-document.md index b3ca069..5a162a2 100644 --- a/documents/docs/networking/commands/protocol-document.md +++ b/documents/docs/networking/commands/protocol-document.md @@ -14,7 +14,27 @@ This document describes the protocol for client-server communication in our appl - [Command parsing](#command-parsing) - [Error Response](#error-response-2) - [Pre executions checks](#pre-executions-checks) + - [UserLoggedInCheck](#userloggedincheck) + - [Error Response](#error-response-3) - [Commands](#commands) + - [PING command](#ping-command) + - [Required pre-execution checks](#required-pre-execution-checks) + - [Request Parameters](#request-parameters) + - [Success Response](#success-response) + - [CHECK\_USERNAME command](#check_username-command) + - [Required pre-execution checks](#required-pre-execution-checks-1) + - [Request Parameters](#request-parameters-1) + - [Success Response](#success-response-1) + - [LOGIN comamnd](#login-comamnd) + - [Required pre-execution checks](#required-pre-execution-checks-2) + - [Request Parameters](#request-parameters-2) + - [Success Response](#success-response-2) + - [Error Response](#error-response-4) + - [LOGOUT command](#logout-command) + - [Required pre-execution checks](#required-pre-execution-checks-3) + - [Request Parameters](#request-parameters-3) + - [Success Response](#success-response-3) + - [Error Response](#error-response-5) @@ -75,6 +95,14 @@ Description of the check, what it does and when it should be used. | `ERROR_CODE` | Description of the error | --> +## UserLoggedInCheck +The `UserLoggedInCheck` is a common pre-execution check that verifies whether the user is logged in (i.e. has a user associated with his session). + +### Error Response +| Code | Discription | +| :------------------- | :------------------------ | +| `USER_NOT_LOGGED_IN` | The user is not logged in | + # Commands @@ -113,3 +141,78 @@ Description of the command, what it does and when it should be used. | :----------- | :----------------------- | | `ERROR_CODE` | Description of the error | --> + +## PING command +The `PING` command is a simple command that can be used to check if the server is responsive. + +### Required pre-execution checks +None. + +### Request Parameters +No parameters. + +### Success Response +No response fields. + + +## CHECK_USERNAME command +The `CHECK_USERNAME` command is used to check if a username is already taken by another user. Additional users can still login with the same username, but thier name will be subsituted with a suffix. + +### Required pre-execution checks +None. + +### Request Parameters +| Parameter Name | Type | Optional | Description | +| :------------- | :------- | :------- | :------------------------------------- | +| `USERNAME` | `String` | no | The username to check for availability | + +### Success Response +| Field | Type | Description | +| :------- | :--------------------------- | :---------------------------------------------------------------------- | +| `STATUS` | `Enum` | Member of enum indicating if the username is available or already taken | + +| Members of `UsernameAvailability` | Description | +| :-------------------------------- | :------------------------- | +| `FREE` | Username is available | +| `TAKEN` | Username is already in use | + + +## LOGIN comamnd +The `LOGIN` command is used to log in a user with a specified username. If the username is already taken by another user, the server will append a suffix to the username to make it unique. + +### Required pre-execution checks +None. + +### Request Parameters +| Parameter Name | Type | Optional | Description | +| :------------- | :------- | :------- | :----------------------------------- | +| `USERNAME` | `String` | no | The username to create the user with | + +### Success Response +| Field | Type | Description | +| :--------- | :---------------------------------------------------------------------- | :-------------------------------------------------------------------- | +| `USERNAME` | `String` | Username of the newly created user, can differ from the requested one | +| `ID` | [`UUID`](https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html) | The ID of the created user | + +### Error Response +| Code | Discription | +| :------------------ | :----------------------------------------------------------------------------- | +| `ALREADY_LOGGED_IN` | The session is already associated with a user, logging in again is prohibited. | + + +## LOGOUT command +Description of the command, what it does and when it should be used. + +### Required pre-execution checks +None. + +### Request Parameters +No parameters. + +### Success Response +No response fields. + +### Error Response +| Code | Discription | +| :----------------- | :--------------------------------------------------------------- | +| `NO_USER_ASSOCIATED` | The session has no user associated, logging out is not possible. | From 2350ddf1c434c0f8731751e78b2b55a6fde456f2 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 14:34:32 +0200 Subject: [PATCH 05/22] Docs: Add examples to copy n' paste exmaple and all existing documented commands --- .../networking/commands/protocol-document.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/documents/docs/networking/commands/protocol-document.md b/documents/docs/networking/commands/protocol-document.md index 5a162a2..356e3c5 100644 --- a/documents/docs/networking/commands/protocol-document.md +++ b/documents/docs/networking/commands/protocol-document.md @@ -21,20 +21,28 @@ This document describes the protocol for client-server communication in our appl - [Required pre-execution checks](#required-pre-execution-checks) - [Request Parameters](#request-parameters) - [Success Response](#success-response) + - [Example Request](#example-request) + - [Example Response](#example-response) - [CHECK\_USERNAME command](#check_username-command) - [Required pre-execution checks](#required-pre-execution-checks-1) - [Request Parameters](#request-parameters-1) - [Success Response](#success-response-1) + - [Example Request](#example-request-1) + - [Example Response](#example-response-1) - [LOGIN comamnd](#login-comamnd) - [Required pre-execution checks](#required-pre-execution-checks-2) - [Request Parameters](#request-parameters-2) - [Success Response](#success-response-2) - [Error Response](#error-response-4) + - [Example Request](#example-request-2) + - [Example Response](#example-response-2) - [LOGOUT command](#logout-command) - [Required pre-execution checks](#required-pre-execution-checks-3) - [Request Parameters](#request-parameters-3) - [Success Response](#success-response-3) - [Error Response](#error-response-5) + - [Example Request](#example-request-3) + - [Example Response](#example-response-3) @@ -140,6 +148,23 @@ Description of the command, what it does and when it should be used. | Code | Discription | | :----------- | :----------------------- | | `ERROR_CODE` | Description of the error | + +### Example Request +``` +COMMAND_NAME PARAM1='value1' PARAM2='value2' +``` + +### Example Response +``` ++OK + KEY1=VALUE1 + FIELDS + FIELD + NESTED_KEY=NESTED_VALUE + END + KEY2=VALUE2 +END +``` --> ## PING command @@ -154,6 +179,17 @@ No parameters. ### Success Response No response fields. +### Example Request +``` +PING +``` + +### Example Response +``` ++OK +END +``` + ## CHECK_USERNAME command The `CHECK_USERNAME` command is used to check if a username is already taken by another user. Additional users can still login with the same username, but thier name will be subsituted with a suffix. @@ -176,6 +212,17 @@ None. | `FREE` | Username is available | | `TAKEN` | Username is already in use | +### Example Request +``` +CHECK_USERNAME USERNAME='Lars' +``` + +### Example Response +``` ++OK + STATUS=FREE +END +``` ## LOGIN comamnd The `LOGIN` command is used to log in a user with a specified username. If the username is already taken by another user, the server will append a suffix to the username to make it unique. @@ -199,6 +246,19 @@ None. | :------------------ | :----------------------------------------------------------------------------- | | `ALREADY_LOGGED_IN` | The session is already associated with a user, logging in again is prohibited. | +### Example Request +``` +LOGIN USERNAME='Lars' +``` + +### Example Response +``` ++OK + USERNAME='Lars_1234' + ID=e47a671e-2b2a-42df-bb82-953fe2ebd307 +END +``` + ## LOGOUT command Description of the command, what it does and when it should be used. @@ -216,3 +276,14 @@ No response fields. | Code | Discription | | :----------------- | :--------------------------------------------------------------- | | `NO_USER_ASSOCIATED` | The session has no user associated, logging out is not possible. | + +### Example Request +``` +LOGOUT +``` + +### Example Response +``` ++OK +END +``` From 5e15ad359d9386af64b929f853f71d41beb59422 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 14:38:39 +0200 Subject: [PATCH 06/22] Docs: Correct spelling and grammar --- .../networking/commands/protocol-document.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/documents/docs/networking/commands/protocol-document.md b/documents/docs/networking/commands/protocol-document.md index 356e3c5..a546a97 100644 --- a/documents/docs/networking/commands/protocol-document.md +++ b/documents/docs/networking/commands/protocol-document.md @@ -1,5 +1,5 @@ # Protocol Document -This document describes the protocol for client-server communication in our application. It defines the structure of requests and responses, the supported commands along with thier request parameters, response formats and possible errors. +This document describes the protocol for client-server communication in our application. It defines the structure of requests and responses, the supported commands along with their request parameters, response formats, and possible errors. # Table of Contents @@ -13,7 +13,7 @@ This document describes the protocol for client-server communication in our appl - [Error Response](#error-response-1) - [Command parsing](#command-parsing) - [Error Response](#error-response-2) -- [Pre executions checks](#pre-executions-checks) +- [Pre-execution checks](#pre-execution-checks) - [UserLoggedInCheck](#userloggedincheck) - [Error Response](#error-response-3) - [Commands](#commands) @@ -29,7 +29,7 @@ This document describes the protocol for client-server communication in our appl - [Success Response](#success-response-1) - [Example Request](#example-request-1) - [Example Response](#example-response-1) - - [LOGIN comamnd](#login-comamnd) + - [LOGIN command](#login-command) - [Required pre-execution checks](#required-pre-execution-checks-2) - [Request Parameters](#request-parameters-2) - [Success Response](#success-response-2) @@ -44,13 +44,13 @@ This document describes the protocol for client-server communication in our appl - [Example Request](#example-request-3) - [Example Response](#example-response-3) - + # General structure of requests As mentioned before, our protocol is based on POP3. Each command is represented as a single line of text, starting with the command name followed by parameters. The server responds with a status line indicating success or failure, followed by the body. -Requests can have parameters that provide additional information for the command. Parameters are key-value pairs separated by a equal sign (`=`). +Requests can have parameters that provide additional information for the command. Parameters are key-value pairs separated by an equal sign (`=`). Responses are collections of key-value pairs, containing either a value or another collection, allowing for nested structures. Each collection is ended with the `END` keyword. @@ -58,14 +58,14 @@ Each collection is ended with the `END` keyword. # Preconditions -The serverside pipeline to process incomming requests consists of multiple stages. +The serverside pipeline to process incoming requests consists of multiple stages. Each of these stages can yield an error response if the request does not meet the requirements of that stage. ## Parsing -One of these stages is the parsing. It is responsible for parsing the raw request into a structured format that can be easily processed by the command handlers. It validates the syntax of the request aswell. +One of these stages is the parsing. It is responsible for parsing the raw request into a structured format that can be easily processed by the command handlers. It validates the syntax of the request as well. ### Error Response -| Code | Discription | +| Code | Description | | :-------------- | :---------------------------------------------------------------------------------------------- | | `PARSING_ERROR` | The body of the request contains syntax errors (see message field of response for more details) | @@ -74,7 +74,7 @@ One of these stages is the parsing. It is responsible for parsing the raw reques After the request has been successfully parsed, the next stage is to dispatch the `PrimitiveRequest` to the appropriate `CommandParser`. This is done by the `CommandDispatcherDispatcher`, which uses the command name to determine which parser to use. ### Error Response -| Code | Discription | +| Code | Description | | :---------------- | :---------------------------------------------------------------- | | `UNKNOWN_COMMAND` | The command is unknown to this server. No parser has been defined | @@ -83,13 +83,13 @@ After the request has been successfully parsed, the next stage is to dispatch th Once the `PrimitiveRequest` has been dispatched to the appropriate `CommandParser`, the parser is responsible for parsing the parameters of the request and creating a `Request` that can be executed by the responsible `CommandHandler`. ### Error Response -| Code | Discription | +| Code | Description | | :------------------ | :------------------------------------------------------------------------------------------------ | | `MISSING_PARAMETER` | A required parameter is missing from the request (see message field of response for more details) | -# Pre executions checks +# Pre-execution checks Pre-execution checks are reusable validation steps that can be registered on command handlers. They are implemented as `HandlerCheck` instances and are executed by the `CommandHandlerExecutor` before the handler's main logic is invoked. @@ -98,7 +98,7 @@ They are implemented as `HandlerCheck` instances and are executed by the `Comman Description of the check, what it does and when it should be used. ### Response if not met -| Code | Discription | +| Code | Description | | :----------- | :----------------------- | | `ERROR_CODE` | Description of the error | --> @@ -107,7 +107,7 @@ Description of the check, what it does and when it should be used. The `UserLoggedInCheck` is a common pre-execution check that verifies whether the user is logged in (i.e. has a user associated with his session). ### Error Response -| Code | Discription | +| Code | Description | | :------------------- | :------------------------ | | `USER_NOT_LOGGED_IN` | The user is not logged in | @@ -119,7 +119,7 @@ The server processes these commands and responds accordingly. @@ -287,3 +294,51 @@ LOGOUT +OK END ``` + +## LIST_USERS command +The `LIST_USERS` command is used to retrieve a list of all currently logged-in users. + +### Required pre-execution checks +None. + +### Request Parameters +No parameters. + +### Success Response +| Field | Type | Description | +| :------ | :----------------- | :--------------------------------------- | +| `USERS` | `Collection` | Collection of all users currently online | + +| Fields of `User` | Type | Description | +| :--------------- | :---------------------------------------------------------------------- | :-------------------------------------------------------------------- | +| `USERNAME` | `String` | Username of the newly created user, can differ from the requested one | +| `ID` | [`UUID`](https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html) | The ID of the created user | + + +### Error Response +None. + +### Example Request +``` +LIST_USERS +``` + +### Example Response +``` ++OK + USERS + USER + USERNAME=Lars_001 + ID=56765d0f-8cd3-4eec-91b2-7e36265c1a5d + END + USER + USERNAME=Lars_002 + ID=b7bbd9b3-0d49-4c92-8306-b1c8506d2ff0 + END + USER + USERNAME=Lars + ID=982bc78e-547f-495a-a821-433a3603f92c + END + END +END +``` \ No newline at end of file From afef96ce2198c315e2d15951d5b712244e8eee4f Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 19:07:08 +0200 Subject: [PATCH 15/22] Docs: Write JavaDoc for newly added components --- .../commands/list_users/ListUsersHandler.java | 18 ++++++++++++++++++ .../commands/list_users/ListUsersParser.java | 7 +++++++ .../commands/list_users/ListUsersRequest.java | 7 +++++++ .../commands/list_users/ListUsersResponse.java | 7 +++++++ 4 files changed, 39 insertions(+) diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersHandler.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersHandler.java index 69a986e..2ad7fe2 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersHandler.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersHandler.java @@ -6,14 +6,32 @@ import ch.unibas.dmi.dbis.cs108.casono.server.network.command.execution.CommandH import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.response.dispatcher.ResponseDispatcher; import java.util.Collection; +/** + * Handles {@link ListUsersRequest}s by retrieving all users from the {@link UserRegistry} and + * dispatching a {@link ListUsersResponse} containing the list of users. + */ public class ListUsersHandler extends CommandHandler { private final UserRegistry userRegistry; + /** + * Creates a new handler for listing all users + * + * @param responseDispatcher the dispatcher used to send the response + * @param userRegistry the registry used to look up existing users + */ public ListUsersHandler(ResponseDispatcher responseDispatcher, UserRegistry userRegistry) { super(responseDispatcher); this.userRegistry = userRegistry; } + /** + * Executes the list users request + * + *

All users are retrieved from the {@link UserRegistry} and returned in a {@link + * ListUsersResponse}. + * + * @param request the request to execute + */ @Override public void execute(ListUsersRequest request) { Collection users = userRegistry.getAllUsers(); diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersParser.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersParser.java index 9cb9bb8..f55149e 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersParser.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersParser.java @@ -3,7 +3,14 @@ package ch.unibas.dmi.dbis.cs108.casono.server.app.commands.list_users; import ch.unibas.dmi.dbis.cs108.casono.server.network.command.parsing.CommandParser; import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.PrimitiveRequest; +/** Parses a primitive request into a {@link ListUsersRequest}. */ public class ListUsersParser implements CommandParser { + /** + * Parses a primitive request into a ListUsersRequest. + * + * @param primitiveRequest the request to parse + * @return the created {@link ListUsersRequest} + */ @Override public ListUsersRequest parse(PrimitiveRequest primitiveRequest) { return new ListUsersRequest(primitiveRequest.context()); diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersRequest.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersRequest.java index 9eedbb9..9ed8fdd 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersRequest.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersRequest.java @@ -3,7 +3,14 @@ package ch.unibas.dmi.dbis.cs108.casono.server.app.commands.list_users; import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.Request; import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.RequestContext; +/** Request implementation used to retrieve all existing users from the server. */ public class ListUsersRequest extends Request { + /** + * Constructs a new ListUsersRequest with the given context + * + * @param context the {@link RequestContext} containing information for responding to the + * request + */ public ListUsersRequest(RequestContext context) { super(context); } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersResponse.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersResponse.java index bedeb5a..4e48aaf 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersResponse.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/list_users/ListUsersResponse.java @@ -6,7 +6,14 @@ import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.response.SuccessR import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.response.builder.ResponseBody; import java.util.Collection; +/** Response containing a list of all active users on the server */ public class ListUsersResponse extends SuccessResponse { + /** + * Creates a new ListUsersResponse containing the given list of users + * + * @param context the {@link RequestContext} associated with the request + * @param users the collection of users currently active on the server + */ public ListUsersResponse(RequestContext context, Collection users) { super( context, From 4071be33410744880f27e6cf3ebb9bd7a5fbe137 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Thu, 9 Apr 2026 19:14:15 +0200 Subject: [PATCH 16/22] Fix: Change execute method in CommandHandler to be abstract --- .../casono/server/network/command/execution/CommandHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/command/execution/CommandHandler.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/command/execution/CommandHandler.java index f0f8b97..4e82e3a 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/command/execution/CommandHandler.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/command/execution/CommandHandler.java @@ -52,5 +52,5 @@ public abstract class CommandHandler { * * @param request the request to execute, of type T */ - public void execute(T request) {} + public abstract void execute(T request); } From 77dad54c848f2ba0c6d5cdc845f214b651b0f874 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Fri, 10 Apr 2026 10:14:03 +0200 Subject: [PATCH 17/22] Add: Milestone achievement gitlab issue template --- .gitlab/issue_templates/Milestone Achievement.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .gitlab/issue_templates/Milestone Achievement.md diff --git a/.gitlab/issue_templates/Milestone Achievement.md b/.gitlab/issue_templates/Milestone Achievement.md new file mode 100644 index 0000000..affa93c --- /dev/null +++ b/.gitlab/issue_templates/Milestone Achievement.md @@ -0,0 +1,16 @@ +## Milestone Achievement + + +### Milestone category + + +### Milestone title + + +### Rewarded points on completion + + +### Description of milestone + + +/label ~achievement \ No newline at end of file From 35297775dc121ffc018cf03c69df3e7add32a7b1 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Fri, 10 Apr 2026 10:28:10 +0200 Subject: [PATCH 18/22] Add: Milestone Achievements section to contribution guidelines --- CONTRIBUTING.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92a520a..c6028a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,7 @@ Since this project is part of a course at the University of Basel, the [Code of - [Creating an issue](#creating-an-issue) - [During implementation](#during-implementation) - [Collaborative work](#collaborative-work) + - [Milestone Achievements](#milestone-achievements) - [Git Workflow](#git-workflow) - [Creating a branch](#creating-a-branch) - [Working on a branch](#working-on-a-branch) @@ -49,6 +50,20 @@ Issue or Task in GitLab **before** any implementation begins. centrally visible and searchable. - Before starting work that overlaps with an existing issue, check its comment thread first to avoid duplicating effort. +### Milestone Achievements +For every process and product-related milestone achievement, there is a dedicated milestone task. + +- **Do not create a branch directly from a milestone task.** +- Instead, create a normal implementation task (using the regular task template) and reference the milestone task there. +- In the merge request, reference the milestone task again. +- If the milestone condition is fully met, you may use `Closing #` to close the milestone task. +- If it is only partially addressed, use `Relates to #` or `Contributes to #` so the milestone task stays open. + +Milestone tasks may, but do not have to, be assigned to a specific person. + +- If multiple people are involved, contribution is tracked through linked tasks that reference the milestone task. +- For small topics, a Milestone Achievement may be assigned to one person. Others should only contribute on request and should not modify components introduced under that achievement without coordination. + ## Git Workflow We use a **feature branch -> main** strategy. The `main` branch is always in a releasable state. From 09e8822bef93a30c28339fd2d1dc61eaedc783cb Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Fri, 10 Apr 2026 10:34:37 +0200 Subject: [PATCH 19/22] Refactor: Swap title and category header and cut header length --- .gitlab/issue_templates/Milestone Achievement.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/issue_templates/Milestone Achievement.md b/.gitlab/issue_templates/Milestone Achievement.md index affa93c..465441f 100644 --- a/.gitlab/issue_templates/Milestone Achievement.md +++ b/.gitlab/issue_templates/Milestone Achievement.md @@ -1,12 +1,12 @@ ## Milestone Achievement -### Milestone category - - -### Milestone title +### Title +### Category + + ### Rewarded points on completion From 938ef71c2a0b3ea3ff5b94c529758dc9cee83ca5 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Fri, 10 Apr 2026 10:35:25 +0200 Subject: [PATCH 20/22] Revert "Refactor: Swap title and category header and cut header length" This reverts commit 09e8822bef93a30c28339fd2d1dc61eaedc783cb. --- .gitlab/issue_templates/Milestone Achievement.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/issue_templates/Milestone Achievement.md b/.gitlab/issue_templates/Milestone Achievement.md index 465441f..affa93c 100644 --- a/.gitlab/issue_templates/Milestone Achievement.md +++ b/.gitlab/issue_templates/Milestone Achievement.md @@ -1,12 +1,12 @@ ## Milestone Achievement -### Title - - -### Category +### Milestone category +### Milestone title + + ### Rewarded points on completion From 5ed455c20d67917a80e04fcc9d89fa0cf18b7cd4 Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Fri, 10 Apr 2026 10:48:52 +0200 Subject: [PATCH 21/22] Refactor: Cut header length --- .gitlab/issue_templates/Milestone Achievement.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab/issue_templates/Milestone Achievement.md b/.gitlab/issue_templates/Milestone Achievement.md index affa93c..93de10c 100644 --- a/.gitlab/issue_templates/Milestone Achievement.md +++ b/.gitlab/issue_templates/Milestone Achievement.md @@ -1,10 +1,10 @@ ## Milestone Achievement -### Milestone category +### Category -### Milestone title +### Title ### Rewarded points on completion @@ -13,4 +13,4 @@ ### Description of milestone -/label ~achievement \ No newline at end of file +/label ~achievement From 8f4ce1db8086bd06194d01eb481aab9f665630be Mon Sep 17 00:00:00 2001 From: Lars Simon Winzer Date: Fri, 10 Apr 2026 11:25:09 +0200 Subject: [PATCH 22/22] Fix: Change visibility of ThrowingParser from package-private to public --- .../network/protocol/request/accessor/ThrowingParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/protocol/request/accessor/ThrowingParser.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/protocol/request/accessor/ThrowingParser.java index 688304b..b851e85 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/protocol/request/accessor/ThrowingParser.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/protocol/request/accessor/ThrowingParser.java @@ -6,7 +6,7 @@ package ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.accessor * @param target type produced by the parser */ @FunctionalInterface -interface ThrowingParser { +public interface ThrowingParser { /** * Parses the provided raw parameter value. *