use of com.quorum.tessera.recovery.resend.ResendBatchResponse in project tessera by ConsenSys.
the class TransactionResource method resendBatch.
@Operation(summary = "/resendBatch", operationId = "requestPayloadBatchResend", description = "initiate resend of all transactions for a given public key in batches")
@ApiResponse(responseCode = "200", description = "count of total transactions being resent", content = @Content(schema = @Schema(implementation = com.quorum.tessera.p2p.recovery.ResendBatchResponse.class)))
@POST
@Path("resendBatch")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
public Response resendBatch(@Valid @NotNull final ResendBatchRequest resendBatchRequest) {
LOGGER.debug("Received resend request");
final com.quorum.tessera.recovery.resend.ResendBatchRequest request = com.quorum.tessera.recovery.resend.ResendBatchRequest.Builder.create().withPublicKey(resendBatchRequest.getPublicKey()).withBatchSize(resendBatchRequest.getBatchSize()).build();
final ResendBatchResponse response = batchResendManager.resendBatch(request);
final com.quorum.tessera.p2p.recovery.ResendBatchResponse responseEntity = new com.quorum.tessera.p2p.recovery.ResendBatchResponse();
responseEntity.setTotal(response.getTotal());
final Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(responseEntity);
return builder.build();
}
Aggregations