abstract class WebVerticle : AbstractVerticle (source)
Base class for web Tock io.vertx.core.Verticles. Provides utility methods.
<init> |
Base class for web Tock io.vertx.core.Verticles. Provides utility methods. WebVerticle() |
authenticatePath |
open val authenticatePath: String |
basePath |
open val basePath: String |
defaultCorsOrigin |
Default cors origin (if tock_web_use_default_cors_handler property is set to true). open val defaultCorsOrigin: String |
defaultCorsWithCredentials |
By default, allow credentials for cors origin (if tock_web_use_default_cors_handler property is set to true). open val defaultCorsWithCredentials: Boolean |
defaultPort |
The default port of the verticle open val defaultPort: Int |
healthcheckPath |
If not null, add a healthcheck for this verticle. open val healthcheckPath: String? |
livenesscheckPath |
If not null, add a liveness for this verticle. open val livenesscheckPath: String? |
logger |
open val logger: KLogger |
logoutPath |
open val logoutPath: String |
organization |
val RoutingContext.organization: String |
readinesscheckPath |
If not null, add a readiness for this verticle. open val readinesscheckPath: String? |
rootPath |
open val rootPath: String |
router |
val router: Router |
server |
val server: HttpServer |
user |
val RoutingContext.user: TockUser? |
userLogin |
val RoutingContext.userLogin: String |
addAuth |
fun addAuth(: TockAuthProvider = defaultAuthProvider(), : Set<String> = protectedPaths().map { "$it/*" }.toSet()): Unit |
addDevCorsHandler |
open fun addDevCorsHandler(): Unit |
authProvider |
By default there is no auth provider - ie nothing is protected. open fun authProvider(): TockAuthProvider? |
blocking |
fun blocking(: HttpMethod, : String, : TockUserRole? = defaultRole(), : String = rootPath, : (RoutingContext) -> Unit): Unit |
blockingDelete |
fun blockingDelete(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext) -> Unit): Unit |
blockingGet |
fun blockingGet(: String, : TockUserRole? = defaultRole(), : String = rootPath, : (RoutingContext) -> String): Unit |
blockingJsonDelete |
fun blockingJsonDelete(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext) -> Boolean): Unit |
blockingJsonGet |
fun <O> blockingJsonGet(: String, : TockUserRole? = defaultRole(), : (RoutingContext) -> O): Unit |
blockingJsonPost |
fun <I : Any, O> blockingJsonPost(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext, I) -> O): Unit |
blockingJsonPut |
fun <I : Any, O> blockingJsonPut(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext, I) -> O): Unit |
blockingPost |
fun blockingPost(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext) -> Unit): Unit |
blockingUploadBinaryPost |
fun <O> blockingUploadBinaryPost(: String, : TockUserRole? = defaultRole(), : (RoutingContext, Pair<String, ByteArray>) -> O): Unit |
blockingUploadJsonPost |
fun <F : Any, O> blockingUploadJsonPost(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext, F) -> O): Unit |
blockingUploadPost |
fun <O> blockingUploadPost(: String, : TockUserRole? = defaultRole(), : RequestLogger = defaultRequestLogger, : (RoutingContext, String) -> O): Unit |
blockingWithBodyJson |
fun <I : Any, O> blockingWithBodyJson(: HttpMethod, : String, : TockUserRole?, : RequestLogger = defaultRequestLogger, : (RoutingContext, I) -> O): Unit |
bodyHandler |
fun bodyHandler(): BodyHandler |
configure |
abstract fun configure(): Unit |
corsHandler |
fun corsHandler(: String = "*", : Boolean = false, : Set<HttpMethod> = EnumSet.of(GET, POST, PUT, DELETE), : Set<String> = listOfNotNull(
"X-Requested-With",
"Access-Control-Allow-Origin",
if (allowCredentials) "Authorization" else null,
"Content-Type"
).toSet()): CorsHandler |
defaultAuthProvider |
The auth provider provided by default. open fun defaultAuthProvider(): TockAuthProvider |
defaultErrorHandler |
The error handler for match failures. See https://vertx.io/docs/vertx-web/java/#_route_match_failures open fun defaultErrorHandler(: Int): Handler<RoutingContext> |
defaultHealthcheck |
Provide basic health information: mainly through HTTP status code open fun defaultHealthcheck(): (RoutingContext) -> Unit |
defaultRole |
The default role of a service. open fun defaultRole(): TockUserRole? |
detailedHealthcheck |
Provide enhanced information: HTTP response has JSON body with health status of resources open fun detailedHealthcheck(): (RoutingContext) -> Unit |
endJson |
fun RoutingContext.endJson(: Boolean): Unitfun RoutingContext.endJson(: Any?): Unitfun HttpServerResponse.endJson(: Any?): Unit |
executeBlocking |
Execute blocking code using Vertx.executeBlocking. fun RoutingContext.executeBlocking(: (RoutingContext) -> Unit): Unit |
firstQueryParam |
fun RoutingContext.firstQueryParam(: String): String? |
healthcheck |
open fun healthcheck(): (RoutingContext) -> Unit |
isAuthorized |
fun RoutingContext.isAuthorized(: TockUserRole, : (AsyncResult<Boolean>) -> Unit): Any |
jsonPost |
fun <I : Any, O> jsonPost(: String, : TockUserRole? = defaultRole(), : (RoutingContext, I, Handler<O>) -> Unit): Unit |
livenesscheck |
Provide basic liveness information: indicates whether the verticle is running open fun livenesscheck(): (RoutingContext) -> Unit |
path |
fun RoutingContext.path(: String): String |
pathId |
fun <T> RoutingContext.pathId(: String): Id<T> |
pathToLocale |
fun RoutingContext.pathToLocale(: String): Locale |
protectedPaths |
open fun protectedPaths(): Set<String> |
queryId |
fun <T> RoutingContext.queryId(: String): Id<T>? |
readBytes |
fun readBytes(: FileUpload): ByteArray |
readinesscheck |
Provide basic readiness information: indicates whether the container is ready to respond to requests open fun readinesscheck(): (RoutingContext) -> Unit |
readJson |
fun <T : Any> RoutingContext.readJson(): Tfun <T : Any> readJson(: FileUpload): T |
readString |
fun readString(: FileUpload): String |
register |
fun register(: HttpMethod, : String, : TockUserRole? = defaultRole(), : String = rootPath, : (RoutingContext) -> Unit): Unit |
start |
open fun start(: Promise<Void>): Unit |
startServer |
open fun startServer(: Promise<Void>): Unitopen fun startServer(: Promise<Void>, : Int): Unit |
stop |
open fun stop(: Future<Void>?): Unit |
success |
fun RoutingContext.success(): Unit |
verticleBooleanProperty |
fun verticleBooleanProperty(: String, : Boolean): Boolean |
verticleIntProperty |
fun verticleIntProperty(: String, : Int): Int |
verticleLongProperty |
fun verticleLongProperty(: String, : Long): Long |
verticleProperty |
fun verticleProperty(: String, : String): String |
withBodyJson |
fun <I : Any, O> withBodyJson(: HttpMethod, : String, : TockUserRole?, : (RoutingContext, I, Handler<O>) -> Unit): Unit |
defaultRequestLogger |
Default request logger does nothing. val defaultRequestLogger: RequestLogger |
badRequest |
fun badRequest(: String): Nothing |
notFound |
fun notFound(): Nothing |
unauthorized |
fun unauthorized(): Nothing |