public class WebVerticle
Base class for web Tock io.vertx.core.Verticles. Provides utility methods.
public WebVerticle()
Base class for web Tock io.vertx.core.Verticles. Provides utility methods.
@NotNull public mu.KLogger getLogger()
@NotNull public io.vertx.ext.web.Router getRouter()
@NotNull protected io.vertx.core.http.HttpServer getServer()
@NotNull public java.lang.String getBasePath()
@NotNull protected java.lang.String getRootPath()
@NotNull public java.lang.String getAuthenticatePath()
@NotNull public java.lang.String getLogoutPath()
@Nullable public java.lang.String getHealthcheckPath()
If not null, add a healthcheck for this verticle.
healthcheck@NotNull protected java.util.Set<java.lang.String> protectedPaths()
public void configure()
@NotNull public kotlin.jvm.functions.Function1<io.vertx.ext.web.RoutingContext,kotlin.Unit> healthcheck()
@NotNull public kotlin.jvm.functions.Function1<io.vertx.ext.web.RoutingContext,kotlin.Unit> defaultHealthcheck()
Provide basic health information: mainly through HTTP status code
@NotNull public kotlin.jvm.functions.Function1<io.vertx.ext.web.RoutingContext,kotlin.Unit> detailedHealthcheck()
Provide enhanced information: HTTP response has JSON body with health status of resources
public void start(@NotNull
io.vertx.core.Promise<java.lang.Void> promise)
public void stop(@Nullable
io.vertx.core.Future<java.lang.Void> stopFuture)
public void addAuth(@NotNull
TockAuthProvider authProvider,
@NotNull
java.util.Set<java.lang.String> pathsToProtect)
@NotNull protected TockAuthProvider defaultAuthProvider()
The auth provider provided by default.
@Nullable protected TockAuthProvider authProvider()
By default there is no auth provider - ie nothing is protected.
@Nullable protected TockUserRole defaultRole()
The default role of a service.
protected int getDefaultPort()
The default port of the verticle
protected void startServer(@NotNull
io.vertx.core.Promise<java.lang.Void> promise)
protected void startServer(@NotNull
io.vertx.core.Promise<java.lang.Void> promise,
int port)
protected int verticleIntProperty(@NotNull
java.lang.String propertyName,
int defaultValue)
protected long verticleLongProperty(@NotNull
java.lang.String propertyName,
long defaultValue)
protected boolean verticleBooleanProperty(@NotNull
java.lang.String propertyName,
boolean defaultValue)
@NotNull
protected java.lang.String verticleProperty(@NotNull
java.lang.String propertyName,
@NotNull
java.lang.String defaultValue)
protected void register(@NotNull
io.vertx.core.http.HttpMethod method,
@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
java.lang.String basePath,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,kotlin.Unit> handler)
protected void blocking(@NotNull
io.vertx.core.http.HttpMethod method,
@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
java.lang.String basePath,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,kotlin.Unit> handler)
@NotNull
public java.lang.Object isAuthorized(@NotNull
io.vertx.ext.web.RoutingContext $this$isAuthorized,
@NotNull
TockUserRole role,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.core.AsyncResult<java.lang.Boolean>,kotlin.Unit> resultHandler)
public <O> void blockingJsonGet(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,? extends O> handler)
protected void blockingPost(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
RequestLogger logger,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,kotlin.Unit> handler)
protected void blockingGet(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
java.lang.String basePath,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,java.lang.String> handler)
protected <O> void blockingUploadPost(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
RequestLogger logger,
@NotNull
kotlin.jvm.functions.Function2<? super io.vertx.ext.web.RoutingContext,? super java.lang.String,? extends O> handler)
protected <O> void blockingUploadBinaryPost(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
kotlin.jvm.functions.Function2<? super io.vertx.ext.web.RoutingContext,? super kotlin.Pair<java.lang.String,byte[]>,? extends O> handler)
public void blockingDelete(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
RequestLogger logger,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,kotlin.Unit> handler)
protected void blockingJsonDelete(@NotNull
java.lang.String path,
@Nullable
TockUserRole role,
@NotNull
RequestLogger logger,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,java.lang.Boolean> handler)
protected void addDevCorsHandler()
@NotNull
public io.vertx.ext.web.handler.CorsHandler corsHandler(@NotNull
java.lang.String origin,
boolean allowCredentials,
@NotNull
java.util.Set<? extends io.vertx.core.http.HttpMethod> allowedMethods,
@NotNull
java.util.Set<java.lang.String> allowedHeaders)
@NotNull protected io.vertx.ext.web.handler.BodyHandler bodyHandler()
@NotNull
public kotlin.Array[] readBytes(@NotNull
io.vertx.ext.web.FileUpload upload)
@NotNull
public java.lang.String readString(@NotNull
io.vertx.ext.web.FileUpload upload)
protected void executeBlocking(@NotNull
io.vertx.ext.web.RoutingContext $this$executeBlocking,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,kotlin.Unit> handler)
Execute blocking code using Vertx.executeBlocking.
public void success(@NotNull
io.vertx.ext.web.RoutingContext $this$success)
public void endJson(@NotNull
io.vertx.ext.web.RoutingContext $this$endJson,
boolean success)
public void endJson(@NotNull
io.vertx.ext.web.RoutingContext $this$endJson,
@Nullable
java.lang.Object result)
@NotNull
public java.lang.String path(@NotNull
io.vertx.ext.web.RoutingContext $this$path,
@NotNull
java.lang.String name)
@NotNull
public java.util.Locale pathToLocale(@NotNull
io.vertx.ext.web.RoutingContext $this$pathToLocale,
@NotNull
java.lang.String name)
@NotNull
public <T> org.litote.kmongo.Id<T> pathId(@NotNull
io.vertx.ext.web.RoutingContext $this$pathId,
@NotNull
java.lang.String name)
@Nullable
public java.lang.String firstQueryParam(@NotNull
io.vertx.ext.web.RoutingContext $this$firstQueryParam,
@NotNull
java.lang.String name)
@Nullable
public <T> org.litote.kmongo.Id<T> queryId(@NotNull
io.vertx.ext.web.RoutingContext $this$queryId,
@NotNull
java.lang.String name)
@NotNull
public java.lang.String getOrganization(@NotNull
io.vertx.ext.web.RoutingContext $this$organization)
@Nullable public TockUser getUser(@NotNull io.vertx.ext.web.RoutingContext $this$user)
@NotNull
public java.lang.String getUserLogin(@NotNull
io.vertx.ext.web.RoutingContext $this$userLogin)
public void endJson(@NotNull
io.vertx.core.http.HttpServerResponse $this$endJson,
@Nullable
java.lang.Object result)