org.apache.james.transport.matchers
Class AbstractNetworkMatcher
java.lang.Object
org.apache.mailet.GenericMatcher
org.apache.james.transport.matchers.AbstractNetworkMatcher
- All Implemented Interfaces:
- Matcher, MatcherConfig
- Direct Known Subclasses:
- RemoteAddrInNetwork, RemoteAddrNotInNetwork, SenderInFakeDomain
public abstract class AbstractNetworkMatcher
- extends GenericMatcher
AbstractNetworkMatcher makes writing IP Address matchers easier.
AbstractNetworkMatcher provides a means for checking to see whether
a particular IP address or domain is within a set of subnets
These subnets may be expressed in one of several formats:
Format Example
explicit address 127.0.0.1
address with a wildcard 127.0.0.*
domain name myHost.com
domain name + prefix-length myHost.com/24
domain name + mask myHost.com/255.255.255.0
IP address + prefix-length 127.0.0.0/8
IP + mask 127.0.0.0/255.0.0.0
For more information, see also: RFC 1518 and RFC 1519.
- Version:
- $ID$
Method Summary |
protected java.util.Collection |
allowedNetworks()
|
void |
init()
A convenience method which can be overridden so that there's no
need to call super.init(config). |
protected boolean |
matchNetwork(java.net.InetAddress addr)
|
protected boolean |
matchNetwork(java.lang.String addr)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractNetworkMatcher
public AbstractNetworkMatcher()
init
public void init()
throws javax.mail.MessagingException
- Description copied from class:
GenericMatcher
A convenience method which can be overridden so that there's no
need to call super.init(config).
Instead of overriding init(MatcherConfig), simply override this
method and it will be called by GenericMatcher.init(MatcherConfig config).
The MatcherConfig object can still be retrieved via getMatcherConfig().
- Overrides:
init
in class GenericMatcher
- Throws:
javax.mail.MessagingException
allowedNetworks
protected java.util.Collection allowedNetworks()
matchNetwork
protected boolean matchNetwork(java.net.InetAddress addr)
matchNetwork
protected boolean matchNetwork(java.lang.String addr)
Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.