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 meets a specific security condition.
29: *
30: * <P>
31: * <code>ChannelProcessor</code> implementations are iterated by the {@link
32: * ChannelDecisionManagerImpl}.
33: * </p>
34: *
35: * <P>
36: * If an implementation has an issue with the channel security, they should
37: * take action themselves. The callers of the implementation do not take any
38: * action.
39: * </p>
40: *
41: * @author Ben Alex
42: * @version $Id: ChannelProcessor.java 1784 2007-02-24 21:00:24Z luke_t $
43: */
44: public interface ChannelProcessor {
45: //~ Methods ========================================================================================================
46:
47: /**
48: * Decided whether the presented {@link FilterInvocation} provides the appropriate level of channel
49: * security based on the requested {@link ConfigAttributeDefinition}.
50: *
51: * @param invocation DOCUMENT ME!
52: * @param config DOCUMENT ME!
53: *
54: * @throws IOException DOCUMENT ME!
55: * @throws ServletException DOCUMENT ME!
56: */
57: void decide(FilterInvocation invocation,
58: ConfigAttributeDefinition config) throws IOException,
59: ServletException;
60:
61: /**
62: * Indicates whether this <code>ChannelProcessor</code> is able to process the passed
63: * <code>ConfigAttribute</code>.<p>This allows the <code>ChannelProcessingFilter</code> to check every
64: * configuration attribute can be consumed by the configured <code>ChannelDecisionManager</code>.</p>
65: *
66: * @param attribute a configuration attribute that has been configured against the
67: * <code>ChannelProcessingFilter</code>
68: *
69: * @return true if this <code>ChannelProcessor</code> can support the passed configuration attribute
70: */
71: boolean supports(ConfigAttribute attribute);
72: }
|