org.xins.server.AccessRuleContainer Maven / Gradle / Ivy
/*
* $Id: AccessRuleContainer.java,v 1.17 2010/09/29 17:21:48 agoubard Exp $
*
* See the COPYRIGHT file for redistribution and use restrictions.
*/
package org.xins.server;
import org.xins.common.text.ParseException;
/**
* Collection of one or more access rules.
*
* @version $Revision: 1.17 $ $Date: 2010/09/29 17:21:48 $
* @author Anthony Goubard
*
* @since XINS 1.1.0
*/
public interface AccessRuleContainer {
/**
* Determines if the specified IP address is allowed to access the
* specified function.
*
* This method finds the first matching rule and then returns the
* allow property of that rule (see
* {@link AccessRule#isAllowRule()}). If there is no matching rule, then
* null
is returned.
*
* @param ip
* the IP address, cannot be null
.
*
* @param functionName
* the name of the function, cannot be null
.
*
* @param conventionName
* the name of the calling convention, can be null
.
*
* @return
* {@link Boolean#TRUE} if the specified IP address is allowed to access
* the specified function, {@link Boolean#FALSE} if it is disallowed
* access or null
if there is no match.
*
* @throws IllegalArgumentException
* if ip == null || functionName == null
.
*
* @throws ParseException
* if the specified IP address is malformed.
*
* @since XINS 2.1.
*/
Boolean isAllowed(String ip, String functionName, String conventionName)
throws IllegalArgumentException, ParseException;
/**
* Disposes this access rule. All claimed resources are freed as much as
* possible.
*
*
Once disposed, the {@link #isAllowed} method should no longer be
* called.
*/
void dispose();
}