com.quorum.tessera.p2p.resend.RestResendClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sync-jaxrs Show documentation
Show all versions of sync-jaxrs Show documentation
Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.
The newest version!
package com.quorum.tessera.p2p.resend;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import java.util.Objects;
class RestResendClient implements ResendClient {
private final Client client;
RestResendClient(final Client client) {
this.client = Objects.requireNonNull(client);
}
@Override
public boolean makeResendRequest(final String targetUrl, final ResendRequest request) {
final Entity outboundEntity = Entity.entity(request, MediaType.APPLICATION_JSON);
try (Response response =
client.target(targetUrl).path("/resend").request().post(outboundEntity)) {
return Response.Status.OK.getStatusCode() == response.getStatus();
}
}
}