Keeps lists of interceptors for processing requests and responses. More...
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * 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. */
Public Member Functions | |
void | addRequestInterceptor (final HttpRequestInterceptor itcp) |
non-Javadoc, see interface HttpRequestInterceptorList | |
void | addRequestInterceptor (final HttpRequestInterceptor itcp, int index) |
non-Javadoc, see interface HttpRequestInterceptorList | |
void | addResponseInterceptor (HttpResponseInterceptor itcp, int index) |
Inserts a response interceptor at the specified index. More... | |
void | removeRequestInterceptorByClass (final Class clazz) |
Removes all request interceptor of the specified class. More... | |
void | removeResponseInterceptorByClass (final Class clazz) |
Removes all response interceptor of the specified class. More... | |
final void | addInterceptor (final HttpRequestInterceptor interceptor) |
Same as addRequestInterceptor . More... | |
int | getRequestInterceptorCount () |
Obtains the current size of this list. More... | |
HttpRequestInterceptor | getRequestInterceptor (int index) |
Obtains a request interceptor from this list. More... | |
void | clearRequestInterceptors () |
Removes all request interceptors from this list. | |
void | addResponseInterceptor (final HttpResponseInterceptor itcp) |
Appends a response interceptor to this list. More... | |
final void | addInterceptor (final HttpResponseInterceptor interceptor) |
Same as (HttpResponseInterceptor) addResponseInterceptor . More... | |
int | getResponseInterceptorCount () |
Obtains the current size of this list. More... | |
HttpResponseInterceptor | getResponseInterceptor (int index) |
Obtains a response interceptor from this list. More... | |
void | clearResponseInterceptors () |
Removes all response interceptors from this list. | |
void | setInterceptors (final List list) |
Sets the interceptor lists. More... | |
void | clearInterceptors () |
Clears both interceptor lists maintained by this processor. | |
void | process (final HttpRequest request, final HttpContext context) throws IOException, HttpException |
Processes a request. More... | |
void | process (final HttpResponse response, final HttpContext context) throws IOException, HttpException |
Processes a response. More... | |
BasicHttpProcessor | copy () |
Creates a copy of this instance. More... | |
void addResponseInterceptor | ( | HttpResponseInterceptor | itcp, |
int | index | ||
) |
itcp | the response interceptor to add |
index | the index to insert the interceptor at |
Implements HttpResponseInterceptorList.
void removeRequestInterceptorByClass | ( | final Class | clazz | ) |
clazz | the class of the instances to be removed. |
Implements HttpRequestInterceptorList.
void removeResponseInterceptorByClass | ( | final Class | clazz | ) |
clazz | the class of the instances to be removed. |
Implements HttpResponseInterceptorList.
final void addInterceptor | ( | final HttpRequestInterceptor | interceptor | ) |
interceptor | the interceptor to add |
int getRequestInterceptorCount | ( | ) |
Implements HttpRequestInterceptorList.
HttpRequestInterceptor getRequestInterceptor | ( | int | index | ) |
index | the index of the interceptor to obtain, 0 for first |
null
if the index is out of range Implements HttpRequestInterceptorList.
void addResponseInterceptor | ( | final HttpResponseInterceptor | itcp | ) |
itcp | the response interceptor to add |
Implements HttpResponseInterceptorList.
final void addInterceptor | ( | final HttpResponseInterceptor | interceptor | ) |
interceptor | the interceptor to add |
int getResponseInterceptorCount | ( | ) |
Implements HttpResponseInterceptorList.
HttpResponseInterceptor getResponseInterceptor | ( | int | index | ) |
index | the index of the interceptor to obtain, 0 for first |
null
if the index is out of range Implements HttpResponseInterceptorList.
void setInterceptors | ( | final List | list | ) |
First, both interceptor lists maintained by this processor will be cleared. Subsequently, elements of the argument list that are request interceptors will be added to the request interceptor list. Elements that are response interceptors will be added to the response interceptor list. Elements that are both request and response interceptor will be added to both lists. Elements that are neither request nor response interceptor will be ignored.
list | the list of request and response interceptors from which to initialize |
Implements HttpRequestInterceptorList.
void process | ( | final HttpRequest | request, |
final HttpContext | context | ||
) | throws IOException, HttpException |
On the client side, this step is performed before the request is sent to the server. On the server side, this step is performed on incoming messages before the message body is evaluated.
request | the request to preprocess |
context | the context for the request |
IOException | in case of an IO problem |
HttpException | in case of a protocol or other problem |
Implements HttpRequestInterceptor.
void process | ( | final HttpResponse | response, |
final HttpContext | context | ||
) | throws IOException, HttpException |
On the server side, this step is performed before the response is sent to the client. On the client side, this step is performed on incoming messages before the message body is evaluated.
response | the response to postprocess |
context | the context for the request |
IOException | in case of an IO problem |
HttpException | in case of a protocol or other problem |
Implements HttpResponseInterceptor.
BasicHttpProcessor copy | ( | ) |