• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
BasicHttpProcessor Class Reference

Keeps lists of interceptors for processing requests and responses. More...

Inheritance diagram for BasicHttpProcessor:
HttpProcessor HttpRequestInterceptorList HttpResponseInterceptorList HttpRequestInterceptor HttpResponseInterceptor

Description

Author
Oleg Kalnichevski
Andrea Selva
Version
Revision
613298
Since
4.0

Notice

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...
 

Member Function Documentation

◆ addResponseInterceptor() [1/2]

void addResponseInterceptor ( HttpResponseInterceptor  itcp,
int  index 
)
Parameters
itcpthe response interceptor to add
indexthe index to insert the interceptor at

Implements HttpResponseInterceptorList.

◆ removeRequestInterceptorByClass()

void removeRequestInterceptorByClass ( final Class  clazz)
Parameters
clazzthe class of the instances to be removed.

Implements HttpRequestInterceptorList.

◆ removeResponseInterceptorByClass()

void removeResponseInterceptorByClass ( final Class  clazz)
Parameters
clazzthe class of the instances to be removed.

Implements HttpResponseInterceptorList.

◆ addInterceptor() [1/2]

final void addInterceptor ( final HttpRequestInterceptor  interceptor)
Parameters
interceptorthe interceptor to add

◆ getRequestInterceptorCount()

int getRequestInterceptorCount ( )
Returns
the number of request interceptors in this list

Implements HttpRequestInterceptorList.

◆ getRequestInterceptor()

HttpRequestInterceptor getRequestInterceptor ( int  index)
Parameters
indexthe index of the interceptor to obtain, 0 for first
Returns
the interceptor at the given index, or null if the index is out of range

Implements HttpRequestInterceptorList.

◆ addResponseInterceptor() [2/2]

void addResponseInterceptor ( final HttpResponseInterceptor  itcp)
Parameters
itcpthe response interceptor to add

Implements HttpResponseInterceptorList.

◆ addInterceptor() [2/2]

final void addInterceptor ( final HttpResponseInterceptor  interceptor)
Parameters
interceptorthe interceptor to add

◆ getResponseInterceptorCount()

int getResponseInterceptorCount ( )
Returns
the number of response interceptors in this list

Implements HttpResponseInterceptorList.

◆ getResponseInterceptor()

HttpResponseInterceptor getResponseInterceptor ( int  index)
Parameters
indexthe index of the interceptor to obtain, 0 for first
Returns
the interceptor at the given index, or null if the index is out of range

Implements HttpResponseInterceptorList.

◆ setInterceptors()

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.

Parameters
listthe list of request and response interceptors from which to initialize

Implements HttpRequestInterceptorList.

◆ process() [1/2]

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.

Parameters
requestthe request to preprocess
contextthe context for the request
Exceptions
IOExceptionin case of an IO problem
HttpExceptionin case of a protocol or other problem

Implements HttpRequestInterceptor.

◆ process() [2/2]

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.

Parameters
responsethe response to postprocess
contextthe context for the request
Exceptions
IOExceptionin case of an IO problem
HttpExceptionin case of a protocol or other problem

Implements HttpResponseInterceptor.

◆ copy()

Returns
new instance of the BasicHttpProcessor