IP*Works! V6

ipworks
Class Dns

java.lang.Object
  |
  +--ipworks.Dns

public class Dns
extends java.lang.Object

The DNS bean is used to query DNS for record information.

The DNS bean queries a DNS server for records as specified in RFC 1035 and other relevant RFCs. The bean property QueryType indicates the record to be queried. Setting QueryDomain will initiate the query.

Once the query is complete, a single Response event will fire and the record properties will be filled. StatusCode is the server's success or fail code, and Status is a standard string interpretation of the code.

RecordCount records are returned, and for each record, RecordFieldCount fields are returned. The response records are provided in the RecordFieldValue arrays, indexed by RecordIndex to indicate the current record and the FieldIndex property to indicate the current field. The programming interface is designed to allow a full walk of the records in the DNS response, including provisions for handling new record types. .

The bean operates synchronously by default (waits for a response before returning control to the caller), however, the bean may also operate asynchronously (return control immediately), by setting Timeout to 0. Please refer to the Timeout property for more information.


Field Summary
static int qtAAAA
           
static int qtAddress
           
static int qtAFSDB
           
static int qtCName
           
static int qtHostInfo
           
static int qtISDN
           
static int qtMailBox
           
static int qtMailGroup
           
static int qtMailInfo
           
static int qtMD
           
static int qtMF
           
static int qtMR
           
static int qtMX
           
static int qtNS
           
static int qtNULL
           
static int qtPointer
           
static int qtRP
           
static int qtRT
           
static int qtSOA
           
static int qtSRV
           
static int qtText
           
static int qtWKS
           
static int qtX25
           
static int rsAdditionalRecordsSection
           
static int rsAnswerSection
           
static int rsNameServerSection
           
static int rtAAAA
           
static int rtAddress
           
static int rtAFSDB
           
static int rtCName
           
static int rtHostInfo
           
static int rtISDN
           
static int rtMailBox
           
static int rtMailGroup
           
static int rtMailInfo
           
static int rtMD
           
static int rtMF
           
static int rtMR
           
static int rtMX
           
static int rtNS
           
static int rtNULL
           
static int rtPointer
           
static int rtRP
           
static int rtRT
           
static int rtSOA
           
static int rtSRV
           
static int rtText
           
static int rtWKS
           
static int rtX25
           
 
Constructor Summary
Dns()
           
 
Method Summary
 void addDnsEventListener(DnsEventListener l)
           
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a beanconfiguration setting.
 void doEvents()
          Processes events from the internal message queue.
 int getDNSPort()
          The port to connect to on the DNS Server.
 java.lang.String getDNSServer()
          The address of the DNS Server.
 int getFieldIndex()
          The index of the selected field of the current record.
 java.lang.String getQueryDomain()
          The domain to query.
 int getQueryType()
          The record type to query.
 int getRecordCount()
          The number of RecordSource records in the last response.
 byte[] getRecordData(int recordIndex)
          The full record data as received from the DNS server.
 java.lang.String getRecordDomain(int recordIndex)
          The domain name associated with the selected response record.
 int getRecordFieldCount(int recordIndex)
          Number of fields in the record.
 java.lang.String getRecordFieldName(int recordIndex)
          The name of the field selected by FieldIndex for RecordIndex .
 byte[] getRecordFieldValue(int recordIndex)
          The value of the field selected by FieldIndex for RecordIndex .
 int getRecordSource()
          The source of records being listed in the record arrays.
 int getRecordTTL(int recordIndex)
          The record Time To Live (TTL) value.
 int getRecordType(int recordIndex)
          The record type corresponding to RecordIndex .
 java.lang.String getRecordTypeName(int recordIndex)
          String representation of the current record type defined by RecordType .
 int getRequestId()
          The id of the current DNS request.
 java.lang.String getStatus()
          A standard string interpretation of StatusCode .
 int getStatusCode()
          The success or error code for the DNS query.
 int getTimeout()
          A timeout for the bean.
 void interrupt()
          Interrupt the current method.
 boolean isIdle()
          The current status of the component.
 boolean isRecursive()
          Determines whether to ask the DNSServer to recursively query other servers.
 void query(java.lang.String domain)
          Query a Domain
 void removeDnsEventListener(DnsEventListener l)
           
 void setDNSPort(int DNSPort)
          The port to connect to on the DNS Server.
 void setDNSServer(java.lang.String DNSServer)
          The address of the DNS Server.
 void setFieldIndex(int fieldIndex)
          The index of the selected field of the current record.
 void setQueryDomain(java.lang.String queryDomain)
          The domain to query.
 void setQueryType(int queryType)
          The record type to query.
 void setRecordSource(int recordSource)
          The source of records being listed in the record arrays.
 void setRecursive(boolean recursive)
          Determines whether to ask the DNSServer to recursively query other servers.
 void setRequestId(int requestId)
          The id of the current DNS request.
 void setTimeout(int timeout)
          A timeout for the bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

