|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jscape.inet.dns.DnsRequest
Implements the basic functionality of a DNS request. Example Usage:
// create new instance
Dns dns = new Dns();
// creates DNS request with nameserver and domain as arguments
DnsRequest request = new DnsRequest("ns.myserver.com","myserver.com");
// retrieve only MX (mail exchanger) records
request.setRecordType(Dns.TYPE_MX);
// gets DNS response
DnsResponse response = dns.getResponse(request);
// print out records for response to console
Enumeration e = response.getAnswers();
while(e.hasMoreElements()) {
DnsRecord record = (DnsRecord) e.nextElement();
System.out.println(record);
}
| Constructor Summary | |
DnsRequest(java.lang.String nameserver,
java.lang.String domain)
Constructs a new DnsRequest instance. |
|
DnsRequest(java.lang.String nameserver,
java.lang.String domain,
int recordType)
Constructs a new DnsRequest instance. |
|
DnsRequest(java.lang.String nameserver,
java.lang.String domain,
int recordType,
int classType)
Constructs a new DnsRequest instance
The constants for recordType and classType are defind in Dns class. |
|
| Method Summary | |
int |
getClassType()
Gets class type to retrieve for this DnsRequest. |
java.lang.String |
getDomain()
Gets hostname or IP address to lookup for this DnsRequest. |
java.lang.String |
getNameserver()
Gets nameserver used to perform this DnsRequest. |
int |
getQueryId()
Gets query id for this DnsRequest. |
int |
getRecordType()
Gets record type to retrieve for this DnsRequest. |
int |
getTimeout()
Gets the timeout for opening connection to DNS server. |
void |
setClassType(int classType)
Sets class type to retrieve for this DnsRequest. |
void |
setDomain(java.lang.String domain)
Sets hostname or IP address to lookup for this DnsRequest. |
void |
setNameserver(java.lang.String nameserver)
Sets nameserver used to perform this DnsRequest. |
void |
setRecordType(int recordType)
Sets record type to retrieve for this DnsRequest. |
void |
setTimeout(int timeout)
Sets the timeout for opening connection to DNS server. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DnsRequest(java.lang.String nameserver,
java.lang.String domain)
DnsRequest instance.
nameserver - the hostname or IP address of the DNS serverdomain - the hostname or IP address to lookup
public DnsRequest(java.lang.String nameserver,
java.lang.String domain,
int recordType)
DnsRequest instance.
The constants for recordType are defind in Dns class.
nameserver - the hostname or IP address of the DNS serverdomain - the hostname or IP address to lookuprecordType - the type of records to retrieveDns
public DnsRequest(java.lang.String nameserver,
java.lang.String domain,
int recordType,
int classType)
DnsRequest instance
The constants for recordType and classType are defind in Dns class.
nameserver - the hostname or IP address of the DNS serverdomain - the hostname or IP address to lookuprecordType - the type of records to retrieveclassType - the class of records to retrieveDns| Method Detail |
public java.lang.String getNameserver()
DnsRequest.
public void setNameserver(java.lang.String nameserver)
DnsRequest.
nameserver - the nameserver used to perform this DnsRequestpublic int getRecordType()
DnsRequest.
public void setRecordType(int recordType)
DnsRequest.
recordType - the record type to retrieve for this DnsRequestpublic int getClassType()
DnsRequest.
public void setClassType(int classType)
DnsRequest.
classType - the class type to retrieve for this DnsRequestpublic java.lang.String getDomain()
DnsRequest.
public void setDomain(java.lang.String domain)
DnsRequest.
domain - the hostname or IP address to lookup for this DnsRequestpublic int getQueryId()
DnsRequest.
public void setTimeout(int timeout)
timeout - the timeout in millisecondspublic int getTimeout()
|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||