Package org.apache.james.jspf.terms
Class IP4Mechanism
java.lang.Object
org.apache.james.jspf.terms.GenericMechanism
org.apache.james.jspf.terms.IP4Mechanism
- All Implemented Interfaces:
MacroExpandEnabled
,SPFChecker
,ConfigurationEnabled
,Mechanism
- Direct Known Subclasses:
IP6Mechanism
This class represent the ip4 mechanism
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ABNF: IP4 = "ip4" ":" ip4-network [ ip4-cidr-length ]Fields inherited from class org.apache.james.jspf.terms.GenericMechanism
DUAL_CIDR_LENGTH_REGEX, IP4_CIDR_LENGTH_REGEX, IP6_CIDR_LENGTH_REGEX, macroExpand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckSPF
(SPFSession spfData) Run check for SPF with the given values.void
config
(Configuration params) Configurationprotected IPAddr
getIp()
protected int
Returns the max cidr for ip4protected boolean
isValidAddress
(String ipString) toString()
Methods inherited from class org.apache.james.jspf.terms.GenericMechanism
enableMacroExpand, expandHost, getDomain
-
Field Details
-
REGEX
ABNF: IP4 = "ip4" ":" ip4-network [ ip4-cidr-length ]- See Also:
-
-
Constructor Details
-
IP4Mechanism
public IP4Mechanism()
-
-
Method Details
-
checkSPF
Description copied from interface:SPFChecker
Run check for SPF with the given values.- Parameters:
spfData
- The SPF1Data which should be used to run the check- Throws:
PermErrorException
- Get thrown if an error was detected- See Also:
-
config
Description copied from interface:ConfigurationEnabled
Configuration- Specified by:
config
in interfaceConfigurationEnabled
- Overrides:
config
in classGenericMechanism
- Parameters:
params
- the ConfigurationMatch which should used- Throws:
PermErrorException
- get thrown if a PermError should returned- See Also:
-
isValidAddress
- See Also:
-
getMaxCidr
protected int getMaxCidr()Returns the max cidr for ip4- Returns:
- maxCidr The max cidr
-
getIp
- Returns:
- Returns the ip.
-
toString
-