qtAddress

public static final int qtAddress
See Also:
Constant Field Values

qtNS

public static final int qtNS
See Also:
Constant Field Values

qtMD

public static final int qtMD
See Also:
Constant Field Values

qtMF

public static final int qtMF
See Also:
Constant Field Values

qtCName

public static final int qtCName
See Also:
Constant Field Values

qtSOA

public static final int qtSOA
See Also:
Constant Field Values

qtMailBox

public static final int qtMailBox
See Also:
Constant Field Values

qtMailGroup

public static final int qtMailGroup
See Also:
Constant Field Values

qtMR

public static final int qtMR
See Also:
Constant Field Values

qtNULL

public static final int qtNULL
See Also:
Constant Field Values

qtWKS

public static final int qtWKS
See Also:
Constant Field Values

qtPointer

public static final int qtPointer
See Also:
Constant Field Values

qtHostInfo

public static final int qtHostInfo
See Also:
Constant Field Values

qtMailInfo

public static final int qtMailInfo
See Also:
Constant Field Values

qtMX

public static final int qtMX
See Also:
Constant Field Values

qtText

public static final int qtText
See Also:
Constant Field Values

qtRP

public static final int qtRP
See Also:
Constant Field Values

qtAFSDB

public static final int qtAFSDB
See Also:
Constant Field Values

qtX25

public static final int qtX25
See Also:
Constant Field Values

qtISDN

public static final int qtISDN
See Also:
Constant Field Values

qtRT

public static final int qtRT
See Also:
Constant Field Values

qtAAAA

public static final int qtAAAA
See Also:
Constant Field Values

qtSRV

public static final int qtSRV
See Also:
Constant Field Values

rsAnswerSection

public static final int rsAnswerSection
See Also:
Constant Field Values

rsNameServerSection

public static final int rsNameServerSection
See Also:
Constant Field Values

rsAdditionalRecordsSection

public static final int rsAdditionalRecordsSection
See Also:
Constant Field Values

rtAddress

public static final int rtAddress
See Also:
Constant Field Values

rtNS

public static final int rtNS
See Also:
Constant Field Values

rtMD

public static final int rtMD
See Also:
Constant Field Values

rtMF

public static final int rtMF
See Also:
Constant Field Values

rtCName

public static final int rtCName
See Also:
Constant Field Values

rtSOA

public static final int rtSOA
See Also:
Constant Field Values

rtMailBox

public static final int rtMailBox
See Also:
Constant Field Values

rtMailGroup

public static final int rtMailGroup
See Also:
Constant Field Values

rtMR

public static final int rtMR
See Also:
Constant Field Values

rtNULL

public static final int rtNULL
See Also:
Constant Field Values

rtWKS

public static final int rtWKS
See Also:
Constant Field Values

rtPointer

