public abstract class BaseHandler extends java.lang.Object implements io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
| Modifier and Type | Field and Description |
|---|---|
protected WebViewServer |
_server |
| Constructor and Description |
|---|
BaseHandler(WebViewServer server) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_sendResponseWithError(io.vertx.core.http.HttpServerRequest request,
java.lang.String errorStr)
Send an error response.
|
protected void |
_sendResponseWithFile(io.vertx.core.http.HttpServerRequest request,
java.io.File file,
boolean delete)
Send a file with the response.
|
protected void |
_sendResponseWithSuccessJson(io.vertx.core.http.HttpServerRequest request,
io.vertx.core.json.JsonObject json)
Send an success response with json.
|
protected void |
_sendResponseWithSuccessText(io.vertx.core.http.HttpServerRequest request,
java.lang.String contentType,
java.lang.String text)
Send an success response with text.
|
void |
handle(io.vertx.ext.web.RoutingContext context)
Do nothing.
|
protected WebViewServer _server
public BaseHandler(WebViewServer server)
public void handle(io.vertx.ext.web.RoutingContext context)
handle in interface io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>protected void _sendResponseWithFile(io.vertx.core.http.HttpServerRequest request, java.io.File file, boolean delete)
request - The http request.file - The file to send.delete - If true, delete the file once response is sent.protected void _sendResponseWithError(io.vertx.core.http.HttpServerRequest request, java.lang.String errorStr)
request - The http request.errorStr - The error text.protected void _sendResponseWithSuccessJson(io.vertx.core.http.HttpServerRequest request, io.vertx.core.json.JsonObject json)
request - The http request.json - The json object.protected void _sendResponseWithSuccessText(io.vertx.core.http.HttpServerRequest request, java.lang.String contentType, java.lang.String text)
request - The http request.contentType - The value for Content-Type.text - The success text.