org.springframework.http.ResponseEntity.accepted()

Here are the examples of the java api org.springframework.http.ResponseEntity.accepted() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

80 Examples 7

19 View Source File : RestPojoConfiguration.java
License : Apache License 2.0
Project Creator : spring-cloud

@PostMapping("/")
ResponseEnreplacedy<String> accept(@RequestBody String body) {
    logger.info("ACCEPT");
    this.inputs.add(body);
    return ResponseEnreplacedy.accepted().body(body);
}

19 View Source File : OnDemandCollectorTriggerController.java
License : Apache License 2.0
Project Creator : pacphi

@PostMapping("/collect")
public Mono<ResponseEnreplacedy<Void>> triggerCollection() {
    tkCollector.collect();
    if (productsAndReleasesCollector != null) {
        productsAndReleasesCollector.collect();
    }
    return Mono.just(ResponseEnreplacedy.accepted().build());
}

19 View Source File : TodoController.java
License : MIT License
Project Creator : nielsutrecht

@RequestMapping(value = "/me/{todo}", method = RequestMethod.DELETE)
public Callable<ResponseEnreplacedy<?>> deleteTodo(@RequestHeader("user-id") final UUID userId, @PathVariable("todo") final String todoList) {
    log.info("DELETE todo {} for user {}", todoList, userId);
    return () -> {
        repository.delete(userId, todoList);
        return ResponseEnreplacedy.accepted().build();
    };
}

19 View Source File : TodoController.java
License : MIT License
Project Creator : nielsutrecht

@RequestMapping(value = "/me", method = RequestMethod.DELETE)
public Callable<ResponseEnreplacedy<?>> deleteAll(@RequestHeader("user-id") final UUID userId) {
    log.info("DELETE all todo's for user {}", userId);
    return () -> {
        repository.delete(userId);
        return ResponseEnreplacedy.accepted().build();
    };
}

19 View Source File : TodoController.java
License : MIT License
Project Creator : nielsutrecht

@RequestMapping(value = "/me", method = RequestMethod.POST)
public Callable<ResponseEnreplacedy<Void>> createTodoList(@RequestHeader("user-id") final UUID userId, @RequestBody TodoList todoList) {
    return () -> {
        repository.add(userId, todoList);
        return ResponseEnreplacedy.accepted().build();
    };
}

19 View Source File : DamnYouController.java
License : MIT License
Project Creator : Jannchie

@RequestMapping(method = RequestMethod.POST, value = "/api/damn-you/upload/info")
public ResponseEnreplacedy<Result<String>> uploadInfo(@RequestParam("file") MultipartFile file) throws IOException {
    damnYouService.saveInfoData(file);
    return ResponseEnreplacedy.accepted().body(new Result<>(ResultEnum.ACCEPTED));
}

19 View Source File : DamnYouController.java
License : MIT License
Project Creator : Jannchie

@RequestMapping(method = RequestMethod.POST, value = "/api/damn-you/upload/history")
public ResponseEnreplacedy<Result<String>> uploadHistory(@RequestParam("file") MultipartFile file) throws IOException {
    damnYouService.saveHistoryData(file);
    return ResponseEnreplacedy.accepted().body(new Result<>(ResultEnum.ACCEPTED));
}

19 View Source File : ProductAPI.java
License : MIT License
Project Creator : hellokoding

@PutMapping("/{id}")
public ResponseEnreplacedy<ResponseDTO> update(@PathVariable Long id, @RequestBody @Valid Product product) {
    ResponseDTO responseDTO = ResponseDTO.builder().status(HttpStatus.ACCEPTED.toString()).body(productService.save(product)).build();
    return ResponseEnreplacedy.accepted().body(responseDTO);
}

19 View Source File : ProductAPI.java
License : MIT License
Project Creator : hellokoding

@DeleteMapping("/{id}")
public ResponseEnreplacedy<ResponseDTO> delete(@PathVariable @ProductIDExisting Long id) {
    productService.deleteById(id);
    ResponseDTO responseDTO = ResponseDTO.builder().status(HttpStatus.ACCEPTED.toString()).build();
    return ResponseEnreplacedy.accepted().body(responseDTO);
}

