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 intprotected 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 hostintgetRecords(DNSRequest request) Retrieve dns records for the given hostgetRecordsAsync(DNSRequest request) voidsetRecordLimit(int recordLimit) Set a new limit for the number of records for MX and PTR lookups.voidsetTimeOut(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:
setTimeOutin interfaceDNSService- Parameters:
timeOut- The timeout in seconds- See Also:
-
getLocalDomainNames
Description copied from interface:DNSServiceTry to get all domain names for the running host- Specified by:
getLocalDomainNamesin interfaceDNSService- Returns:
- names A List contains all domain names which could resolved
- See Also:
-
getRecordLimit
public int getRecordLimit()- Specified by:
getRecordLimitin 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:
setRecordLimitin interfaceDNSService- Parameters:
recordLimit-
-
getRecords
Description copied from interface:DNSServiceRetrieve dns records for the given host- Specified by:
getRecordsin interfaceDNSService- Parameters:
request- the dns request- Returns:
- an array of Strings representing the records
- Throws:
TimeoutException- See Also:
-
getRecordsAsync
- Specified by:
getRecordsAsyncin interfaceDNSService
-
convertRecordsToList
Convert the given Record array to a List- Parameters:
rr- Record array- Returns:
- list
-