Class RoutingUtils

java.lang.Object
io.quarkus.vertx.http.runtime.RoutingUtils

public final class RoutingUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assumeCdiRequestContext(io.vertx.ext.web.RoutingContext ctx, String newOwner)
    Assumes ownership of the currently active CDI request context.
    static void
    compressIfNeeded(VertxHttpBuildTimeConfig config, Set<String> compressMediaTypes, io.vertx.ext.web.RoutingContext ctx, String path)
    Enabled compression by removing CONTENT_ENCODING header as specified in Vert.x when the media-type should be compressed and config enable compression.
    static String
    getNormalizedAndDecodedPath(io.vertx.ext.web.RoutingContext ctx)
    Get the normalized and decoded path: - normalize based on RFC3986 - convert % encoded characters to their non encoded form (using URIDecoder.decodeURIComponent(java.lang.String)) - invalid if the path contains '?'
    static boolean
    isCdiRequestContextOwner(io.vertx.ext.web.RoutingContext ctx, String owner)
    Enables route handlers to determine if they can deactivate/destroy CDI request context without impacting any other extension.
    static String
    resolvePath(io.vertx.ext.web.RoutingContext ctx)
    Normalize and decode the path then strip the mount point from it

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • assumeCdiRequestContext

      public static void assumeCdiRequestContext(io.vertx.ext.web.RoutingContext ctx, String newOwner)
      Assumes ownership of the currently active CDI request context. Thus, code invoked (even asynchronously) from previous route handlers shouldn't deactivate it.
      Parameters:
      ctx - RoutingContext
      newOwner - typically a route handler that needs CDI request context active
    • isCdiRequestContextOwner

      public static boolean isCdiRequestContextOwner(io.vertx.ext.web.RoutingContext ctx, String owner)
      Enables route handlers to determine if they can deactivate/destroy CDI request context without impacting any other extension.
      Parameters:
      ctx - RoutingContext
      owner - typically a route handler that needs CDI request context active
      Returns:
      true if the CDI request context is owned by the owner
    • getNormalizedAndDecodedPath

      public static String getNormalizedAndDecodedPath(io.vertx.ext.web.RoutingContext ctx)
      Get the normalized and decoded path: - normalize based on RFC3986 - convert % encoded characters to their non encoded form (using URIDecoder.decodeURIComponent(java.lang.String)) - invalid if the path contains '?' (query section of the path)
      Parameters:
      ctx - the RoutingContext
      Returns:
      the normalized and decoded path or null if not valid
    • resolvePath

      public static String resolvePath(io.vertx.ext.web.RoutingContext ctx)
      Normalize and decode the path then strip the mount point from it
      Parameters:
      ctx - the RoutingContext
      Returns:
      the normalized and decoded path without the mount point or null if not valid
    • compressIfNeeded

      public static void compressIfNeeded(VertxHttpBuildTimeConfig config, Set<String> compressMediaTypes, io.vertx.ext.web.RoutingContext ctx, String path)
      Enabled compression by removing CONTENT_ENCODING header as specified in Vert.x when the media-type should be compressed and config enable compression.
      Parameters:
      config -
      compressMediaTypes -
      ctx -
      path -