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 StringABNF: 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.voidconfig(Configuration params) Configurationprotected IPAddrgetIp()protected intReturns the max cidr for ip4protected booleanisValidAddress(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:SPFCheckerRun 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:ConfigurationEnabledConfiguration- Specified by:
configin interfaceConfigurationEnabled- Overrides:
configin 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
-