001/*
002 * Copyright 2002-2017 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.http.client;
018
019import java.io.IOException;
020
021import org.springframework.http.HttpRequest;
022import org.springframework.util.concurrent.ListenableFuture;
023
024/**
025 * Represents the context of a client-side HTTP request execution.
026 *
027 * <p>Used to invoke the next interceptor in the interceptor chain, or -
028 * if the calling interceptor is last - execute the request itself.
029 *
030 * @author Jakub Narloch
031 * @author Rossen Stoyanchev
032 * @since 4.3
033 * @see AsyncClientHttpRequestInterceptor
034 * @deprecated as of Spring 5.0, in favor of
035 * {@link org.springframework.web.reactive.function.client.ExchangeFilterFunction}
036 */
037@Deprecated
038public interface AsyncClientHttpRequestExecution {
039
040        /**
041         * Resume the request execution by invoking the next interceptor in the chain
042         * or executing the request to the remote service.
043         * @param request the HTTP request, containing the HTTP method and headers
044         * @param body the body of the request
045         * @return a corresponding future handle
046         * @throws IOException in case of I/O errors
047         */
048        ListenableFuture<ClientHttpResponse> executeAsync(HttpRequest request, byte[] body) throws IOException;
049
050}