package org.glassfish.jersey.client;
import javax.ws.rs.client.AsyncInvoker;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.InvocationCallback;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;
import java.util.concurrent.CompletableFuture;
abstract class CompletableFutureAsyncInvoker
extends AbstractNonSyncInvoker<CompletableFuture> implements AsyncInvoker {
@Override
public <R> CompletableFuture<R> get(InvocationCallback<R> callback) {
return method("GET", callback);
}
@Override
public <R> CompletableFuture<R> put(Entity<?> entity, InvocationCallback<R> callback) {
return method("PUT", entity, callback);
}
@Override
public <R> CompletableFuture<R> post(Entity<?> entity, InvocationCallback<R> callback) {
return method("POST", entity, callback);
}
@Override
public <R> CompletableFuture<R> delete(InvocationCallback<R> callback) {
return method("DELETE", callback);
}
@Override
public CompletableFuture<Response> head(InvocationCallback<Response> callback) {
return method("HEAD", callback);
}
@Override
public <R> CompletableFuture<R> options(InvocationCallback<R> callback) {
return method("OPTIONS", callback);
}
@Override
public <R> CompletableFuture<R> trace(InvocationCallback<R> callback) {
return method("TRACE", callback);
}
@Override
public abstract <R> CompletableFuture<R> method(String name, InvocationCallback<R> callback);
@Override
public abstract <R> CompletableFuture<R> method(String name, Entity<?> entity, InvocationCallback<R> callback);
@Override
public abstract <R> CompletableFuture method(String name, Entity<?> entity, Class<R> responseType);
@Override
public abstract <R> CompletableFuture method(String name, Entity<?> entity, GenericType<R> responseType);
}