Add ProtocolParser to parse RawPacket into PrimitiveRequest using the Tokenizer #187

Merged
lars.winzer merged 6 commits from feat/protocol-parser into main 2026-03-15 16:19:05 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit a5f2ac635d - Show all commits
@@ -3,4 +3,4 @@ package ch.unibas.dmi.dbis.cs108.casono.server.network.parser;
import java.util.List; import java.util.List;
/** Created by the ProtocolParser to allow easy access to the request contents */ /** Created by the ProtocolParser to allow easy access to the request contents */
public record PrimitiveRequest(String command, List<Parameter> parameters) {} public record PrimitiveRequest(int requestId, String command, List<Parameter> parameters) {}
@@ -27,7 +27,7 @@ public class ProtocolParser {
String command = readCommand(iterator); String command = readCommand(iterator);
List<Parameter> parameters = readParameters(iterator); List<Parameter> parameters = readParameters(iterator);
return new PrimitiveRequest(command, parameters); return new PrimitiveRequest(packet.requestId(), command, parameters);
} }
/** /**