org.apache.james.jspf.impl
Class DNSServiceXBillImpl

java.lang.Object
  extended by org.apache.james.jspf.impl.DNSServiceXBillImpl
All Implemented Interfaces:
DNSService

public class DNSServiceXBillImpl
extends java.lang.Object
implements DNSService

This class contains helper to get all neccassary DNS infos that are needed for SPF


Field Summary
protected  Logger log
           
protected  int recordLimit
           
protected  int timeOut
           
 
Constructor Summary
DNSServiceXBillImpl(Logger logger)
          Default Constructor
 
Method Summary
static java.util.List convertRecordsToList(org.xbill.DNS.Record[] rr)
          Convert the given Record array to a List
 java.util.List getLocalDomainNames()
          Try to get all domain names for the running host
 int getRecordLimit()
           
 java.util.List getRecords(DNSRequest request)
          Retrieve dns records for the given host
 void setRecordLimit(int recordLimit)
          Set a new limit for the number of records for MX and PTR lookups.
 void setTimeOut(int timeOut)
          Set the timeout for DNS-Requests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeOut

protected int timeOut

log

protected Logger log

recordLimit

protected int recordLimit
Constructor Detail

DNSServiceXBillImpl

public DNSServiceXBillImpl(Logger logger)
Default Constructor

Method Detail

setTimeOut

public void setTimeOut(int timeOut)
Description copied from interface: DNSService
Set the timeout for DNS-Requests

Specified by:
setTimeOut in interface DNSService
Parameters:
timeOut - The timeout in seconds
See Also:
DNSService.setTimeOut(int)

getLocalDomainNames

public java.util.List getLocalDomainNames()
Description copied from interface: DNSService
Try to get all domain names for the running host

Specified by:
getLocalDomainNames in interface DNSService
Returns:
names A List contains all domain names which could resolved
See Also:
DNSService.getLocalDomainNames()

getRecordLimit

public int getRecordLimit()
Specified by:
getRecordLimit in interface DNSService
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 interface DNSService
Parameters:
recordLimit -

getRecords

public java.util.List getRecords(DNSRequest request)
                          throws TimeoutException
Description copied from interface: DNSService
Retrieve dns records for the given host

Specified by:
getRecords in interface DNSService
Parameters:
request - the dns request
Returns:
an array of Strings representing the records
Throws:
TimeoutException
See Also:
DNSService.getRecords(org.apache.james.jspf.core.DNSRequest)

convertRecordsToList

public static java.util.List convertRecordsToList(org.xbill.DNS.Record[] rr)
Convert the given Record array to a List

Parameters:
rr - Record array
Returns:
list


Copyright © 2006-2007 The Apache Software Foundation. All Rights Reserved.