19 View Source File : ProductAPI.java
License : MIT License
Project Creator : hellokoding

@DeleteMapping("/{id}")
public ResponseEnreplacedy delete(@PathVariable Long id) {
    productService.deleteById(id);
    return ResponseEnreplacedy.accepted().build();
}

19 View Source File : ProductAPI.java
License : MIT License
Project Creator : hellokoding

@PutMapping("/{id}")
public ResponseEnreplacedy<Product> update(@PathVariable Long id, @RequestBody Product product) {
    return ResponseEnreplacedy.accepted().body(productService.save(product));
}

19 View Source File : StockAPI.java
License : MIT License
Project Creator : hellokoding

@DeleteMapping("/{id}")
public ResponseEnreplacedy delete(@PathVariable Long id) {
    stockService.deleteById(id);
    return ResponseEnreplacedy.accepted().build();
}

19 View Source File : StockAPI.java
License : MIT License
Project Creator : hellokoding

@PatchMapping("/{stockId}")
public ResponseEnreplacedy<Stock> update(@PathVariable Long stockId, @RequestBody Stock updatingStock) {
    Optional<Stock> stockOptional = stockService.findById(stockId);
    if (!stockOptional.isPresent()) {
        log.error("StockId " + stockId + " is not existed");
        ResponseEnreplacedy.badRequest().build();
    }
    Stock stock = stockOptional.get();
    if (!StringUtils.isEmpty(updatingStock.getName()))
        stock.setName(updatingStock.getName());
    if (!Objects.isNull(updatingStock.getPrice()))
        stock.setPrice(updatingStock.getPrice());
    return ResponseEnreplacedy.accepted().body(stockService.save(stock));
}

19 View Source File : CommandsController.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@DeleteMapping("/{boardUuid}/stories/{storyUuid}")
public ResponseEnreplacedy removeStoryFromBoard(@PathVariable("boardUuid") UUID boardUuid, @PathVariable("storyUuid") UUID storyUuid) {
    log.debug("removeStoryFromBoard : enter");
    this.service.deleteStory(boardUuid, storyUuid);
    return ResponseEnreplacedy.accepted().build();
}

19 View Source File : CommandsController.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@PutMapping("/{boardUuid}/stories/{storyUuid}")
public ResponseEnreplacedy updateStoryOnBoard(@PathVariable("boardUuid") UUID boardUuid, @PathVariable("storyUuid") UUID storyUuid, @RequestParam("name") String name) {
    log.debug("updateStoryOnBoard : enter");
    this.service.updateStory(boardUuid, storyUuid, name);
    return ResponseEnreplacedy.accepted().build();
}

19 View Source File : DataHubUploadController.java
License : Creative Commons Zero v1.0 Universal
Project Creator : CDCgov

@GetMapping(value = "/testEvent", produces = { "text/csv" })
public ResponseEnreplacedy<?> exportTestEventCSV(HttpServletResponse response, @RequestParam(defaultValue = "") String organizationExternalId) throws IOException {
    var csvContent = _hubuploadservice.createTestCSVForDataHub(organizationExternalId);
    response.setContentType("text/csv");
    DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
    String currentDateTime = dateFormatter.format(new Date());
    String headerKey = "Content-Disposition";
    String headerValue = "attachment; filename=testEvents_" + currentDateTime + ".csv";
    response.setHeader(headerKey, headerValue);
    response.getWriter().print(csvContent);
    return ResponseEnreplacedy.accepted().build();
}

