IP*Works!

ipworks
Class Whois

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

public class Whois
extends java.lang.Object

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

To use the control, 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.


Field Summary
static int fwNone
           
static int fwSOCKS4
           
static int fwSOCKS5
           
static int fwTunnel
           
 
Constructor Summary
Whois()
           
 
Method Summary
 void addWhoisEventListener(WhoisEventListener l)
           
 void fireError(int errorCode, java.lang.String description)
          Information about errors during data delivery.
 java.lang.String getDefaultServer()
          The default server where to get registrar information from.
 java.lang.String getDomain()
          The specific domain to request information about.
 java.lang.String getDomainInfo()
          The information that returned by the Server .
 byte[] getFirewallData()
          Used to send other data to firewall.
 java.lang.String getFirewallHost()
          Name or IP address of firewall (optional).
 java.lang.String getFirewallPassword()
          A password if authentication is to be used connecting through the firewall.
 int getFirewallPort()
          Port of the firewall to connect to.
 int getFirewallType()
          Determines the type of firewall to connect through.
 java.lang.String getFirewallUser()
          A user name if authentication is to be used connecting through a firewall.
 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 component.
 void query(java.lang.String domain)
          Get information about a domain.
 void removeWhoisEventListener(WhoisEventListener l)
           
 void setDefaultServer(java.lang.String defaultServer)
          The default server where to get registrar information from.
 void setDomain(java.lang.String domain)
          The specific domain to request information about.
 void setFirewallData(byte[] firewallData)
          Used to send other data to firewall.
 void setFirewallHost(java.lang.String firewallHost)
          Name or IP address of firewall (optional).
 void setFirewallPassword(java.lang.String firewallPassword)
          A password if authentication is to be used connecting through the firewall.
 void setFirewallPort(int firewallPort)
          Port of the firewall to connect to.
 void setFirewallType(int firewallType)
          Determines the type of firewall to connect through.
 void setFirewallUser(java.lang.String firewallUser)
          A user name if authentication is to be used connecting through a firewall.
 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 component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fwNone

public static final int fwNone

fwTunnel

public static final int fwTunnel

fwSOCKS4

public static final int fwSOCKS4

fwSOCKS5

public static final int fwSOCKS5
Constructor Detail

Whois

public Whois()
Method Detail

getDefaultServer

public java.lang.String getDefaultServer()
The default server where to get registrar information from. If Server is empty, then the control 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 where to get registrar information from. If Server is empty, then the control 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".


getDomain

public java.lang.String getDomain()
The specific domain to request information about. When this property is set, a request is sent to the Server for the information that is stored about the domain. The server response is made available through the DomainInfo property.


setDomain

public void setDomain(java.lang.String domain)
               throws IPWorksException
The specific domain to request information about. When this property is set, a request is sent to the Server for the information that is stored about the domain. The server response is made available through the DomainInfo property.


getDomainInfo

public java.lang.String getDomainInfo()
The information that 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 .


getFirewallData

public byte[] getFirewallData()
Used to send other data to firewall. When the firewall is a tunneling proxy, use this property to to send custom (additional) headers to the firewall (e.g. headers for custom authentication schemes).


setFirewallData

public void setFirewallData(byte[] firewallData)
                     throws IPWorksException
Used to send other data to firewall. When the firewall is a tunneling proxy, use this property to to send custom (additional) headers to the firewall (e.g. headers for custom authentication schemes).


getFirewallHost

public java.lang.String getFirewallHost()
Name or IP address of firewall (optional). If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.

If the FirewallHost property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the FirewallHost property is set to the corresponding address. If the search is not successful, an error is returned.


setFirewallHost

public void setFirewallHost(java.lang.String firewallHost)
                     throws IPWorksException
Name or IP address of firewall (optional). If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.

If the FirewallHost property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the FirewallHost property is set to the corresponding address. If the search is not successful, an error is returned.


getFirewallPassword

public java.lang.String getFirewallPassword()
A password if authentication is to be used connecting through the firewall. if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.


setFirewallPassword

public void setFirewallPassword(java.lang.String firewallPassword)
                         throws IPWorksException
A password if authentication is to be used connecting through the firewall. if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.


getFirewallPort

public int getFirewallPort()
Port of the firewall to connect to. The TCP port for the FirewallHost . See the description of the FirewallHost property for details.

Note that the FirewallPort is set automatically when FirewallType is set to a valid value. See the description of the FirewallType property for details.


setFirewallPort

public void setFirewallPort(int firewallPort)
                     throws IPWorksException
Port of the firewall to connect to. The TCP port for the FirewallHost . See the description of the FirewallHost property for details.

Note that the FirewallPort is set automatically when FirewallType is set to a valid value. See the description of the FirewallType property for details.


getFirewallType

public int getFirewallType()
Determines the type of firewall to connect through. The applicable values are the following:
fwNone (0)
No firewall (default setting).
fwTunnel (1)
Connect through a tunneling proxy. FirewallPort is set to 80.
fwSOCKS4 (2)
Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
fwSOCKS5 (3)
Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.


setFirewallType

public void setFirewallType(int firewallType)
                     throws IPWorksException
Determines the type of firewall to connect through. The applicable values are the following:
fwNone (0)
No firewall (default setting).
fwTunnel (1)
Connect through a tunneling proxy. FirewallPort is set to 80.
fwSOCKS4 (2)
Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
fwSOCKS5 (3)
Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.


getFirewallUser

public java.lang.String getFirewallUser()
A user name if authentication is to be used connecting through a firewall. if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.


setFirewallUser

public void setFirewallUser(java.lang.String firewallUser)
                     throws IPWorksException
A user name if authentication is to be used connecting through a firewall. if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.


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() Winsock 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 control initiate connections (or accept in the case of server controls) only through that interface.

If the control 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() Winsock 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 control initiate connections (or accept in the case of server controls) only through that interface.

If the control 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.


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, an error is returned when Domain is set.

If the address is empty, then the control 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.


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, an error is returned when Domain is set.

If the address is empty, then the control 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.


getTimeout

public int getTimeout()
A timeout for the component. If Timeout is set to a positive value, and an operation cannot be completed immediately, the control will retry the operation for a maximum of Timeout seconds.

The default value for Timeout is 30 (seconds).


setTimeout

public void setTimeout(int timeout)
                throws IPWorksException
A timeout for the component. If Timeout is set to a positive value, and an operation cannot be completed immediately, the control will retry the operation for a maximum of Timeout seconds.

The default value for Timeout is 30 (seconds).


fireError

public void fireError(int errorCode,
                      java.lang.String description)
Information about errors during data delivery. (Called internally to dispatch the event.)
See Also:
WhoisErrorEvent

query

public void query(java.lang.String domain)
           throws IPWorksException
Get information about a domain. Calling this method is equivalent to setting the Domain property to Domain .


addWhoisEventListener

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

removeWhoisEventListener

public void removeWhoisEventListener(WhoisEventListener l)

IP*Works!

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