1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.securechannel;
17
18 import org.acegisecurity.ConfigAttribute;
19 import org.acegisecurity.ConfigAttributeDefinition;
20 import org.acegisecurity.intercept.web.FilterInvocation;
21
22 import java.io.IOException;
23
24 import javax.servlet.ServletException;
25
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,v 1.2 2005/11/17 00:55:50 benalex Exp $
43 */
44 public interface ChannelProcessor {
45
46
47 /***
48 * Decided whether the presented {@link FilterInvocation} provides the
49 * appropriate level of channel security based on the requested {@link
50 * ConfigAttributeDefinition}.
51 */
52 public void decide(FilterInvocation invocation,
53 ConfigAttributeDefinition config) throws IOException, ServletException;
54
55 /***
56 * Indicates whether this <code>ChannelProcessor</code> is able to process
57 * the passed <code>ConfigAttribute</code>.
58 *
59 * <p>
60 * This allows the <code>ChannelProcessingFilter</code> to check every
61 * configuration attribute can be consumed by the configured
62 * <code>ChannelDecisionManager</code>.
63 * </p>
64 *
65 * @param attribute a configuration attribute that has been configured
66 * against the <code>ChannelProcessingFilter</code>
67 *
68 * @return true if this <code>ChannelProcessor</code> can support the
69 * passed configuration attribute
70 */
71 public boolean supports(ConfigAttribute attribute);
72 }