19 View Source File : MigrationRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(AcceptedTokenType.SYSTEM)
@RequestMapping(value = "/initialize", method = RequestMethod.POST, consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEnreplacedy<Void> initialize() throws InterruptedException {
    this.commandGateway.process(new InitializeServiceCommand());
    return ResponseEnreplacedy.accepted().build();
}

19 View Source File : PaymentResource.java
License : Apache License 2.0
Project Creator : adorsys

@Override
@PreAuthorize("hasPartialScope() and hasAccessToAccountByPaymentId(#paymentId)")
public ResponseEnreplacedy<SCAPaymentResponseTO> executePayment(String paymentId) {
    return ResponseEnreplacedy.accepted().body(paymentService.executePayment(scaInfoHolder.getScaInfo(), paymentId));
}

18 View Source File : ElasticsearchIndexResource.java
License : Apache License 2.0
Project Creator : xm-online

/**
 * POST  /elasticsearch/index -> Reindex all Elasticsearch doreplacedents
 */
@PostMapping("/elasticsearch/index")
@Timed
@PreAuthorize("hasPermission(null, 'ELASTICSEARCH.INDEX')")
@PrivilegeDescription("Privilege to reindex all Elasticsearch doreplacedents")
public ResponseEnreplacedy<Void> reindexAll() {
    elasticsearchIndexService.reindexAllAsync();
    return ResponseEnreplacedy.accepted().build();
}

18 View Source File : PoliciesController.java
License : Apache License 2.0
Project Creator : pacphi

@PostMapping("policies/refresh")
public Mono<ResponseEnreplacedy<Void>> refreshPolicies() {
    if (policiesLoader != null) {
        policiesLoader.load();
        return Mono.just(ResponseEnreplacedy.accepted().build());
    } else {
        return Mono.just(ResponseEnreplacedy.notFound().build());
    }
}

18 View Source File : OnDemandPolicyTriggerController.java
License : Apache License 2.0
Project Creator : pacphi

@PostMapping("/policies/execute")
public Mono<ResponseEnreplacedy<Void>> triggerPolicyExection() {
    Map<String, PolicyExecutorTask> taskMap = factory.getBeansOfType(PolicyExecutorTask.clreplaced);
    Collection<PolicyExecutorTask> tasks = taskMap.values();
    tasks.forEach(PolicyExecutorTask::execute);
    return Mono.just(ResponseEnreplacedy.accepted().build());
}

18 View Source File : TodoController.java
License : MIT License
Project Creator : nielsutrecht

@RequestMapping(value = "", method = RequestMethod.DELETE)
@Restrict
public Callable<ResponseEnreplacedy<?>> deleteAllTodos() {
    log.info("DELETE all todo's");
    return () -> {
        repository.deleteAll();
        return ResponseEnreplacedy.accepted().build();
    };
}

18 View Source File : EventStoreController.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@PostMapping("/")
public ResponseEnreplacedy saveEvent(@RequestBody String json) {
    Tuple event = TupleBuilder.fromString(json);
    replacedert.isTrue(event.hasFieldName("eventType"), "eventType is required");
    replacedert.isTrue(event.hasFieldName("boardUuid"), "boardUuid is required");
    replacedert.isTrue(event.hasFieldName("occurredOn"), "occurredOn is required");
    this.service.processDomainEvent(event);
    return ResponseEnreplacedy.accepted().build();
}

18 View Source File : CommandsController.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@PatchMapping("/{boardUuid}")
public ResponseEnreplacedy renameBoard(@PathVariable("boardUuid") UUID boardUuid, @RequestParam("name") String name, final UriComponentsBuilder uriComponentsBuilder) {
    log.debug("renameBoard : enter");
    this.service.renameBoard(boardUuid, name);
    return ResponseEnreplacedy.accepted().build();
}

18 View Source File : ApiControllerTests.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@Test
public void testDeleteStoryOnBoard() throws Exception {
    UUID boardUuid = UUID.randomUUID();
    UUID storyUuid = UUID.randomUUID();
    when(this.service.deleteStory(any(UUID.clreplaced), any(UUID.clreplaced))).thenReturn(ResponseEnreplacedy.accepted().build());
    this.mockMvc.perform(RestDoreplacedentationRequestBuilders.delete("/boards/{boardUuid}/stories/{storyUuid}", boardUuid, storyUuid)).andDo(print()).andExpect(status().isAccepted()).andDo(doreplacedent("delete-story", pathParameters(parameterWithName("boardUuid").description("The unique id of the board"), parameterWithName("storyUuid").description("The unique id of the story on the board to be deleted"))));
    verify(this.service, times(1)).deleteStory(any(UUID.clreplaced), any(UUID.clreplaced));
}

18 View Source File : ApiControllerTests.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@Test
public void testUpdateStoryOnBoard() throws Exception {
    UUID boardUuid = UUID.randomUUID();
    UUID storyUuid = UUID.randomUUID();
    when(this.service.updateStory(any(UUID.clreplaced), any(UUID.clreplaced), anyString())).thenReturn(ResponseEnreplacedy.accepted().build());
    this.mockMvc.perform(put("/boards/{boardUuid}/stories/{storyUuid}", boardUuid, storyUuid).param("name", "Test Story Updated")).andDo(print()).andExpect(status().isAccepted()).andDo(doreplacedent("update-story", pathParameters(parameterWithName("boardUuid").description("The unique id of the board"), parameterWithName("storyUuid").description("The unique id of the story on the board")), requestParameters(parameterWithName("name").description("The new name of the Board"))));
    verify(this.service, times(1)).updateStory(any(UUID.clreplaced), any(UUID.clreplaced), anyString());
}

18 View Source File : ApiControllerTests.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@Test
public void testRenameBoard() throws Exception {
    UUID boardUuid = UUID.randomUUID();
    when(this.service.renameBoard(any(UUID.clreplaced), anyString())).thenReturn(ResponseEnreplacedy.accepted().build());
    this.mockMvc.perform(patch("/boards/{boardUuid}", boardUuid).param("name", "Test Board")).andDo(print()).andExpect(status().isAccepted()).andDo(doreplacedent("rename-board", pathParameters(parameterWithName("boardUuid").description("The unique id of the board")), requestParameters(parameterWithName("name").description("The new name of the Board"))));
    verify(this.service, times(1)).renameBoard(any(UUID.clreplaced), anyString());
}

18 View Source File : TppController.java
License : Apache License 2.0
Project Creator : adorsys

@Override
public ResponseEnreplacedy<Void> consumeTan(String tan) {
    log.info("\n***\nReceived message from CoreBanking: {} \n***", tan);
    return ResponseEnreplacedy.accepted().build();
}

18 View Source File : ObaConsentControllerTest.java
License : Apache License 2.0
Project Creator : adorsys

@Test
void confirm() {
    // When
    ResponseEnreplacedy<Void> response = controller.confirm(LOGIN, CONSENT_ID, AUTH_ID, TAN);
    // Then
    replacedertEquals(ResponseEnreplacedy.accepted().build(), response);
}

18 View Source File : ObaAuthorizationApiController.java
License : Apache License 2.0
Project Creator : adorsys

@Override
public ResponseEnreplacedy<Void> editSelf(UserTO user) {
    userMgmtRestClient.editSelf(user);
    return ResponseEnreplacedy.accepted().build();
}

18 View Source File : AdminResourceTest.java
License : Apache License 2.0
Project Creator : adorsys

@Test
void updatePreplacedword() {
    ResponseEnreplacedy<Void> result = resource.updatePreplacedword(TPP_ID, PIN);
    replacedertEquals(ResponseEnreplacedy.accepted().build(), result);
}

17 View Source File : MessageControllerTest.java
License : Apache License 2.0
Project Creator : SpartaSystems

@Test
public void shouldCallMessageServiceToForwardMail() {
    final int ID = 345;
    final String RECIPIENT = "[email protected]";
    ResponseEnreplacedy response = messageControllerSpy.fowardMail(ID, new MessageForwardCommand(RECIPIENT));
    Mockito.verify(messageServiceMock).forwardMessage(ID, RECIPIENT);
    replacedertThat(response).isEqualTo(ResponseEnreplacedy.accepted().build());
}

17 View Source File : TransactionTypeRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.THOTH_TX_TYPES)
@RequestMapping(value = "/{code}", method = RequestMethod.PUT, produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
ResponseEnreplacedy<Void> changeTransactionType(@PathVariable("code") final String code, @RequestBody @Valid final TransactionType transactionType) {
    if (!code.equals(transactionType.getCode())) {
        throw ServiceException.badRequest("Given transaction type {0} must match request path.", code);
    }
    if (!this.transactionTypeService.findByIdentifier(code).isPresent()) {
        throw ServiceException.notFound("Transaction type '{0}' not found.", code);
    }
    this.commandGateway.process(new ChangeTransactionTypeCommand(transactionType));
    return ResponseEnreplacedy.accepted().build();
}

17 View Source File : FinTechOauth2AuthenticationImpl.java
License : Apache License 2.0
Project Creator : adorsys

@Override
public ResponseEnreplacedy<Void> oauthLoginPOST(UUID xRequestID, String idpProviderId) {
    Oauth2Authenticator authenticator = authenticators.stream().filter(it -> it.getProvider().name().toLowerCase().equals(idpProviderId)).findFirst().orElseThrow(() -> new IllegalArgumentException("No IDP provider handler: " + idpProviderId));
    Oauth2AuthResult result = authenticator.authenticateByRedirectingUserToIdp();
    return ResponseEnreplacedy.accepted().header(SET_COOKIE, properties.getOauth2cookie().buildCookie(COOKIE_OAUTH2_COOKIE_NAME, result.getState())).header("Location", result.getRedirectTo().toASCIIString()).build();
}

17 View Source File : AdminResource.java
License : Apache License 2.0
Project Creator : adorsys

@Override
@PreAuthorize("hasRole('SYSTEM')")
public ResponseEnreplacedy<Void> updatePreplacedword(String branchId, String preplacedword) {
    middlewareUserService.updatePreplacedwordIfRequired(branchId, preplacedword);
    return ResponseEnreplacedy.accepted().build();
}

16 View Source File : EventStoreBoardClientTests.java
License : GNU General Public License v3.0
Project Creator : dmfrey

@Test
public void testSave() throws Exception {
    UUID boardUuid = UUID.randomUUID();
    Board board = createTestBoard(boardUuid);
    when(this.eventStoreClient.addNewDomainEvent(any(DomainEvent.clreplaced))).thenReturn(ResponseEnreplacedy.accepted().build());
    this.boardClient.save(board);
    verify(this.eventStoreClient, times(1)).addNewDomainEvent(any(DomainEvent.clreplaced));
}

16 View Source File : TransactionTypeRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.THOTH_TX_TYPES)
@RequestMapping(value = "", method = RequestMethod.POST, produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
ResponseEnreplacedy<Void> createTransactionType(@RequestBody @Valid final TransactionType transactionType) {
    if (this.transactionTypeService.findByIdentifier(transactionType.getCode()).isPresent()) {
        throw ServiceException.conflict("Transaction type '{0}' already exists.", transactionType.getCode());
    }
    this.commandGateway.process(new CreateTransactionTypeCommand(transactionType));
    return ResponseEnreplacedy.accepted().build();
}

16 View Source File : LedgerRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.THOTH_LEDGER)
@RequestMapping(value = "/{identifier}", method = RequestMethod.PUT, produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
ResponseEnreplacedy<Void> modifyLedger(@PathVariable("identifier") final String identifier, @RequestBody @Valid final Ledger ledger) {
    if (!identifier.equals(ledger.getIdentifier())) {
        throw ServiceException.badRequest("Addressed resource {0} does not match ledger {1}", identifier, ledger.getIdentifier());
    }
    if (!this.ledgerService.findLedger(identifier).isPresent()) {
        throw ServiceException.notFound("Ledger {0} not found.", identifier);
    }
    this.commandGateway.process(new ModifyLedgerCommand(ledger));
    return ResponseEnreplacedy.accepted().build();
}

16 View Source File : LedgerRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.THOTH_LEDGER)
@RequestMapping(value = "/{identifier}", method = RequestMethod.POST, produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
ResponseEnreplacedy<Void> addSubLedger(@PathVariable("identifier") final String identifier, @RequestBody @Valid final Ledger subLedger) {
    final Optional<Ledger> optionalParentLedger = this.ledgerService.findLedger(identifier);
    if (optionalParentLedger.isPresent()) {
        final Ledger parentLedger = optionalParentLedger.get();
        if (!parentLedger.getType().equals(subLedger.getType())) {
            throw ServiceException.badRequest("Ledger type must be the same.");
        }
    } else {
        throw ServiceException.notFound("Parent ledger {0} not found.", identifier);
    }
    if (this.ledgerService.findLedger(subLedger.getIdentifier()).isPresent()) {
        throw ServiceException.conflict("Ledger {0} already exists.", subLedger.getIdentifier());
    }
    this.commandGateway.process(new AddSubLedgerCommand(identifier, subLedger));
    return ResponseEnreplacedy.accepted().build();
}

16 View Source File : UserMgmtResource.java
License : Apache License 2.0
Project Creator : adorsys

@Override
@PreAuthorize("isSameUser(#user.id)")
public ResponseEnreplacedy<Void> editSelf(UserTO user) {
    middlewareUserService.editBasicSelf(scaInfoHolder.getUserId(), user);
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : MessageController.java
License : Apache License 2.0
Project Creator : SpartaSystems

@RequestMapping(value = "/{messageId}/forward", method = RequestMethod.POST)
public ResponseEnreplacedy fowardMail(@PathVariable("messageId") long messageId, @Valid @RequestBody MessageForwardCommand forwardCommand) {
    messageService.forwardMessage(messageId, forwardCommand.getRecipient());
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : AbstractSourceControlWebHookController.java
License : Apache License 2.0
Project Creator : societe-generale

protected ResponseEnreplacedy<?> processPushEvent(PushEvent pushEvent) {
    if (shouldNotProcess(pushEvent)) {
        return ResponseEnreplacedy.accepted().build();
    }
    String repoDefaultBranch = pushEvent.getRepository().getDefaultBranch();
    String eventRef = pushEvent.getRef();
    Message rawPushEventMessage = MessageBuilder.withPayload(pushEvent.getRawMessage().getBody()).build();
    if (eventRef.endsWith(repoDefaultBranch)) {
        log.info("sending to consumers : Pushevent on default branch {} on repo {}", repoDefaultBranch, pushEvent.getRepository().getFullName());
        pushOnDefaultBranchChannel.send(rawPushEventMessage);
    } else if (processNonDefaultBranchEvents) {
        log.info("sending to consumers : Pushevent on NON default branch {} on repo {}", repoDefaultBranch, pushEvent.getRepository().getName());
        pushOnNonDefaultBranchChannel.send(rawPushEventMessage);
    } else {
        log.info("Not sending pushevent on NON default branch {} on repo {}", repoDefaultBranch, pushEvent.getRepository().getFullName());
    }
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : AbstractSourceControlWebHookController.java
License : Apache License 2.0
Project Creator : societe-generale

ResponseEnreplacedy<?> processPullRequestEvent(PullRequestEvent pullRequestEvent) {
    if (shouldNotProcess(pullRequestEvent)) {
        return ResponseEnreplacedy.accepted().build();
    }
    Message rawPullRequestEventMessage = MessageBuilder.withPayload(pullRequestEvent.getRawMessage().getBody()).build();
    log.info("sending to consumers : MergeRequestEvent for PR #{} on repo {}", pullRequestEvent.getPrNumber(), pullRequestEvent.getRepository().getName());
    pullRequestEventChannel.send(rawPullRequestEventMessage);
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : PaymentController.java
License : GNU General Public License v3.0
Project Creator : sandokandias

@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public Callable<CompletionStage<ResponseEnreplacedy<?>>> process(@Valid @RequestBody PerformPaymentRequest request) {
    LOG.debug("Request {}", request);
    return () -> {
        LOG.debug("Callable...");
        PerformPayment performPayment = PerformPayment.commandOf(new CustomerId(request.getCustomerId()), PaymentIntent.valueOf(request.getPaymentIntent()), PaymentMethod.valueOf(request.getPaymentMethod()), request.getTransaction());
        CompletionStage<Either<CommandFailure, Tuple2<PaymentId, PaymentStatus>>> promise = paymentProcessManager.process(performPayment);
        return promise.thenApply(acceptOrReject -> acceptOrReject.fold(reject -> ResponseEnreplacedy.badRequest().body(reject), accept -> ResponseEnreplacedy.accepted().body(new PerformPaymentResponse(accept._1.id, accept._2.name()))));
    };
}

15 View Source File : JLineupController.java
License : Apache License 2.0
Project Creator : otto-de

@PostMapping(value = "/runs")
public ResponseEnreplacedy<RunBeforeResponse> runBefore(@RequestBody JobConfig jobConfig, HttpServletRequest request) throws Exception {
    String id = jLineupService.startBeforeRun(jobConfig).getId();
    HttpHeaders headers = new HttpHeaders();
    headers.setLocation(URI.create(request.getContextPath() + "/runs/" + id));
    return ResponseEnreplacedy.accepted().headers(headers).body(new RunBeforeResponse(id));
}

15 View Source File : LedgerRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.THOTH_LEDGER)
@RequestMapping(method = RequestMethod.POST, produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
ResponseEnreplacedy<Void> createLedger(@RequestBody @Valid final Ledger ledger) {
    if (ledger.getParentLedgerIdentifier() != null) {
        throw ServiceException.badRequest("Ledger {0} is not a root.", ledger.getIdentifier());
    }
    if (this.ledgerService.findLedger(ledger.getIdentifier()).isPresent()) {
        throw ServiceException.conflict("Ledger {0} already exists.", ledger.getIdentifier());
    }
    this.commandGateway.process(new CreateLedgerCommand(ledger));
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : LedgerRestController.java
License : Apache License 2.0
Project Creator : apache

@Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.THOTH_LEDGER)
@RequestMapping(value = "/{identifier}", method = RequestMethod.DELETE, produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.ALL_VALUE })
@ResponseBody
ResponseEnreplacedy<Void> deleteLedger(@PathVariable("identifier") final String identifier) {
    final Optional<Ledger> optionalLedger = this.ledgerService.findLedger(identifier);
    if (optionalLedger.isPresent()) {
        final Ledger ledger = optionalLedger.get();
        if (!ledger.getSubLedgers().isEmpty()) {
            throw ServiceException.conflict("Ledger {0} holds sub ledgers.", identifier);
        }
    } else {
        throw ServiceException.notFound("Ledger {0} not found.", identifier);
    }
    if (this.ledgerService.hasAccounts(identifier)) {
        throw ServiceException.conflict("Ledger {0} has replacedigned accounts.", identifier);
    }
    this.commandGateway.process(new DeleteLedgerCommand(identifier));
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : ChannelsController.java
License : Apache License 2.0
Project Creator : airyhq

private ResponseEnreplacedy<?> disconnect(@RequestBody @Valid DisconnectChannelRequestPayload requestPayload) {
    final String channelId = requestPayload.getChannelId().toString();
    final Channel channel = stores.getChannelsStore().get(channelId);
    if (channel == null) {
        return ResponseEnreplacedy.notFound().build();
    }
    if (channel.getConnectionState().equals(ChannelConnectionState.DISCONNECTED)) {
        return ResponseEnreplacedy.accepted().body(new EmptyResponsePayload());
    }
    channel.setConnectionState(ChannelConnectionState.DISCONNECTED);
    channel.setToken(null);
    try {
        stores.storeChannel(channel);
    } catch (Exception e) {
        return ResponseEnreplacedy.status(HttpStatus.SERVICE_UNAVAILABLE).build();
    }
    return ResponseEnreplacedy.ok(new EmptyResponsePayload());
}

15 View Source File : AccountMgmStaffResource.java
License : Apache License 2.0
Project Creator : adorsys

@Override
@PreAuthorize("hasManagerAccessToAccountId(#accountId) && isEnabledAccount(#accountId)")
public ResponseEnreplacedy<Void> depositCash(String accountId, AmountTO amount) {
    middlewareAccountService.depositCash(scaInfoHolder.getScaInfo(), accountId, amount);
    return ResponseEnreplacedy.accepted().build();
}

15 View Source File : AccountMgmStaffResource.java
License : Apache License 2.0
Project Creator : adorsys

@Override
@PreAuthorize("hasManagerAccessToAccountId(#accountId)")
public ResponseEnreplacedy<Void> changeCreditLimit(String accountId, BigDecimal creditLimit) {
    middlewareAccountService.changeCreditLimit(accountId, creditLimit);
    return ResponseEnreplacedy.accepted().build();
}

See More Examples