001: /*
002: * $HeadURL: https://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.0-beta1/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java $
003: * $Revision: 554903 $
004: * $Date: 2007-07-10 12:54:17 +0200 (Tue, 10 Jul 2007) $
005: *
006: * ====================================================================
007: * Licensed to the Apache Software Foundation (ASF) under one
008: * or more contributor license agreements. See the NOTICE file
009: * distributed with this work for additional information
010: * regarding copyright ownership. The ASF licenses this file
011: * to you under the Apache License, Version 2.0 (the
012: * "License"); you may not use this file except in compliance
013: * with the License. You may obtain a copy of the License at
014: *
015: * http://www.apache.org/licenses/LICENSE-2.0
016: *
017: * Unless required by applicable law or agreed to in writing,
018: * software distributed under the License is distributed on an
019: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
020: * KIND, either express or implied. See the License for the
021: * specific language governing permissions and limitations
022: * under the License.
023: * ====================================================================
024: *
025: * This software consists of voluntary contributions made by many
026: * individuals on behalf of the Apache Software Foundation. For more
027: * information on the Apache Software Foundation, please see
028: * <http://www.apache.org/>.
029: *
030: */
031:
032: package org.apache.http.protocol;
033:
034: import java.util.List;
035:
036: import org.apache.http.HttpRequestInterceptor;
037:
038: /**
039: * Provides access to an ordered list of request interceptors.
040: * Lists are expected to be built upfront and used read-only afterwards
041: * for {@link HttpProcessor processing}.
042: *
043: * @author <a href="mailto:rolandw at apache.org">Roland Weber</a>
044: *
045: * @version $Revision: 554903 $
046: *
047: * @since 4.0
048: */
049: public interface HttpRequestInterceptorList {
050:
051: /**
052: * Appends a request interceptor to this list.
053: *
054: * @param itcp the request interceptor to add
055: */
056: void addRequestInterceptor(HttpRequestInterceptor itcp);
057:
058: /**
059: * Inserts a request interceptor at the specified index.
060: *
061: * @param itcp the request interceptor to add
062: * @param index the index to insert the interceptor at
063: */
064: void addRequestInterceptor(HttpRequestInterceptor itcp, int index);
065:
066: /**
067: * Obtains the current size of this list.
068: *
069: * @return the number of request interceptors in this list
070: */
071: int getRequestInterceptorCount();
072:
073: /**
074: * Obtains a request interceptor from this list.
075: *
076: * @param index the index of the interceptor to obtain,
077: * 0 for first
078: *
079: * @return the interceptor at the given index, or
080: * <code>null</code> if the index is out of range
081: */
082: HttpRequestInterceptor getRequestInterceptor(int index);
083:
084: /**
085: * Removes all request interceptors from this list.
086: */
087: void clearRequestInterceptors();
088:
089: /**
090: * Removes all request interceptor of the specified class
091: *
092: * @param clazz the class of the instances to be removed.
093: */
094: void removeRequestInterceptorByClass(Class clazz);
095:
096: /**
097: * Sets the request interceptors in this list.
098: * This list will be cleared and re-initialized to contain
099: * all request interceptors from the argument list.
100: * If the argument list includes elements that are not request
101: * interceptors, the behavior is implementation dependent.
102: *
103: * @param itcps the list of request interceptors
104: */
105: void setInterceptors(List itcps);
106:
107: } // interface HttpRequestInterceptorList
|