HttpRequestInterceptorList.java revision d42abb2fd917184764daf22f5f299e848b8701d7
1/*
2 * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java $
3 * $Revision: 554903 $
4 * $Date: 2007-07-10 03:54:17 -0700 (Tue, 10 Jul 2007) $
5 *
6 * ====================================================================
7 * Licensed to the Apache Software Foundation (ASF) under one
8 * or more contributor license agreements.  See the NOTICE file
9 * distributed with this work for additional information
10 * regarding copyright ownership.  The ASF licenses this file
11 * to you under the Apache License, Version 2.0 (the
12 * "License"); you may not use this file except in compliance
13 * with the License.  You may obtain a copy of the License at
14 *
15 *   http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing,
18 * software distributed under the License is distributed on an
19 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20 * KIND, either express or implied.  See the License for the
21 * specific language governing permissions and limitations
22 * under the License.
23 * ====================================================================
24 *
25 * This software consists of voluntary contributions made by many
26 * individuals on behalf of the Apache Software Foundation.  For more
27 * information on the Apache Software Foundation, please see
28 * <http://www.apache.org/>.
29 *
30 */
31
32package org.apache.http.protocol;
33
34import java.util.List;
35
36import org.apache.http.HttpRequestInterceptor;
37
38/**
39 * Provides access to an ordered list of request interceptors.
40 * Lists are expected to be built upfront and used read-only afterwards
41 * for {@link HttpProcessor processing}.
42 *
43 * @author <a href="mailto:rolandw at apache.org">Roland Weber</a>
44 *
45 * @version $Revision: 554903 $
46 *
47 * @since 4.0
48 *
49 * @deprecated Please use {@link java.net.URL#openConnection} instead.
50 *     Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a>
51 *     for further details.
52 */
53@Deprecated
54public interface HttpRequestInterceptorList {
55
56    /**
57     * Appends a request interceptor to this list.
58     *
59     * @param itcp      the request interceptor to add
60     */
61    void addRequestInterceptor(HttpRequestInterceptor itcp)
62        ;
63
64
65    /**
66     * Inserts a request interceptor at the specified index.
67     *
68     * @param itcp      the request interceptor to add
69     * @param index     the index to insert the interceptor at
70     */
71    void addRequestInterceptor(HttpRequestInterceptor itcp, int index);
72
73
74    /**
75     * Obtains the current size of this list.
76     *
77     * @return  the number of request interceptors in this list
78     */
79    int getRequestInterceptorCount()
80        ;
81
82
83    /**
84     * Obtains a request interceptor from this list.
85     *
86     * @param index     the index of the interceptor to obtain,
87     *                  0 for first
88     *
89     * @return  the interceptor at the given index, or
90     *          <code>null</code> if the index is out of range
91     */
92    HttpRequestInterceptor getRequestInterceptor(int index)
93        ;
94
95
96    /**
97     * Removes all request interceptors from this list.
98     */
99    void clearRequestInterceptors()
100        ;
101
102
103    /**
104     * Removes all request interceptor of the specified class
105     *
106     * @param clazz  the class of the instances to be removed.
107     */
108    void removeRequestInterceptorByClass(Class clazz);
109
110
111    /**
112     * Sets the request interceptors in this list.
113     * This list will be cleared and re-initialized to contain
114     * all request interceptors from the argument list.
115     * If the argument list includes elements that are not request
116     * interceptors, the behavior is implementation dependent.
117     *
118     * @param itcps     the list of request interceptors
119     */
120    void setInterceptors(List itcps)
121        ;
122
123
124} // interface HttpRequestInterceptorList
125
126