public abstract class Resource extends Object
| Constructor and Description |
|---|
Resource(io.vertx.ext.web.Router router) |
| Modifier and Type | Method and Description |
|---|---|
protected io.vertx.ext.web.Route |
delete(String path) |
protected io.vertx.ext.web.Route |
delete(String path,
UserRole role) |
protected void |
endContext(io.vertx.ext.web.RoutingContext ctx,
io.netty.handler.codec.http.HttpResponseStatus status) |
protected void |
endContext(io.vertx.ext.web.RoutingContext ctx,
io.netty.handler.codec.http.HttpResponseStatus status,
String message) |
protected void |
endContext(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.json.JsonArray body) |
protected void |
endContext(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.json.JsonObject body) |
protected <T extends DTO> |
endContext(io.vertx.ext.web.RoutingContext ctx,
List<T> list) |
protected void |
endContext(io.vertx.ext.web.RoutingContext ctx,
Object body) |
protected void |
failureHandler(io.vertx.ext.web.RoutingContext ctx,
Throwable cause) |
protected io.vertx.ext.web.Route |
get(String path) |
protected io.vertx.ext.web.Route |
get(String path,
UserRole role) |
protected <T> T |
getAuthClaim(io.vertx.ext.web.RoutingContext ctx,
String key) |
protected <T> T |
getAuthClaim(io.vertx.ext.web.RoutingContext ctx,
String key,
T def) |
protected String |
getPathParam(io.vertx.ext.web.RoutingContext ctx,
String param) |
protected String |
getPathParam(io.vertx.ext.web.RoutingContext ctx,
String param,
String def) |
protected String |
getRequestParam(io.vertx.ext.web.RoutingContext ctx,
String param) |
protected String |
getRequestParam(io.vertx.ext.web.RoutingContext ctx,
String param,
String def) |
protected org.slf4j.Logger |
logger() |
protected <T> io.vertx.core.Future<T> |
on(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.Future<T> action) |
protected <T> void |
on(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.Future<T> action,
io.vertx.core.Handler<T> onSuccess) |
protected <T,U> io.vertx.core.Future<List<T>> |
onEach(List<T> list,
Function<T,io.vertx.core.Future<U>> execute)
Applies a Future
execute function on each element of list. |
protected io.vertx.ext.web.Route |
patch(String path) |
protected io.vertx.ext.web.Route |
patch(String path,
UserRole role) |
protected io.vertx.ext.web.Route |
post(String path) |
protected io.vertx.ext.web.Route |
post(String path,
UserRole role) |
protected io.vertx.ext.web.Route |
protectedRoute(io.vertx.core.http.HttpMethod method,
String path) |
protected io.vertx.ext.web.Route |
protectedRoute(io.vertx.core.http.HttpMethod method,
String path,
UserRole role) |
protected io.vertx.ext.web.Route |
put(String path) |
protected io.vertx.ext.web.Route |
put(String path,
UserRole role) |
protected io.vertx.ext.web.Route |
route(io.vertx.core.http.HttpMethod method,
String path) |
protected io.vertx.ext.web.Router |
router() |
protected abstract void |
routes()
Define routes and their route handlers.
|
protected void |
setUp()
Executed before routes declaration.
|
protected void setUp()
protected abstract void routes()
protected org.slf4j.Logger logger()
protected io.vertx.ext.web.Router router()
protected String getPathParam(io.vertx.ext.web.RoutingContext ctx, String param, String def)
protected String getRequestParam(io.vertx.ext.web.RoutingContext ctx, String param, String def)
protected <T> T getAuthClaim(io.vertx.ext.web.RoutingContext ctx,
String key)
protected <T> T getAuthClaim(io.vertx.ext.web.RoutingContext ctx,
String key,
T def)
protected io.vertx.ext.web.Route route(io.vertx.core.http.HttpMethod method,
String path)
protected io.vertx.ext.web.Route protectedRoute(io.vertx.core.http.HttpMethod method,
String path)
protected io.vertx.ext.web.Route protectedRoute(io.vertx.core.http.HttpMethod method,
String path,
UserRole role)
protected io.vertx.ext.web.Route get(String path)
protected io.vertx.ext.web.Route put(String path)
protected io.vertx.ext.web.Route patch(String path)
protected io.vertx.ext.web.Route post(String path)
protected io.vertx.ext.web.Route delete(String path)
protected void endContext(io.vertx.ext.web.RoutingContext ctx,
io.netty.handler.codec.http.HttpResponseStatus status,
String message)
protected void endContext(io.vertx.ext.web.RoutingContext ctx,
io.netty.handler.codec.http.HttpResponseStatus status)
protected void endContext(io.vertx.ext.web.RoutingContext ctx,
Object body)
protected void endContext(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.json.JsonObject body)
protected void endContext(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.json.JsonArray body)
protected <T extends DTO> void endContext(io.vertx.ext.web.RoutingContext ctx, List<T> list)
protected <T> void on(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.Future<T> action,
io.vertx.core.Handler<T> onSuccess)
protected <T> io.vertx.core.Future<T> on(io.vertx.ext.web.RoutingContext ctx,
io.vertx.core.Future<T> action)
protected void failureHandler(io.vertx.ext.web.RoutingContext ctx,
Throwable cause)
protected <T,U> io.vertx.core.Future<List<T>> onEach(List<T> list, Function<T,io.vertx.core.Future<U>> execute)
execute function on each element of list.
The Future completes until all of the functions are executed.T - the type of elements that list holdsU - the resulting type after execute has been appliedlist - the list to apply an execute function from.execute - the function to apply on each elementlist for fluent use.Copyright © 2021. All rights reserved.