@Override public Future<Response> head(InvocationCallback<Response> callback) { return asyncInvoker.head(callback); }
@Override public Future<Response> head(InvocationCallback<Response> callback) { return asyncInvoker.head(callback); }
@Override public CompletableFuture<Response> head() { CompletableFutureCallbackAdapter adapter = new CompletableFutureCallbackAdapter(); asyncInvoker.head(adapter); return adapter.getCompletableFuture(); }
@Override public CompletableFuture<Response> head() { CompletableFutureCallbackAdapter adapter = new CompletableFutureCallbackAdapter(); asyncInvoker.head(adapter); return adapter.getCompletableFuture(); }
/** * Execute a head request for a resource asynchronously and return the * response. * * @param ib * An invocation builder to execute requests with. * @param request * The original client request object given to the service * client. * @param onSuccess * The callback to invoke on success. * @param onError * The callback to invoke on failure. * @return A Future that can be used to get the Response if no Consumer was * provided. Note, callers should be careful not to read the entity * from both the future and the consumer, as the entity stream may * not be able to support being consumed twice. */ public <T extends BmcRequest> Future<Response> head( @NonNull WrappedInvocationBuilder ib, @NonNull T request, @Nullable Consumer<Response> onSuccess, @Nullable Consumer<Throwable> onError) { InvocationInformation info = preprocessRequest(ib, request); if (onSuccess == null && onError == null) { return ib.async().head(); } else { return ib.async().head(new Callback(baseTarget, info, onSuccess, onError)); } }