Create CommandRouter and CommandHandler to execute request #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Summary
The task of the CommandRouter is it to look up a matching CommandHandler based on the type of the Request it recieves.
The CommandHandler then executes the Request and creates an Response that is then send back to the client with the components created in https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/work_items/8.
I thought I have already created the
CommandHandlerin https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/merge_requests/32. For some reason I did implement the right thing but wrote the wrong name in the title and discription of the MR. Weird.Anyways, the implementation of the (actual)
CommandRouterandCommandHandlershould be rather straight forward. It follows the principle used in theCommandParserDispatcherandCommandParser.Context
CommandRouter, CommandHandler
Definition of Done
CommandHandlerinterface andCommandRouterclassCommandRouterat startup of serverSessionManagerandSessionReaderCommandRouterinstanceChecklist
marked this task as related to #13
marked the checklist item Linked to other issues or branches that must be completed first? as completed
assigned to @lars.winzer
created branch
feat/14-commandrouter-and-commandhandlerto address this issuemarked the checklist item Implement CommandHandler interface and CommandRouter class as completed
marked the checklist item Create instance of CommandRouter at startup of server as completed
marked the checklist item Add router field to SessionManager and SessionReader as completed
marked the checklist item Make SessionReader call route-method on CommandRouter instance as completed
added 1h 25m of time spent at 2026-03-26 12:00:00 +0100
One word: Generics in Java are weird.
And as soon as you run into type erasure ... lets leave it at that.
mentioned in merge request !50
Specified #17 to be closed instead of this one in https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/merge_requests/50