org.altlinux.jabbix
Class WhitelistPredicate
java.lang.Object
org.altlinux.jabbix.WhitelistPredicate
- All Implemented Interfaces:
- ConnectionPredicate
public class WhitelistPredicate
- extends Object
- implements ConnectionPredicate
Implements a connection predicate using a regular expression to test the host
name.
- Author:
- Paul Wolneykien
- See Also:
JabbixSecurityManager
|
Constructor Summary |
WhitelistPredicate(String addressPattern)
Creates a new predicate instance from the specified pattern. |
|
Method Summary |
boolean |
isAllowed(String host,
int port)
Tests if the given host name matches the configured pattern. |
WhitelistPredicate
public WhitelistPredicate(String addressPattern)
- Creates a new predicate instance from the specified pattern.
- Parameters:
addressPattern - a regular expression to the the host names with
isAllowed
public boolean isAllowed(String host,
int port)
- Tests if the given host name matches the configured pattern.
- Specified by:
isAllowed in interface ConnectionPredicate
- Parameters:
host - the host to connect to/fromport - the port to connect to/from
- Returns:
- true if the connection is allowed, false otherwise