2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.application;
19
20 import org.apache.shale.application.faces.ShaleWebContext;
21
22 /***
23 * <p>Command that filters incoming requests based on matching the remote
24 * address against regular expression patterns that are configured on
25 * this instance. See {@link AbstractRegExpFilter} for details of the
26 * matching algorithm.</p>
27 *
28 * <p><strong>USAGE NOTE:</strong> - This command will only be effective if
29 * used before the regular filter chain is processed. In other words, you
30 * should invoke it as part of a <code>preprocess</code> chain in the
31 * <code>shale</code> catalog.</p>
32 *
33 * $Id: RemoteAddrFilter.java 464373 2006-10-16 04:21:54Z rahul $
34 *
35 * @see AbstractRegExpFilter
36 */
37 public class RemoteAddrFilter extends AbstractRegExpFilter {
38
39
40
41
42
43 /***
44 * <p>Return the value to be tested against exclude and include patterns.
45 * This will be the value of the <code>remoteAddr</code> property.</p>
46 *
47 * @param context <code>Context</code> for the current request
48 */
49 protected String value(ShaleWebContext context) {
50
51 return context.getRequest().getRemoteAddr();
52
53 }
54
55
56 }