Examples of RouteMatcher


Examples of com.rackspacecloud.blueflood.http.RouteMatcher

        if (defaultProcessorChain == null || statsdProcessorChain == null) {
            log.error("Processor chains were not set up properly");
            return;
        }
       
        RouteMatcher router = new RouteMatcher();
        router.get("/v1.0", new DefaultHandler());
        router.post("/v1.0/multitenant/experimental/metrics", new HttpMultitenantMetricsIngestionHandler(defaultProcessorChain, timeout));
        router.post("/v1.0/:tenantId/experimental/metrics", new HttpMetricsIngestionHandler(defaultProcessorChain, timeout));
        router.post("/v1.0/:tenantId/experimental/metrics/statsd", new HttpStatsDIngestionHandler(statsdProcessorChain, timeout));

        router.get("/v2.0", new DefaultHandler());
        router.post("/v2.0/:tenantId/ingest/multi", new HttpMultitenantMetricsIngestionHandler(defaultProcessorChain, timeout));
        router.post("/v2.0/:tenantId/ingest", new HttpMetricsIngestionHandler(defaultProcessorChain, timeout));
        router.post("/v2.0/:tenantId/ingest/aggregated", new HttpStatsDIngestionHandler(statsdProcessorChain, timeout));

        log.info("Starting metrics listener HTTP server on port {}", httpIngestPort);
        ServerBootstrap server = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newFixedThreadPool(acceptThreads),
View Full Code Here

Examples of com.rackspacecloud.blueflood.http.RouteMatcher

        this.httpQueryPort = Configuration.getInstance().getIntegerProperty(HttpConfig.HTTP_METRIC_DATA_QUERY_PORT);
        this.httpQueryHost = Configuration.getInstance().getStringProperty(HttpConfig.HTTP_QUERY_HOST);
        int acceptThreads = Configuration.getInstance().getIntegerProperty(HttpConfig.MAX_READ_ACCEPT_THREADS);
        int workerThreads = Configuration.getInstance().getIntegerProperty(HttpConfig.MAX_READ_WORKER_THREADS);

        RouteMatcher router = new RouteMatcher();
        router.get("/v1.0", new DefaultHandler());
        router.get("/v1.0/:tenantId/experimental/views/metric_data/:metricName", new HttpRollupsQueryHandler());
        router.post("/v1.0/:tenantId/experimental/views/metric_data", new HttpMultiRollupsQueryHandler());
        router.get("/v1.0/:tenantId/experimental/views/histograms/:metricName", new HttpHistogramQueryHandler());

        router.get("/v2.0", new DefaultHandler());
        router.get("/v2.0/:tenantId/views/:metricName", new HttpRollupsQueryHandler());
        router.post("/v2.0/:tenantId/views", new HttpMultiRollupsQueryHandler());
        router.get("/v2.0/:tenantId/views/histograms/:metricName", new HttpHistogramQueryHandler());
        router.get("/v2.0/:tenantId/metrics/search", new HttpMetricsIndexHandler());

        log.info("Starting metric data query server (HTTP) on port {}", this.httpQueryPort);
        ServerBootstrap server = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newFixedThreadPool(acceptThreads),
View Full Code Here

