Package org.apache.james.jspf.impl
Class DNSServiceXBillImpl
java.lang.Object
org.apache.james.jspf.impl.DNSServiceXBillImpl
- All Implemented Interfaces:
DNSService
This class contains helper to get all neccassary DNS infos that are needed
for SPF
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected org.xbill.DNS.Resolver
-
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.DNSServiceXBillImpl
(org.xbill.DNS.Resolver resolver) Constructor to specify a custom resolver. -
Method Summary
Modifier and TypeMethodDescriptionconvertRecordsToList
(org.xbill.DNS.Record[] rr) Convert the given Record array to a ListTry to get all domain names for the running hostint
getRecords
(DNSRequest request) Retrieve dns records for the given hostgetRecordsAsync
(DNSRequest request) void
setRecordLimit
(int recordLimit) Set a new limit for the number of records for MX and PTR lookups.void
setTimeOut
(int timeOut) NOTE if this class is created with the default constructor it will use the static DefaultResolver from DNSJava and this method will change it's timeout.
-
Field Details
-
recordLimit
protected int recordLimit -
resolver
protected org.xbill.DNS.Resolver resolver
-
-
Constructor Details
-
DNSServiceXBillImpl
public DNSServiceXBillImpl()Default Constructor. Uses the DNSJava static DefaultResolver -
DNSServiceXBillImpl
public DNSServiceXBillImpl(org.xbill.DNS.Resolver resolver) Constructor to specify a custom resolver.
-
-
Method Details
-
setTimeOut
public void setTimeOut(int timeOut) NOTE if this class is created with the default constructor it will use the static DefaultResolver from DNSJava and this method will change it's timeout. Other tools using DNSJava in the same JVM could be affected by this timeout change.- Specified by:
setTimeOut
in interfaceDNSService
- Parameters:
timeOut
- The timeout in seconds- See Also:
-
getLocalDomainNames
Description copied from interface:DNSService
Try to get all domain names for the running host- Specified by:
getLocalDomainNames
in interfaceDNSService
- Returns:
- names A List contains all domain names which could resolved
- See Also:
-
getRecordLimit
public int getRecordLimit()- Specified by:
getRecordLimit
in interfaceDNSService
- Returns:
- the current record limit
-
setRecordLimit
public void setRecordLimit(int recordLimit) Set a new limit for the number of records for MX and PTR lookups.- Specified by:
setRecordLimit
in interfaceDNSService
- Parameters:
recordLimit
-
-
getRecords
Description copied from interface:DNSService
Retrieve dns records for the given host- Specified by:
getRecords
in interfaceDNSService
- Parameters:
request
- the dns request- Returns:
- an array of Strings representing the records
- Throws:
TimeoutException
- See Also:
-
getRecordsAsync
- Specified by:
getRecordsAsync
in interfaceDNSService
-
convertRecordsToList
Convert the given Record array to a List- Parameters:
rr
- Record array- Returns:
- list
-