Package server
Class ConnectHandler
java.lang.Object
server.ConnectHandler
- All Implemented Interfaces:
HttpHandler
This http handler class handles the joining/connecting to a chat room.
-
Constructor Summary
ConstructorsConstructorDescriptionConnectHandler(DatabaseHandler databaseHandler, WebsocketHandler websocketHandler) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(HttpExchange httpexchange) This handles the http connect request depending on the Request type.
-
Constructor Details
-
ConnectHandler
Constructor- Parameters:
databaseHandler- handles the database connection, writing/reading.websocketHandler- handles the websocket connections.
-
-
Method Details
-
handle
This handles the http connect request depending on the Request type. Will never return any data to the requestee and 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- Specified by:
handlein interfaceHttpHandler- Parameters:
httpexchange- http exchange to be handled by the function- Throws:
IOException
-