Examples of com.trendrr.strest.server.routing.RouteMatcher

 
 
  @Test
  public void testRoutes() {
   
    RouteMatcher tree = new RouteMatcher();
   
   
    tree.addMapping(new UriMapping("/", HelloWorld.class));
    tree.addMapping(new UriMapping("/test", HelloWorld.class));
    tree.addMapping(new UriMapping("/test/*filenames", HelloWorld.class));
    tree.addMapping(new UriMapping("/test/:id", HelloWorld.class));
    tree.addMapping(new UriMapping("/test/:name/:id", HelloWorld.class));
    tree.addMapping(new UriMapping("/test/idmatch/:id", HelloWorld.class));
    tree.addMapping(new UriMapping("/test/idmatch/namematch", HelloWorld.class));
   
    /*
     * Notes on matching:
     *
     * matched route allways strips leading /
View Full Code Here

Examples of io.vertx.ext.routematcher.RouteMatcher

        // Init jersey handler
        jerseyHandler.init(options);

        // Set request handler for the baseUri
        RouteMatcher rm = RouteMatcher.routeMatcher();
        server.requestHandler(rm::accept);

        // regex pattern will be: "^base_path/.*"
        String pattern = "^" + jerseyHandler.getBaseUri().getPath() + ".*";
        rm.all(pattern, jerseyHandler);

        // Add any additional routes if handler is provided
        if (routeMatcherHandler != null) {
            routeMatcherHandler.handle(rm);
        }
View Full Code Here

Examples of org.vertx.java.core.http.RouteMatcher

public class RouteMatchExample extends Verticle {

  public void start() {

    RouteMatcher rm = new RouteMatcher();

    rm.get("/details/:user/:id", new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        req.response().end("User: " + req.params().get("user") + " ID: " + req.params().get("id"));
      }
    });

    // Catch all - serve the index page
    rm.getWithRegEx(".*", new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        req.response().sendFile("route_match/index.html");
      }
    });

View Full Code Here

Examples of org.vertx.java.core.http.RouteMatcher

    startClient();
  }

  public void start() {

    RouteMatcher routeMatcher = new RouteMatcher();

    // HTTP server
    HttpServer httpServer = vertx.createHttpServer();
    httpServer.requestHandler(routeMatcher);
View Full Code Here

Examples of org.vertx.java.core.http.RouteMatcher

public class BitcoinServerVerticle extends Verticle {

  @Override
  public void start() throws Exception {

    RouteMatcher routeMatcher = new RouteMatcher();
    routeMatcher.get("/", new Handler<HttpServerRequest>() {
      @Override
      public void handle(HttpServerRequest request) {
        request.response.sendFile("webroot/index.html");
      }
    });
    routeMatcher.getWithRegEx("(\\/.*\\.(js|css|png))", new Handler<HttpServerRequest>() {
      @Override
      public void handle(HttpServerRequest request) {
        request.response.sendFile("webroot" + request.params().get("param0"));
      }
    });
View Full Code Here

Examples of org.vertx.java.core.http.RouteMatcher

public class RouteMatchExample extends Verticle {

  public void start() {

    RouteMatcher rm = new RouteMatcher();

    rm.get("/details/:user/:id", new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        req.response.end("User: " + req.params().get("user") + " ID: " + req.params().get("id"));
      }
    });

    // Catch all - serve the index page
    rm.getWithRegEx(".*", new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        req.response.sendFile("route_match/index.html");
      }
    });

View Full Code Here

Examples of org.vertx.java.core.http.RouteMatcher

        // Init jersey handler
        jerseyHandler.init(configurator);

        // Set request handler for the baseUri
        RouteMatcher rm = new RouteMatcher();
        server.requestHandler(rm);
        // regex pattern will be: "^base_path/.*"
        String pattern = "^" + jerseyHandler.getBaseUri().getPath() + ".*";
        rm.all(pattern, jerseyHandler);

        // Add any additional routes if handler is provided
        if (routeMatcherHandler != null) {
            routeMatcherHandler.handle(rm);
        }
View Full Code Here

Examples of org.vertx.java.core.http.RouteMatcher

        // Init jersey handler
        jerseyHandler.init(configurator);

        // Set request handler for the baseUri
        RouteMatcher rm = new RouteMatcher();
        server.requestHandler(rm);
        // regex pattern will be: "^base_path/.*"
        String pattern = "^" + jerseyHandler.getBaseUri().getPath() + ".*";
        rm.all(pattern, jerseyHandler);

        // Add any additional routes if handler is provided
        if (routeMatcherHandler != null) {
            routeMatcherHandler.handle(rm);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.