01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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: * Decides whether a web channel provides sufficient security.
29: *
30: * @author Ben Alex
31: * @version $Id: ChannelDecisionManager.java 1784 2007-02-24 21:00:24Z luke_t $
32: */
33: public interface ChannelDecisionManager {
34: //~ Methods ========================================================================================================
35:
36: /**
37: * Decided whether the presented {@link FilterInvocation} provides the appropriate level of channel
38: * security based on the requested {@link ConfigAttributeDefinition}.
39: *
40: * @param invocation DOCUMENT ME!
41: * @param config DOCUMENT ME!
42: *
43: * @throws IOException DOCUMENT ME!
44: * @throws ServletException DOCUMENT ME!
45: */
46: void decide(FilterInvocation invocation,
47: ConfigAttributeDefinition config) throws IOException,
48: 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: }
|