public static final int rtPointer
See Also:
Constant Field Values

rtHostInfo

public static final int rtHostInfo
See Also:
Constant Field Values

rtMailInfo

public static final int rtMailInfo
See Also:
Constant Field Values

rtMX

public static final int rtMX
See Also:
Constant Field Values

rtText

public static final int rtText
See Also:
Constant Field Values

rtRP

public static final int rtRP
See Also:
Constant Field Values

rtAFSDB

public static final int rtAFSDB
See Also:
Constant Field Values

rtX25

public static final int rtX25
See Also:
Constant Field Values

rtISDN

public static final int rtISDN
See Also:
Constant Field Values

rtRT

public static final int rtRT
See Also:
Constant Field Values

rtAAAA

public static final int rtAAAA
See Also:
Constant Field Values

rtSRV

public static final int rtSRV
See Also:
Constant Field Values
Constructor Detail

Dns

public Dns()
Method Detail

getDNSPort

public int getDNSPort()
The port to connect to on the DNS Server.

A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.


setDNSPort

public void setDNSPort(int DNSPort)
                throws IPWorksException
The port to connect to on the DNS Server.

A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

IPWorksException

getDNSServer

public java.lang.String getDNSServer()
The address of the DNS Server.

The bean attempts to find the default DNS server for the machine where it is installed, and provide it in the DNSServer property. You may later change it to any particular DNS server you want to query. While any internet host running a DNS service will suffice, it is preferable to use either the DNS server for your network or the DNS server for the domain which you are querying.

If the bean cannot determine the default DNS server address, the property value will be an empty string.


setDNSServer

public void setDNSServer(java.lang.String DNSServer)
                  throws IPWorksException
The address of the DNS Server.

The bean attempts to find the default DNS server for the machine where it is installed, and provide it in the DNSServer property. You may later change it to any particular DNS server you want to query. While any internet host running a DNS service will suffice, it is preferable to use either the DNS server for your network or the DNS server for the domain which you are querying.

If the bean cannot determine the default DNS server address, the property value will be an empty string.

IPWorksException

getFieldIndex

public int getFieldIndex()
The index of the selected field of the current record.

FieldIndex valid values are from 1 to RecordFieldCount .

After a successful query, the RecordFieldValue array provides the field values for each record. RecordFieldValue(i) provides the field values for the i-th record.

To retrieve a particular field value for a record, first set FieldIndex to a valid response field index (from 1 to RecordFieldCount ), and then query RecordFieldValue for the value of that field.

Example (loop through all fields of i-th record)

 For j = 1 to DNSControl.RecordFieldCount(i)
 \011DNSControl.FieldIndex = j
 \011DoSomethingWith(DNSControl.RecordFieldName(i), DNSControl.RecordFieldValue(i))
 Next j 


setFieldIndex

public void setFieldIndex(int fieldIndex)
                   throws IPWorksException
The index of the selected field of the current record.

FieldIndex valid values are from 1 to RecordFieldCount .

After a successful query, the RecordFieldValue array provides the field values for each record. RecordFieldValue(i) provides the field values for the i-th record.

To retrieve a particular field value for a record, first set FieldIndex to a valid response field index (from 1 to RecordFieldCount ), and then query RecordFieldValue for the value of that field.

Example (loop through all fields of i-th record)

 For j = 1 to DNSControl.RecordFieldCount(i)
 \011DNSControl.FieldIndex = j
 \011DoSomethingWith(DNSControl.RecordFieldName(i), DNSControl.RecordFieldValue(i))
 Next j 

IPWorksException

isIdle

public boolean isIdle()
The current status of the component.

Idle will be False if the component is currently busy (communicating and/or waiting for an answer), and True at all other times.


getQueryDomain

public java.lang.String getQueryDomain()
The domain to query.

Setting QueryDomain will initiate the DNS query. The bean will query the host in DNSServer for any records of the type in QueryType . Once the query is complete a single Response event will fire, and the following properties will contain the results:

StatusCode
The success or error code of the DNS query.
Status
A standard string interpretation of StatusCode .
RecordCount
The number of RecordSource records in the last DNS response.
RecordSource
The source (type) of records being listed.
FieldIndex
The field being considered in the selected record.
RecordFieldCount
The number fields available for the selected record.
RecordFieldName
The field name corresponding to FieldIndex .
RecordFieldValue
The field value corresponding to FieldIndex .
RecordData
The entire record data.

Setting the QueryDomain property is equivalent to calling the Query method.


setQueryDomain

public void setQueryDomain(java.lang.String queryDomain)
                    throws IPWorksException
The domain to query.

Setting QueryDomain will initiate the DNS query. The bean will query the host in DNSServer for any records of the type in QueryType . Once the query is complete a single Response event will fire, and the following properties will contain the results:

StatusCode
The success or error code of the DNS query.
Status
A standard string interpretation of StatusCode .
RecordCount
The number of RecordSource records in the last DNS response.
RecordSource
The source (type) of records being listed.
FieldIndex
The field being considered in the selected record.
RecordFieldCount
The number fields available for the selected record.
RecordFieldName
The field name corresponding to FieldIndex .
RecordFieldValue
The field value corresponding to FieldIndex .
RecordData
The entire record data.

Setting the QueryDomain property is equivalent to calling the Query method.

IPWorksException

getQueryType

public int getQueryType()
The record type to query.

Before a query is attempted, QueryType must be set to the desired record type. The records are defined as follows:

qtAddress (1)
Address Records
qtNS (2)
Name Server Records
qtMD (3)
Mail Destination Records
qtMF (4)
Mail Forwarder Records
qtCName (5)
Canonical Name Records
qtSOA (6)
Start Of Authority Records
qtMailBox (7)
MailBox Records
qtMailGroup (8)
Mail Group Records
qtMR (9)
MailBox Rename Records
qtNULL (10)
NULL Records
qtWKS (11)
Well Known Services Records
qtPointer (12)
Pointer Records
qtHostInfo (13)
Host Information Records
qtMailInfo (14)
Mail Information Records
qtMX (15)
Mail Exchange Records
qtText (16)
Text Records
qtRP (17)
Responsible Person Records
qtAFSDB (18)
Service Records
qtX25 (19)
X25 Records
qtISDN (20)
ISDN Records
qtRT (21)
Route Through Records
qtAAAA (28)
AAAA Record
rtSRV (33)
SRV Record (location of services)


setQueryType

public void setQueryType(int queryType)
                  throws IPWorksException
The record type to query.

Before a query is attempted, QueryType must be set to the desired record type. The records are defined as follows:

qtAddress (1)
Address Records
qtNS (2)
Name Server Records
qtMD (3)
Mail Destination Records
qtMF (4)
Mail Forwarder Records
qtCName (5)
Canonical Name Records
qtSOA (6)
Start Of Authority Records
qtMailBox (7)
MailBox Records
qtMailGroup (8)
Mail Group Records
qtMR (9)
MailBox Rename Records
qtNULL (10)
NULL Records
qtWKS (11)
Well Known Services Records
qtPointer (12)
Pointer Records
qtHostInfo (13)
Host Information Records
qtMailInfo (14)
Mail Information Records
qtMX (15)
Mail Exchange Records
qtText (16)
Text Records
qtRP (17)
Responsible Person Records
qtAFSDB (18)
Service Records
qtX25 (19)
X25 Records
qtISDN (20)
ISDN Records
qtRT (21)
Route Through Records
qtAAAA (28)
AAAA Record
rtSRV (33)
SRV Record (location of services)

IPWorksException

getRecordCount

public int getRecordCount()
The number of RecordSource records in the last response.

Once the query is complete a single Response event will fire, and the following properties will contain the results:

StatusCode
The success or error code of the DNS query.
Status
A standard string interpretation of StatusCode .
RecordCount
The number of RecordSource records in the last DNS response.
RecordSource
The source (type) of records being listed.
FieldIndex
The field being considered in the selected record.
RecordFieldCount
The number fields available for the selected record.
RecordFieldName
The field name corresponding to FieldIndex .
RecordFieldValue
The field value corresponding to FieldIndex .
RecordData
The entire record data.

Example (Loop through all fields of all records)

 For i = 1 to DNSControl.RecordCount
 \011For j = 1 to DNSControl.RecordFieldCount(i)
 \011\011DNSControl.FieldIndex = j
 \011\011DoSomethingWith(DNSControl.RecordFieldName(i), DNSControl.RecordFieldValue(i))
 \011Next j
 Next i 


getRecordData

public byte[] getRecordData(int recordIndex)
                     throws IPWorksException
The full record data as received from the DNS server.

After a successful query, the RecordFieldValue array provides the field values for each record. RecordFieldValue(i) provides the field values for the i-th record.

To retrieve a particular field value for a record, first set FieldIndex to a valid response field index (from 1 to RecordFieldCount ), and then query RecordFieldValue for the value of that field.

Example (loop through all fields of i-th record)

 For j = 1 to DNSControl.RecordFieldCount(i)
 \011DNSControl.FieldIndex = j
 \011DoSomethingWith(DNSControl.RecordFieldName(i), DNSControl.RecordFieldValue(i))
 Next j 

IPWorksException

getRecordDomain

public java.lang.String getRecordDomain(int recordIndex)
                                 throws IPWorksException
The domain name associated with the selected response record.

The domain name associated with the response record at RecordIndex .

IPWorksException

getRecordFieldCount

public int getRecordFieldCount(int recordIndex)
                        throws IPWorksException
Number of fields in the record.

The number of fields in the record specified by RecordIndex . After a successful query, the RecordFieldValue array provides the field values for each record. RecordFieldValue(i) provides the field values for the i-th record.

To retrieve a particular field value for a record, first set FieldIndex to a valid response field index (from 1 to RecordFieldCount ), and then query RecordFieldValue for the value of that field.

Example (loop through all fields of i-th record)

 For j = 1 to DNSControl.RecordFieldCount(i)
 \011DNSControl.FieldIndex = j
 \011DoSomethingWith(DNSControl.RecordFieldName(i), DNSControl.RecordFieldValue(i))
 Next j 

IPWorksException

getRecordFieldName

public java.lang.String getRecordFieldName(int recordIndex)
                                    throws IPWorksException
The name of the field selected by FieldIndex for RecordIndex .

Field names are different depending on the record type. For example, an MX record type will contain two fields: PREFERENCE and EXCHANGE, but an SOA record type contains seven fields.

Field names:

A Records
ADDRESS
NS Records
DNAME
MD
MADNAME
MF
MADNAME
CNAME
CNAME
SOA
MNAME
SOA
RNAME
SOA
SERIAL
SOA
REFRESH
SOA
RETRY
SOA
EXPIRE
SOA
MINIMUM
MB
MADNAME
MG
MGMNAME
MR
NEWNAME
NULL
NULL
WKS
ADDRESS
WKS
PROTOCOL
WKS
SERVICEMAP
PTR
PTRDNAME
HINFO
CPU
HINFO
OS
MINFO
RMAILBX
MINFO
EMAILBX
MX
PREFERENCE
MX
EXCHANGE
TXT
TXT
RP
MBOXDNAME
RP
TXTDNAME
AFSDB
SUBTYPE
AFSDB
HOSTNAME
X25
PSDNADDRESS
ISDN
ISDNADDRESS
RT
PREFERENCE
RT
INTERMEDIATE
AAAA
ADDRESS
SRV
PRIORITY
SRV
WEIGHT
SRV
PORT
SRV
TARGET

IPWorksException

getRecordFieldValue

public byte[] getRecordFieldValue(int recordIndex)
                           throws IPWorksException
The value of the field selected by FieldIndex for RecordIndex .

After a successful query, the RecordFieldValue array provides the field values for each record. RecordFieldValue(i) provides the field values for the i-th record.

To retrieve a particular field value for a record, first set FieldIndex to a valid response field index (from 1 to RecordFieldCount ), and then query RecordFieldValue for the value of that field.

Example (loop through all fields of i-th record)

 For j = 1 to DNSControl.RecordFieldCount(i)
 \011DNSControl.FieldIndex = j
 \011DoSomethingWith(DNSControl.RecordFieldName(i), DNSControl.RecordFieldValue(i))
 Next j 

IPWorksException

getRecordSource

public int getRecordSource()
The source of records being listed in the record arrays.

RecordSource can have one of the following values:

rsAnswerSection (0)
Records answering the question/query.
rsNameServerSection (1)
Records pointing toward an authoritative name server.
rsAdditionalRecordsSection (2)
Records holding additional information.


setRecordSource

public void setRecordSource(int recordSource)
                     throws IPWorksException
The source of records being listed in the record arrays.

RecordSource can have one of the following values:

rsAnswerSection (0)
Records answering the question/query.
rsNameServerSection (1)
Records pointing toward an authoritative name server.
rsAdditionalRecordsSection (2)
Records holding additional information.

IPWorksException

getRecordTTL

public int getRecordTTL(int recordIndex)
                 throws IPWorksException
The record Time To Live (TTL) value.

The TTL specifies the time interval in seconds that the record is valid, or the time interval that the record can be cached before the DNS server should be queried again.

IPWorksException

getRecordType

public int getRecordType(int recordIndex)
                  throws IPWorksException
The record type corresponding to RecordIndex .

The record types correspond to QueryType and are defined as follows:

rtAddress (0)
Address Record
rtNS (1)
Name Server Record
rtMD (2)
Mail Destination Record
rtMF (3)
Mail Forwarder Record
rtCName (4)
Canonical Name Record
rtSOA (5)
Start Of Authority Record
rtMailBox (6)
MailBox Record
rtMailGroup (7)
Mail Group Record
rtMR (8)
MailBox Rename Record
rtNULL (9)
NULL Record
rtWKS (10)
Well Known Services Record
rtPointer (11)
Pointer Record
rtHostInfo (12)
Host Information Record
rtMailInfo (13)
Mail Information Record
rtMX (14)
Mail Exchange Record
rtText (15)
Text Record
rtRP (16)
Responsible Person Record
rtAFSDB (17)
Service Record
rtX25 (18)
X25 Record
rtISDN (19)
ISDN Record
rtRT (20)
Route Through Record
rtAAAA (28)
AAAA Record
rtSRV (33)
SRV Record (location of services)

IPWorksException

getRecordTypeName

public java.lang.String getRecordTypeName(int recordIndex)
                                   throws IPWorksException
String representation of the current record type defined by RecordType .

A (0)
Address Record
NS (1)
Name Server Record
MD (2)
Mail Destination Record
MF (3)
Mail Forwarder Record
CName (4)
Canonical Name Record
SOA (5)
Start Of Authority Record
MB (6)
MailBox Record
MG (7)
Mail Group Record
MR (8)
MailBox Rename Record
NULL (9)
NULL Record
WKS (10)
Well Known Services Record
PTR (11)
Pointer Record
HINFO (12)
Host Information Record
MINFO (13)
Mail Information Record
MX (14)
Mail Exchange Record
TXT (15)
Text Record
RP (16)
Responsible Person Record
AFSDB (17)
Service Record
X25 (18)
X25 Record
ISDN (19)
ISDN Record
RT (20)
Route Through Record
AAAA (28)
AAAA Record

IPWorksException

