/** * Map the route for HTTP GET requests * * @param path the path * @param acceptType the accept type * @param route The route * @param transformer the response transformer */ public static void get(String path, String acceptType, Route route, ResponseTransformer transformer) { getInstance().get(path, acceptType, route, transformer); }
/** * Map the route for HTTP GET requests * * @param path the path * @param acceptType the accept type * @param route The route */ public static void get(String path, String acceptType, Route route) { getInstance().get(path, acceptType, route); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route * @param transformer the response transformer */ public static void get(String path, Route route, ResponseTransformer transformer) { getInstance().get(path, route, transformer); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route * @param engine the template engine */ public static void get(String path, TemplateViewRoute route, TemplateEngine engine) { getInstance().get(path, route, engine); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route */ public static void get(final String path, final Route route) { getInstance().get(path, route); }
/** * Map the route for HTTP GET requests * * @param path the path * @param acceptType the accept type * @param route The route * @param engine the template engine */ public static void get(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) { getInstance().get(path, acceptType, route, engine); }
/** * Map the route for HTTP GET requests * * @param path the path * @param acceptType the accept type * @param route The route */ public static void get(String path, String acceptType, Route route) { getInstance().get(path, acceptType, route); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route * @param engine the template engine */ public static void get(String path, TemplateViewRoute route, TemplateEngine engine) { getInstance().get(path, route, engine); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route */ public static void get(final String path, final Route route) { getInstance().get(path, route); }
/** * Map the route for HTTP GET requests * * @param path the path * @param acceptType the accept type * @param route The route * @param transformer the response transformer */ public static void get(String path, String acceptType, Route route, ResponseTransformer transformer) { getInstance().get(path, acceptType, route, transformer); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route * @param transformer the response transformer */ public static void get(String path, Route route, ResponseTransformer transformer) { getInstance().get(path, route, transformer); }
private void defineInternalError(Service service) { service.get(BASE_URL + INTERNAL_SERVER_ERROR, (req, res) -> { throw new RuntimeException(); }); }
@Override public void define(Service service) { service.get(ROOT_PATH, this::listForwards, jsonTransformer); service.get(FORWARD_ADDRESS_PATH, this::listForwardDestinations, jsonTransformer); service.put(FORWARD_ADDRESS_PATH, this::throwUnknownPath); service.put(USER_IN_FORWARD_DESTINATION_ADDRESSES_PATH, this::addToForwardDestinations); service.delete(FORWARD_ADDRESS_PATH, this::throwUnknownPath); service.delete(USER_IN_FORWARD_DESTINATION_ADDRESSES_PATH, this::removeFromForwardDestination); }
@Override public void define(Service service) { service.get(VERSION_BASE, (request, response) -> getCassandraCurrentVersion(), jsonTransformer); service.get(VERSION_BASE_LATEST, (request, response) -> getCassandraLatestVersion(), jsonTransformer); service.post(VERSION_UPGRADE_BASE, this::upgradeToVersion, jsonTransformer); service.post(VERSION_UPGRADE_TO_LATEST_BASE, (request, response) -> upgradeToLatest(response), jsonTransformer); }
@Override public void define(Service service) { service.get(ROOT_PATH, this::listGroups, jsonTransformer); service.get(GROUP_ADDRESS_PATH, this::listGroupMembers, jsonTransformer); service.put(GROUP_ADDRESS_PATH, (request, response) -> halt(HttpStatus.BAD_REQUEST_400)); service.put(USER_IN_GROUP_ADDRESS_PATH, this::addToGroup); service.delete(GROUP_ADDRESS_PATH, (request, response) -> halt(HttpStatus.BAD_REQUEST_400)); service.delete(USER_IN_GROUP_ADDRESS_PATH, this::removeFromGroup); }
private void defineJsonExtractException(Service service) { service.get(BASE_URL + JSON_EXTRACT_EXCEPTION, (req, res) -> new JsonExtractor<>(Long.class).parse("a non valid JSON")); } }
private void defineJsonExtractException(Service service) { service.get(BASE_URL + JSON_EXTRACT_EXCEPTION, (req, res) -> new JsonExtractor<>(Long.class).parse("a non valid JSON")); } }
@Before public void setUp() throws Exception { httpServer = Service.ignite().port(RANDOM_PORT); httpServer.get("/", (Request request, Response response) -> "content"); httpServer.awaitInitialization(); rootDirectory = tmpFolder.getRoot(); createSubFolderWithAFileIn("conf", "conf.txt", "confcontent"); createSubFolderWithAFileIn("var", "var.txt", "varcontent"); fileSystem = buildFileSystem(rootDirectory.getAbsolutePath()); }
@Before public void setUp() throws Exception { httpServer = Service.ignite().port(RANDOM_PORT); httpServer.get("/", (Request request, Response response) -> "content"); httpServer.awaitInitialization(); rootDirectory = tmpFolder.getRoot(); createSubFolderWithAFileIn("conf", "conf.txt", "confcontent"); createSubFolderWithAFileIn("var", "var.txt", "varcontent"); fileSystem = buildFileSystem(rootDirectory.getAbsolutePath()); }