1 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 package org.acegisecurity.securechannel;
17
18 import org.acegisecurity.ConfigAttribute;
19 import org.acegisecurity.ConfigAttributeDefinition;
20
21 import org.acegisecurity.intercept.web.FilterInvocation;
22
23 import java.io.IOException;
24
25 import javax.servlet.ServletException;
26
27
28 /**
29 * Decides whether a web channel provides sufficient security.
30 *
31 * @author Ben Alex
32 * @version $Id: ChannelDecisionManager.java 1784 2007-02-24 21:00:24Z luke_t $
33 */
34 public interface ChannelDecisionManager {
35 //~ Methods ========================================================================================================
36
37 /**
38 * Decided whether the presented {@link FilterInvocation} provides the appropriate level of channel
39 * security based on the requested {@link ConfigAttributeDefinition}.
40 *
41 * @param invocation DOCUMENT ME!
42 * @param config DOCUMENT ME!
43 *
44 * @throws IOException DOCUMENT ME!
45 * @throws ServletException DOCUMENT ME!
46 */
47 void decide(FilterInvocation invocation, ConfigAttributeDefinition config)
48 throws IOException, ServletException;
49
50 /**
51 * Indicates whether this <code>ChannelDecisionManager</code> is able to process the passed
52 * <code>ConfigAttribute</code>.<p>This allows the <code>ChannelProcessingFilter</code> to check every
53 * configuration attribute can be consumed by the configured <code>ChannelDecisionManager</code>.</p>
54 *
55 * @param attribute a configuration attribute that has been configured against the
56 * <code>ChannelProcessingFilter</code>
57 *
58 * @return true if this <code>ChannelDecisionManager</code> can support the passed configuration attribute
59 */
60 boolean supports(ConfigAttribute attribute);
61 }