Package server
Class GetChatHandler
java.lang.Object
server.GetChatHandler
- All Implemented Interfaces:
HttpHandler
This http handler class handles the joining/connecting to a chat room.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(HttpExchange httpexchange) This handles the get_chat http request.
-
Constructor Details
-
GetChatHandler
Constructor- Parameters:
databaseHandler- handles the database connection, writing/reading.
-
-
Method Details
-
handle
This handles the get_chat http request. Responds with a serialized json string of a Chat object Will respond with statuscodes
-200 OK
-400 Bad Request, if an exception was raised in the json parsing or addition of the user in the database
-405 Method Not Allowed, if POST request method was not used
Test with "curl http://fjenhh.me:2345/get_chat/{chatname}"- Specified by:
handlein interfaceHttpHandler- Parameters:
httpexchange- http exchange to be handled by the function- Throws:
IOException
-