Package kos.api

Interface KosContext

All Known Implementing Classes:
MutableKosContext

public interface KosContext
This object is read-only representation of all sensible configuration that have been previously defined at the Kos' application initialization.
  • Method Details

    • getImplementationLoader

      @NonNull @NonNull ImplementationLoader getImplementationLoader()
      Returns:
      the defined ImplementationLoader
    • getPayloadSerializationStrategy

      @NonNull @NonNull PayloadSerializationStrategy getPayloadSerializationStrategy()
      Returns:
      the defined PayloadSerializationStrategy
    • getDefaultStatusForEmptyResponses

      int getDefaultStatusForEmptyResponses()
      Returns:
      the default HTTP Status code for empty responses. By default, it returns 204.
    • getDefaultSerializer

      @NonNull @NonNull Serializer getDefaultSerializer()
      Returns:
      the default Serializer used in case the expected Content-Type (defined by the Accept header) was not provided in the request.
    • getDefaultRestClientSerializer

      @NonNull @NonNull kos.core.client.RestClientSerializer getDefaultRestClientSerializer()
      Returns:
      the default RestClientSerializer used to serialize Request Payloads used by Kos' Rest Clients.
    • getDefaultEventBusCodecFactory

      @NonNull @NonNull EventBusMessageCodecFactory getDefaultEventBusCodecFactory()
      Returns:
      the default RestClientSerializer used to serialize Request Payloads used by Kos' Rest Clients.
    • getDefaultVertx

      @NonNull @NonNull io.vertx.core.Vertx getDefaultVertx()
      Returns:
      the Vertx instance used by the whole application.
    • getDefaultVertxWebClient

      @NonNull @NonNull io.vertx.ext.web.client.WebClient getDefaultVertxWebClient()
      Returns:
      the WebClient instance used by the Rest Clients.
    • getStringConverter

      @NonNull @NonNull StringConverter getStringConverter()
      Returns:
      the StringConverter used to convert String into Objects.
    • getExceptionHandler

      @NonNull @NonNull ExceptionHandler getExceptionHandler()
      Returns:
      the ExceptionHandler used to handle unhandled exceptions.
    • getDefaultValidation

      @NonNull @NonNull Validation getDefaultValidation()
      Returns:
      the default Validation used to assess classes subject to validation.
    • getConfigRetriever

      @NonNull @NonNull io.vertx.config.ConfigRetriever getConfigRetriever()
      Returns:
      the default ConfigRetriever used to read the Vert.x configuration.
    • getApplicationConfig

      @NonNull @NonNull io.vertx.core.json.JsonObject getApplicationConfig()
      Returns:
      the read Vert.x configuration object.
    • getSerializerForContentType

      @NonNull @NonNull Serializer getSerializerForContentType(String contentType)
      Returns:
      the Serializer configured for a given contentType.
    • getHttpServerOptions

      @NonNull @NonNull io.vertx.core.http.HttpServerOptions getHttpServerOptions()
      The default server configuration. It will be triggered when the auto-discovery mechanism failed to find one in the classpath.
    • getSpi

      @NonNull @NonNull ImplementationLoader getSpi()
    • runBlocking

      io.vertx.core.Future<Void> runBlocking(KosContext.RunnerThatMightFail runner)
    • computeBlocking

      <T> io.vertx.core.Future<T> computeBlocking(KosContext.SupplierThatMightFail<T> supplier)