/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route * @param engine the template engine */ public static void put(String path, TemplateViewRoute route, TemplateEngine engine) { getInstance().put(path, route, engine); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route */ public static void put(String path, Route route) { getInstance().put(path, route); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param acceptType the accept type * @param route The route * @param transformer the response transformer */ public static void put(String path, String acceptType, Route route, ResponseTransformer transformer) { getInstance().put(path, acceptType, route, transformer); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route * @param transformer the response transformer */ public static void put(String path, Route route, ResponseTransformer transformer) { getInstance().put(path, route, transformer); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param acceptType the accept type * @param route The route */ public static void put(String path, String acceptType, Route route) { getInstance().put(path, acceptType, route); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param acceptType the accept type * @param route The route * @param engine the template engine */ public static void put(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) { getInstance().put(path, acceptType, route, engine); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route * @param engine the template engine */ public static void put(String path, TemplateViewRoute route, TemplateEngine engine) { getInstance().put(path, route, engine); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route */ public static void put(String path, Route route) { getInstance().put(path, route); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route * @param transformer the response transformer */ public static void put(String path, Route route, ResponseTransformer transformer) { getInstance().put(path, route, transformer); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param acceptType the accept type * @param route The route * @param transformer the response transformer */ public static void put(String path, String acceptType, Route route, ResponseTransformer transformer) { getInstance().put(path, acceptType, route, transformer); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param acceptType the accept type * @param route The route */ public static void put(String path, String acceptType, Route route) { getInstance().put(path, acceptType, route); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param acceptType the accept type * @param route The route * @param engine the template engine */ public static void put(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) { getInstance().put(path, acceptType, route, engine); }
@PUT @Path("/{domainName}") @ApiOperation(value = "Creating new domain") @ApiImplicitParams({ @ApiImplicitParam(required = true, dataType = "string", name = "domainName", paramType = "path") }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.NO_CONTENT_204, message = "OK. New domain is created."), @ApiResponse(code = HttpStatus.BAD_REQUEST_400, message = "Invalid request for domain creation"), @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "Internal server error - Something went bad on the server side.") }) public void defineAddDomain() { service.put(SPECIFIC_DOMAIN, this::addDomain); }
@PUT @Path("/{username}") @ApiOperation(value = "Creating an user") @ApiImplicitParams({ @ApiImplicitParam(required = true, dataType = "string", name = "username", paramType = "path"), @ApiImplicitParam(required = true, dataType = "org.apache.james.webadmin.dto.AddUserRequest", paramType = "body") }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.NO_CONTENT_204, message = "OK. New user is added."), @ApiResponse(code = HttpStatus.BAD_REQUEST_400, message = "Invalid input user."), @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "Internal server error - Something went bad on the server side.") }) public void defineCreateUser() { service.put(USERS + SEPARATOR + USER_NAME, this::upsertUser); }
@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(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); }
@Override public void define(final Service service) { service.get(DOMAIN_MAPPINGS, this::getAllMappings, jsonTransformer); service.get(SPECIFIC_MAPPING, this::getMapping, jsonTransformer); service.put(SPECIFIC_MAPPING, this::addDomainMapping); service.delete(SPECIFIC_MAPPING, this::removeDomainMapping); }
@PUT @Path("/{senderDomain}") @ApiOperation(value = "Store a DLP configuration for given senderDomain") @ApiImplicitParams({ @ApiImplicitParam(required = true, dataType = "string", name = "senderDomain", paramType = "path"), @ApiImplicitParam(required = true, dataType = "org.apache.james.webadmin.dto.DLPConfigurationDTO", paramType = "body") }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.NO_CONTENT_204, message = "OK. DLP configuration is stored."), @ApiResponse(code = HttpStatus.BAD_REQUEST_400, message = "Invalid senderDomain or payload in request", response = ErrorResponder.ErrorDetail.class), @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "The domain does not exist.", response = ErrorResponder.ErrorDetail.class), @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "Internal server error - Something went bad on the server side.", response = ErrorResponder.ErrorDetail.class) }) public void defineStore(Service service) { service.put(SPECIFIC_DLP_RULE_DOMAIN, (request, response) -> { Domain senderDomain = parseDomain(request); DLPConfigurationDTO dto = jsonExtractor.parse(request.body()); DLPRules rules = constructRules(dto); dlpConfigurationStore.store(senderDomain, rules); response.status(HttpStatus.NO_CONTENT_204); return EMPTY_BODY; }); }
@PUT @ApiOperation(value = "Update global sieve quota size") @ApiImplicitParams({ @ApiImplicitParam(required = true, dataType = "long", name = REQUESTED_SIZE, paramType = "body") }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = Long.class), @ApiResponse(code = 400, message = "The body is not a positive integer."), @ApiResponse(code = 500, message = "Internal server error - Something went bad on the server side.") }) public void defineUpdateGlobalSieveQuota(Service service) { service.put(DEFAULT_QUOTA_PATH, (request, response) -> { try { QuotaSize requestedSize = extractRequestedQuotaSizeFromRequest(request); sieveQuotaRepository.setDefaultQuota(requestedSize); response.status(HttpStatus.NO_CONTENT_204); return Constants.EMPTY_BODY; } catch (JsonExtractException e) { LOGGER.info("Malformed JSON", e); throw ErrorResponder.builder() .type(ErrorResponder.ErrorType.INVALID_ARGUMENT) .statusCode(HttpStatus.BAD_REQUEST_400) .message("Malformed JSON") .cause(e) .haltError(); } }, jsonTransformer); }
@Override public void addRoutes(Service service) { requireNonNull(service, "service"); service.get("/events", this::handleGetEvents); service.put("/vehicles/:NAME/integrationLevel", this::handlePutVehicleIntegrationLevel); service.post("/vehicles/:NAME/withdrawal", this::handlePostWithdrawalByVehicle); service.get("/vehicles/:NAME", this::handleGetVehicleByName); service.get("/vehicles", this::handleGetVehicles); service.post("/transportOrders/:NAME/withdrawal", this::handlePostWithdrawalByOrder); service.post("/transportOrders/:NAME", this::handlePostTransportOrder); service.get("/transportOrders/:NAME", this::handleGetTransportOrderByName); service.get("/transportOrders", this::handleGetTransportOrders); }