001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.camel.spi;
018    
019     /**
020      * Interface to allow plug-able implementation to filter header
021      * to and from Camel message.
022      * 
023      * @since 1.5
024      * @version $Revision: 1109 $
025      */
026    public interface HeaderFilterStrategy {
027    
028        /**
029         * Applies filtering logic to Camel Message header that is
030         * going to be copied to target message such as CXF and JMS message.
031         * It returns true if the filtering logics return a match.  Otherwise,
032         * it returns false.  A match means the header should be excluded.
033         * 
034         * @param headerName  the header name
035         * @param headerValue the header value
036         * @return <tt>true</tt> if this header should be filtered out.
037         */
038        boolean applyFilterToCamelHeaders(String headerName, Object headerValue);
039    
040        
041        /**
042         * Applies filtering logic to an external message header such 
043         * as CXF and JMS message that is going to be copied to Camel
044         * message header.
045         * It returns true if the filtering logics return a match.  Otherwise,
046         * it returns false.  A match means the header should be excluded.
047         *  
048         * @param headerName  the header name
049         * @param headerValue the header value
050         * @return <tt>true</tt> if this header should be filtered out.
051         */
052        boolean applyFilterToExternalHeaders(String headerName, Object headerValue);
053        
054    }