01: /*
02: * $Id: AccessRuleContainer.java,v 1.15 2007/09/18 08:45:03 agoubard Exp $
03: *
04: * Copyright 2003-2007 Orange Nederland Breedband B.V.
05: * See the COPYRIGHT file for redistribution and use restrictions.
06: */
07: package org.xins.server;
08:
09: import org.xins.common.text.ParseException;
10:
11: /**
12: * Collection of one or more access rules.
13: *
14: * @version $Revision: 1.15 $ $Date: 2007/09/18 08:45:03 $
15: * @author <a href="mailto:anthony.goubard@japplis.com">Anthony Goubard</a>
16: *
17: * @since XINS 1.1.0
18: */
19: public interface AccessRuleContainer {
20:
21: /**
22: * Determines if the specified IP address is allowed to access the
23: * specified function.
24: *
25: * <p>This method finds the first matching rule and then returns the
26: * <em>allow</em> property of that rule (see
27: * {@link AccessRule#isAllowRule()}). If there is no matching rule, then
28: * <code>null</code> is returned.
29: *
30: * @param ip
31: * the IP address, cannot be <code>null</code>.
32: *
33: * @param functionName
34: * the name of the function, cannot be <code>null</code>.
35: *
36: * @param conventionName
37: * the name of the calling convention, can be <code>null</code>.
38: *
39: * @return
40: * {@link Boolean#TRUE} if the specified IP address is allowed to access
41: * the specified function, {@link Boolean#FALSE} if it is disallowed
42: * access or <code>null</code> if there is no match.
43: *
44: * @throws IllegalArgumentException
45: * if <code>ip == null || functionName == null</code>.
46: *
47: * @throws ParseException
48: * if the specified IP address is malformed.
49: *
50: * @since XINS 2.1.
51: */
52: Boolean isAllowed(String ip, String functionName,
53: String conventionName) throws IllegalArgumentException,
54: ParseException;
55:
56: /**
57: * Disposes this access rule. All claimed resources are freed as much as
58: * possible.
59: *
60: * <p>Once disposed, the {@link #isAllowed} method should no longer be
61: * called.
62: */
63: void dispose();
64: }
|