- java.lang.Object
-
- net.morimekta.tiny.server.http.TinyHttpHandler
-
- All Implemented Interfaces:
HttpHandler
- Direct Known Subclasses:
TinyHealthHttpHandler,TinyPrometheusHttpHandler,TinyReadyHttpHandler
public abstract class TinyHttpHandler extends Object implements HttpHandler
Class simplifying the HttpHandler in a similar fashion to the jakartaHttpServletclass. Just implement the matching method to the HTTP method you need served.
-
-
Constructor Summary
Constructors Constructor Description TinyHttpHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoDelete(HttpExchange exchange)Handle a DELETE request.protected voiddoGet(HttpExchange exchange)Handle a GET request.protected voiddoHead(HttpExchange exchange)Handle a HEAD request.protected voiddoOptions(HttpExchange exchange)Handle an OPTIONS request.protected voiddoPatch(HttpExchange exchange)Handle a PATCH request.protected voiddoPost(HttpExchange exchange)Handle a POST request.protected voiddoPut(HttpExchange exchange)Handle a PUT request.protected voiddoTrace(HttpExchange exchange)Handle a TRACE request.voidhandle(HttpExchange exchange)protected voidtoConnect(HttpExchange exchange)Handle a CONNECT request.
-
-
-
Method Detail
-
handle
public void handle(HttpExchange exchange) throws IOException
- Specified by:
handlein interfaceHttpHandler- Throws:
IOException
-
doGet
protected void doGet(HttpExchange exchange) throws IOException
Handle a GET request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doPost
protected void doPost(HttpExchange exchange) throws IOException
Handle a POST request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doHead
protected void doHead(HttpExchange exchange) throws IOException
Handle a HEAD request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doOptions
protected void doOptions(HttpExchange exchange) throws IOException
Handle an OPTIONS request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
toConnect
protected void toConnect(HttpExchange exchange) throws IOException
Handle a CONNECT request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doTrace
protected void doTrace(HttpExchange exchange) throws IOException
Handle a TRACE request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doPut
protected void doPut(HttpExchange exchange) throws IOException
Handle a PUT request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doPatch
protected void doPatch(HttpExchange exchange) throws IOException
Handle a PATCH request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
doDelete
protected void doDelete(HttpExchange exchange) throws IOException
Handle a DELETE request.- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
-