IP*Works! V8

ipworks
Class Whois

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

public class Whois
extends java.lang.Object

The Whois bean allows you to query a WHOIS Server for Domain registration information.

This component implements the WHOIS protocol defined in RFC 954.

To use the bean, simply call the Query method and set the Domain parameter to the domain you wish to retrieve information for. This is identical to setting the Domain property with the domain that you would like to get information for. This will trigger a WHOIS search on the domain. Upon completion of the search, the DomainInfo property contains the information about the Domain .

If the Server property is empty, then a search is performed automatically at "whois.internic.net" for the appropriate WHOIS server for the Domain , and the Server property is set to the server found.


Constructor Summary
Whois()
           
 
Method Summary
 void addWhoisEventListener(ipworks.WhoisEventListener l)
           
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a beanconfiguration setting.
 void doEvents()
          Processes events from the internal message queue.
 java.lang.String getDefaultServer()
          The default server from which to retrieve registrar information.
 java.lang.String getDomainInfo()
          The information that is returned by the Server .
 ipworks.Firewall getFirewall()
          A set of properties related to firewall access.
 java.lang.String getLocalHost()
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 java.lang.String getServer()
          The server to request domain information from.
 int getTimeout()
          A timeout for the bean.
 void interrupt()
          Interrupt the current method.
 void query(java.lang.String domain)
          Get information about a domain.
 void removeWhoisEventListener(ipworks.WhoisEventListener l)
           
 void setDefaultServer(java.lang.String defaultServer)
          The default server from which to retrieve registrar information.
 void setFirewall(ipworks.Firewall firewall)
          A set of properties related to firewall access.
 void setLocalHost(java.lang.String localHost)
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 void setServer(java.lang.String server)
          The server to request domain information from.
 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
 

Constructor Detail

Whois

public Whois()
Method Detail

getDefaultServer

public java.lang.String getDefaultServer()
The default server from which to retrieve registrar information.

If Server is empty, then the bean will attempt to connect to DefaultServer and determine the WHOIS server of the registrar of the domain. The Server property will then be set to the name of the WHOIS server of the registrar, and a WHOIS request will be issued against that server.

The default value for DefaultServer is "whois.internic.net".


setDefaultServer

public void setDefaultServer(java.lang.String defaultServer)
                      throws IPWorksException
The default server from which to retrieve registrar information.

If Server is empty, then the bean will attempt to connect to DefaultServer and determine the WHOIS server of the registrar of the domain. The Server property will then be set to the name of the WHOIS server of the registrar, and a WHOIS request will be issued against that server.

The default value for DefaultServer is "whois.internic.net".

IPWorksException

getDomainInfo

public java.lang.String getDomainInfo()
The information that is returned by the Server .

The default value is an empty string. After Domain is set and the request completes, it contains the data returned by the Server .


getFirewall

public ipworks.Firewall getFirewall()
A set of properties related to firewall access.

This is a FIREWALL type property which contains fields describing the firewall through which the bean will attempt to connect.


setFirewall

public void setFirewall(ipworks.Firewall firewall)
                 throws IPWorksException
A set of properties related to firewall access.

This is a FIREWALL type property which contains fields describing the firewall through which the bean will attempt to connect.

IPWorksException

getLocalHost

public java.lang.String getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.


setLocalHost

public void setLocalHost(java.lang.String localHost)
                  throws IPWorksException
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

IPWorksException

getServer

public java.lang.String getServer()
The server to request domain information from.

This property should be set to the valid Internet address of computer running WHOIS services. If the address is not valid or the specified Server is not running WHOIS services, the bean throws an IPWorksException raises an IPWorksException exception when Domain is set.

If the address is empty, then the bean will attempt to connect to DefaultServer and determine the WHOIS server of the registrar of the domain. The Server property will then be set to the name of the WHOIS server of the registrar, and a WHOIS request will be issued against that server.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceeded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.


setServer

public void setServer(java.lang.String server)
               throws IPWorksException
The server to request domain information from.

This property should be set to the valid Internet address of computer running WHOIS services. If the address is not valid or the specified Server is not running WHOIS services, the bean throws an IPWorksException raises an IPWorksException exception when Domain is set.

If the address is empty, then the bean will attempt to connect to DefaultServer and determine the WHOIS server of the registrar of the domain. The Server property will then be set to the name of the WHOIS server of the registrar, and a WHOIS request will be issued against that server.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceeded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

IPWorksException

getTimeout

public int getTimeout()
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion, or an error condition is encountered.

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 behaviour 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 will run uninterrupted until successful completion, or an error condition is encountered.

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 behaviour 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
Get information about a domain.

Calling this method gets information about the domain specified by the Domain property. The result is returned to the DomainInfo property.

IPWorksException

addWhoisEventListener

public void addWhoisEventListener(ipworks.WhoisEventListener l)
                           throws java.util.TooManyListenersException
java.util.TooManyListenersException

removeWhoisEventListener

public void removeWhoisEventListener(ipworks.WhoisEventListener l)

IP*Works! V8

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