All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.reactivex.netty.protocol.http.client.HttpClientInterceptorChain Maven / Gradle / Ivy

There is a newer version: 0.5.3-rc.2
Show newest version
/*
 * Copyright 2016 Netflix, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package io.reactivex.netty.protocol.http.client;

/**
 * Interceptor chain for {@link HttpClient}, obtained via {@link HttpClient#intercept()}. 

* * Multiple interceptors can be added to this chain by using the various {@code next*()} methods available, before * calling {@link #finish()} that returns a new {@link HttpClient} which inherits all the configuration from the parent * client (from which this chain was created) and adds these interceptors. * *

Order of execution

* * Interceptors are executed in the order in which they are added. * * @param The type of the content of request. * @param The type of the content of response. */ public interface HttpClientInterceptorChain { /** * Adds a simple interceptor that does not change the type of objects read/written to a connection. * * @param interceptor Interceptor to add. * * @return {@code this} */ HttpClientInterceptorChain next(Interceptor interceptor); /** * Adds an interceptor that changes the type of objects read from the connections created by the client provided by * this chain. * * @param interceptor Interceptor to add. * * @return A new chain instance. */ HttpClientInterceptorChain nextWithReadTransform(TransformingInterceptor interceptor); /** * Adds an interceptor that changes the type of objects written to the connections created by the client provided by * this chain. * * @param interceptor Interceptor to add. * * @return A new chain instance. */ HttpClientInterceptorChain nextWithWriteTransform(TransformingInterceptor interceptor); /** * Adds an interceptor that changes the type of objects read and written to the connections created by the client * provided by this chain. * * @param interceptor Interceptor to add. * * @return A new chain instance. */ HttpClientInterceptorChain nextWithTransform(TransformingInterceptor interceptor); /** * Finish the addition of interceptors and create a new client instance. * * @return New client instance which inherits all the configuration from the parent client * (from which this chain was created) and adds these interceptors. */ InterceptingHttpClient finish(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy