@Override public final ListenerFilter includeAllRoutes() { restRoutesDefined = true; if (listener instanceof RestMethodListenerBase) { if (0==builder.routerConfig().totalRoutesCount()) { builder.defineRoute().path("${path}").routeId(); } int[] routes = new int[builder.routerConfig().totalRoutesCount()]; int i = routes.length; while (--i>=0) { routes[i]=i; } includeRoutes(routes); return this; } else { throw new UnsupportedOperationException("The Listener must be an instance of "+RestListener.class.getSimpleName()+" in order to call this method."); } }
.path("/testpageA?arg=#{myarg}") .path("/testpagesA?arg=#{myarg}&name=${name}") .path("/testpageA?f=g") .parseJSON() .stringField( "person.name", Field.PERSON_NAME) .integerField("person.age", Field.PERSON_AGE) c.defineRoute().path("/resources/${path}").routeId(Struct.RESOURCES_EXAMPLE); c.defineRoute().path("/files/${path}").routeId(Struct.FILES_EXAMPLE); c.defineRoute().path("/testpageB").routeId(Struct.SMALL_EXAMPLE); c.defineRoute(HTTPHeaderDefaults.COOKIE).path("/testpageC").routeId(Struct.LARGE_EXAMPLE); c.defineRoute().path("/testpageD").routeId(Struct.SPLIT_EXAMPLE);
@Override public void declareConfiguration(GreenFramework c) { HTTPServerConfig conf = c.useHTTP1xServer(port) .setHost(host) .useInsecureServer() .setConcurrentChannelsPerDecryptUnit(4) .setConcurrentChannelsPerEncryptUnit(4); //emptyResponseRouteId = c.registerRoute("/testpageA?arg=#{myarg}", cookieHeader); smallResponseRouteId = c.defineRoute().path("/testpageB").routeId(); //largeResponseRouteId = c.registerRoute("/testpageC", cookieHeader); //splitResponseRouteId = c.registerRoute("/testpageD"); //only do in test mode... //in production it is a bad idea to let clients turn off server. shutdownRouteId = c.defineRoute().path("/shutdown?key=${key}").routeId(); keyFieldId = c.lookupFieldByName(shutdownRouteId, "key"); }
@Override public RouteFilter includeAllRoutes() { if (0==builder.routerConfig().totalRoutesCount()) { builder.defineRoute().path("${path}").routeId(); } int[] routes = new int[builder.routerConfig().totalRoutesCount()]; int i = routes.length; while (--i>=0) { routes[i]=i; } includeRoutes(routes); return this; }
@Override public void declareConfiguration(GreenFramework c) { HTTPServerConfig conf = c.useHTTP1xServer(port) .setHost(NetGraphBuilder.bindHost(host)) .setDecryptionUnitsPerTrack(4) .setDefaultPath(""); int aRouteId = c.defineRoute().path("/shutdown?key=${key}").routeId(); keyFieldId = c.lookupFieldByName(aRouteId, "key"); }
@Override public void declareConfiguration(GreenFramework builder) { HTTPServerConfig server = builder.useHTTP1xServer(port) .setConcurrentChannelsPerDecryptUnit(4) .setConcurrentChannelsPerEncryptUnit(4) .setHost("127.0.0.1"); if (!useTLS) { server.useInsecureServer(); } builder.defineRoute().path("/proxy").routeId(Struct.PROXY_ROUTE); builder.defineRoute().path("/service").routeId(Struct.SERIVCE_ROUTE); HTTPClientConfig client = useTLS ? builder.useNetClient() : builder.useInsecureNetClient(); session = client.newHTTPSession("127.0.0.1", port).finish(); GraphManager.showThreadIdOnTelemetry = true; GraphManager.showScheduledRateOnTelemetry = true; // builder.enableTelemetry(); }
.path("${path}") .routeId(ROUTE_ID.ROOT);