isRecursive

public boolean isRecursive()
Determines whether to ask the DNSServer to recursively query other servers.

If Recursive is true, the component will tell the DNS server to perform the query recursively. This means that if the DNS server does not have information about the Domain being queried, it will send the request to another DNS server.


setRecursive

public void setRecursive(boolean recursive)
                  throws IPWorksException
Determines whether to ask the DNSServer to recursively query other servers.

If Recursive is true, the component will tell the DNS server to perform the query recursively. This means that if the DNS server does not have information about the Domain being queried, it will send the request to another DNS server.

IPWorksException

getRequestId

public int getRequestId()
The id of the current DNS request.

Each time the bean makes a DNS query, it generates a unique request id to track the response. RequestId is the id of the request that generated the current response values.

If a custom value is needed for RequestId , the property must be set before sending a request. The bean increments RequestId automatically after sending each request.


setRequestId

public void setRequestId(int requestId)
                  throws IPWorksException
The id of the current DNS request.

Each time the bean makes a DNS query, it generates a unique request id to track the response. RequestId is the id of the request that generated the current response values.

If a custom value is needed for RequestId , the property must be set before sending a request. The bean increments RequestId automatically after sending each request.

IPWorksException

getStatus

public java.lang.String getStatus()
A standard string interpretation of StatusCode .

For a list of valid error codes and their descriptions, please refer to the Error Messages section.


getStatusCode

public int getStatusCode()
The success or error code for the DNS query.

For a list of valid error codes and their descriptions, please refer to the Error Messages section.


getTimeout

public int getTimeout()
A timeout for the bean.

If the Timeout property is set to 0, all operations return immediately, potentially failing with an error if they can't be completed immediately.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an IPWorksException raises an IPWorksException exception .

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by theAbsoluteTimeoutconfiguration setting.

The default value for the Timeout property is 60 seconds.


setTimeout

public void setTimeout(int timeout)
                throws IPWorksException
A timeout for the bean.

If the Timeout property is set to 0, all operations return immediately, potentially failing with an error if they can't be completed immediately.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an IPWorksException raises an IPWorksException exception .

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by theAbsoluteTimeoutconfiguration setting.

The default value for the Timeout property is 60 seconds.

IPWorksException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksException
Sets or retrieves a beanconfiguration setting.

Config is a generic method available in every bean. It is used to set and retrieveconfiguration settingsfor the bean.

Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

IPWorksException

doEvents

public void doEvents()
              throws IPWorksException
Processes events from the internal message queue.

When DoEvents is called, the bean processes any available events. If no events are available, it waits for a preset period of time, and then returns.

IPWorksException

interrupt

public void interrupt()
               throws IPWorksException
Interrupt the current method.

If there is no method in progress, Interrupt simply returns doing nothing.

IPWorksException

query

public void query(java.lang.String domain)
           throws IPWorksException
Query a Domain

The bean will query the host Domain for any records of the type in QueryType . Once the query is complete a single Response event will fire, and the following properties will contain the results:

StatusCode
The success or error code of the DNS query.
Status
A standard string interpretation of StatusCode .
RecordCount
The number of RecordSource records in the last DNS response.
RecordSource
The source (type) of records being listed.
FieldIndex
The field being considered in the selected record.
RecordFieldCount
The number fields available for the selected record.
RecordFieldName
The field name corresponding to FieldIndex .
RecordFieldValue
The field value corresponding to FieldIndex .
RecordData
The entire record data.

Calling the Query method is equivalent to setting the QueryDomain property to the domain you want to Query.

IPWorksException

addDnsEventListener

public void addDnsEventListener(DnsEventListener l)
                         throws java.util.TooManyListenersException
java.util.TooManyListenersException

removeDnsEventListener

public void removeDnsEventListener(DnsEventListener l)

IP*Works! V6

Copyright (c) 2004 /n software inc. - All rights reserved.