Package server
Class DisconnectHandler
java.lang.Object
server.DisconnectHandler
- All Implemented Interfaces:
HttpHandler
This http handler class handles the leaving/disconnecting from a chat room.
-
Constructor Summary
ConstructorsConstructorDescriptionDisconnectHandler(DatabaseHandler databaseHandler, WebsocketHandler wsHandler) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(HttpExchange httpexchange) This handles the disconnect http request.
-
Constructor Details
-
DisconnectHandler
Constructor- Parameters:
databaseHandler- handles the database connection, writing/reading.wsHandler- handles the websocket connections for updating userlists in the chat.
-
-
Method Details
-
handle
This handles the disconnect http request. Will respond with statuscodes will never return any data to the requestee.
-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
-