Home | History | Annotate | Download | only in protocol
      1 /*
      2  * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpResponseInterceptorList.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 
     32 package org.apache.http.protocol;
     33 
     34 
     35 import java.util.List;
     36 
     37 import org.apache.http.HttpResponseInterceptor;
     38 
     39 
     40 /**
     41  * Provides access to an ordered list of response interceptors.
     42  * Lists are expected to be built upfront and used read-only afterwards
     43  * for {@link HttpProcessor processing}.
     44  *
     45  * @author <a href="mailto:rolandw at apache.org">Roland Weber</a>
     46  *
     47  * @version $Revision: 554903 $
     48  *
     49  * @since 4.0
     50  *
     51  * @deprecated Please use {@link java.net.URL#openConnection} instead.
     52  *     Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a>
     53  *     for further details.
     54  */
     55 @Deprecated
     56 public interface HttpResponseInterceptorList {
     57 
     58     /**
     59      * Appends a response interceptor to this list.
     60      *
     61      * @param itcp      the response interceptor to add
     62      */
     63     void addResponseInterceptor(HttpResponseInterceptor itcp)
     64         ;
     65 
     66     /**
     67      * Inserts a response interceptor at the specified index.
     68      *
     69      * @param itcp      the response interceptor to add
     70      * @param index     the index to insert the interceptor at
     71      */
     72     void addResponseInterceptor(HttpResponseInterceptor itcp, int index);
     73 
     74 
     75     /**
     76      * Obtains the current size of this list.
     77      *
     78      * @return  the number of response interceptors in this list
     79      */
     80     int getResponseInterceptorCount()
     81         ;
     82 
     83 
     84     /**
     85      * Obtains a response interceptor from this list.
     86      *
     87      * @param index     the index of the interceptor to obtain,
     88      *                  0 for first
     89      *
     90      * @return  the interceptor at the given index, or
     91      *          <code>null</code> if the index is out of range
     92      */
     93     HttpResponseInterceptor getResponseInterceptor(int index)
     94         ;
     95 
     96 
     97     /**
     98      * Removes all response interceptors from this list.
     99      */
    100     void clearResponseInterceptors()
    101         ;
    102 
    103 
    104     /**
    105      * Removes all response interceptor of the specified class
    106      *
    107      * @param clazz  the class of the instances to be removed.
    108      */
    109     void removeResponseInterceptorByClass(Class clazz);
    110 
    111 
    112     /**
    113      * Sets the response interceptors in this list.
    114      * This list will be cleared and re-initialized to contain
    115      * all response interceptors from the argument list.
    116      * If the argument list includes elements that are not response
    117      * interceptors, the behavior is implementation dependent.
    118      *
    119      * @param itcps     the list of response interceptors
    120      */
    121     void setInterceptors(List itcps)
    122         ;
    123 
    124 
    125 } // interface HttpResponseInterceptorList
    126 
    127