1 /* 2 * Copyright 2009 University Corporation for Advanced Internet Development, Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.opensaml.ws.message.handler; 18 19 import java.util.List; 20 import java.util.Map; 21 22 /** 23 * A specialized type of {@link HandlerChain} which supports organizing multiple 24 * handler chains into a set of named handler chains called 'phases', which will be 25 * invoked in a specified order. 26 */ 27 public interface PhasedHandlerChain extends HandlerChain { 28 29 /** 30 * Modifiable map of phase names to corresponding handler chains. 31 * 32 * @return the map of phase names to handler chains 33 */ 34 public Map<String, HandlerChain> getPhaseChains(); 35 36 /** 37 * Get the order of phase invocation. Handler chains will be invoked in the order 38 * determined by this list. 39 * 40 * @return the ordered list of phase names 41 */ 42 public List<String> getPhaseOrder(); 43 44 /** 45 * Set the order of phase invocation. Handler chains will be invoked in the order 46 * determined by this list. 47 * 48 * @param newPhaseOrder a list of phase names 49 */ 50 public void setPhaseOrder(List<String> newPhaseOrder); 51 52 /** 53 * Get the complete effective list of ordered handlers in the handler chain. 54 * 55 * <p> 56 * Note that unlike {@link HandlerChain}, the returned list is <b>NOT</b>modifiable. 57 * {@link Handler} instances in the effective chain should be added and removed via 58 * membership in the appropriate handler chain phase, obtained via {@link #getPhaseChains()}. 59 * </p> 60 * 61 * @return list of handlers 62 */ 63 public List<Handler> getHandlers(); 64 65 }