Class Irked


  • public class Irked
    extends Object
    Helper for creating Irked routers
    Author:
    odeda
    • Constructor Summary

      Constructors 
      Constructor Description
      Irked​(io.vertx.core.Vertx vertx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Will be removed in 5.0.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Irked irked​(io.vertx.core.Vertx vertx)
      Vert.x-styled Irked factory method.
      static io.vertx.ext.web.handler.LoggerHandler logger()
      Create a LoggerHandler instance to log HTTP access under a simple SLF4J logger name.
      static io.vertx.ext.web.handler.LoggerHandler logger​(io.vertx.ext.web.handler.LoggerFormat format)
      Create a LoggerHandler instance to log HTTP access under a simple SLF4J logger name.
      static io.vertx.ext.web.handler.LoggerHandler logger​(String loggerName, io.vertx.ext.web.handler.LoggerFormat format)
      Create a LoggerHandler instance to log HTTP access under a simple SLF4J logger name.
      Router router()
      Create a new Irked router
      static Router router​(io.vertx.core.Vertx vertx)
      Create a new Irked router
      io.vertx.core.Handler<io.vertx.core.http.HttpServerRequest> setupRequestHandler​(Controller... apis)
      Create an HTTP request handler, that can be used in HttpServer.requestHandler(), with the provided set of APIs configured
    • Constructor Detail

      • Irked

        @Deprecated(forRemoval=true)
        public Irked​(io.vertx.core.Vertx vertx)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Will be removed in 5.0. Please use irked(Vertx) instead
        Create new Irked instance that can generate request handlers
        Parameters:
        vertx - Vert.x instance in which to generate routers
    • Method Detail

      • irked

        public static Irked irked​(io.vertx.core.Vertx vertx)
        Vert.x-styled Irked factory method.
        Parameters:
        vertx - Vert.x instance in which to generated routers
        Returns:
        a new Irked instance that can generate Routers and request handlers
      • setupRequestHandler

        public io.vertx.core.Handler<io.vertx.core.http.HttpServerRequest> setupRequestHandler​(Controller... apis)
                                                                                        throws InvalidRouteConfiguration
        Create an HTTP request handler, that can be used in HttpServer.requestHandler(), with the provided set of APIs configured
        Parameters:
        apis - set of Irked API controllers to configure routing for
        Returns:
        an HTTP request handler for the Vert.x HTTP server
        Throws:
        InvalidRouteConfiguration - in case one of the route configurations is invalid
      • router

        public Router router()
        Create a new Irked router
        Returns:
        router that can be used to configure Irked API controllers and handle HTTP requests from Vert.x HTTP server
      • router

        public static Router router​(io.vertx.core.Vertx vertx)
        Create a new Irked router
        Parameters:
        vertx - Vert.x instance in which to generate routers
        Returns:
        router that can be used to configure Irked API controllers and handle HTTP requests from Vert.x HTTP server
      • logger

        public static io.vertx.ext.web.handler.LoggerHandler logger()
        Create a LoggerHandler instance to log HTTP access under a simple SLF4J logger name. The implementation returned from is a subclass of the original Vert.x LoggerHandlerImpl except where the underlying logger is replaced so that the logger isn't named for a full class name of an internal Vert.x implementation class - this makes it easier to set up filters and manage the access log. To use - define a field in your main (root) controller like so:
        
         @Endpoint private LoggerHandler accessLog = Irked.logger();
         
        This method uses the hard coded log name "access" and the default log format.
        Returns:
        an instance of a LoggerHandler that will log HTTP requests
      • logger

        public static io.vertx.ext.web.handler.LoggerHandler logger​(io.vertx.ext.web.handler.LoggerFormat format)
        Create a LoggerHandler instance to log HTTP access under a simple SLF4J logger name. The implementation returned from is a subclass of the original Vert.x LoggerHandlerImpl except where the underlying logger is replaced so that the logger isn't named for a full class name of an internal Vert.x implementation class - this makes it easier to set up filters and manage the access log. To use - define a field in your main (root) controller like so:
        
         @Endpoint private LoggerHandler accessLog = Irked.logger(LoggerFormat.SHORT);
         
        This method uses the hard coded log name "access".
        Parameters:
        format - LoggerFormat to use for formatting the log
        Returns:
        an instance of a LoggerHandler that will log HTTP requests
      • logger

        public static io.vertx.ext.web.handler.LoggerHandler logger​(String loggerName,
                                                                    io.vertx.ext.web.handler.LoggerFormat format)
        Create a LoggerHandler instance to log HTTP access under a simple SLF4J logger name. The implementation returned from is a subclass of the original Vert.x LoggerHandlerImpl except where the underlying logger is replaced so that the logger isn't named for a full class name of an internal Vert.x implementation class - this makes it easier to set up filters and manage the access log. To use - define a field in your main (root) controller like so:
        
         @Endpoint private LoggerHandler accessLog = Irked.logger("access_log", LoggerFormat.SHORT);
         
        Parameters:
        loggerName - text to use for the logger name
        format - LoggerFormat to use for formatting the log
        Returns:
        an instance of a LoggerHandler that will log HTTP requests