public class Whois
extends java.lang.Object
implements java.io.Serializable
Example Usage:
Whois whois = new Whois(); try { // attempts to lookup information about domain myserver.com String results = whois.query("myserver.com"); System.out.println(results); } catch(WhoisException e) { System.out.println(e); }
Constructor and Description |
---|
Whois()
Creates a new Whois instance.
|
Whois(java.lang.String hostname)
Creates a new Whois instance with hostname of whois server as argument.
|
Modifier and Type | Method and Description |
---|---|
void |
clearProxySettings()
Clears proxy server values.
|
java.lang.String |
getHostname()
Gets hostname of Whois server.
|
int |
getPort()
Gets port of Whois server.
|
int |
getTimeout()
Gets the timeout for opening a Whois connection.
|
java.lang.String |
query(java.lang.String command)
Connects to Whois server and performs Whois query.
|
void |
setHostname(java.lang.String str)
Sets hostname of Whois server.
|
void |
setPort(int port)
Sets port of Whois server.
|
void |
setProxyAuthentication(java.lang.String proxyUsername,
java.lang.String proxyPassword)
Sets the username and password to use when for authentication with
proxy server.
|
void |
setProxyHost(java.lang.String proxyHostname,
int proxyPort)
Sets the proxy hostname and port for this connection.
|
void |
setProxyType(java.lang.String proxyType)
Sets the proxy type will be used for this connection.
|
void |
setTimeout(int timeout)
Sets the timeout for opening a Whois connection.
|
public Whois()
public Whois(java.lang.String hostname)
hostname
- the hostname of whois serverpublic void setPort(int port)
port
- the port of Whois serverpublic int getPort()
public void setHostname(java.lang.String str)
str
- the hostname of Whois serverpublic java.lang.String getHostname()
public void setTimeout(int timeout)
timeout
- in millisecondspublic int getTimeout()
public void setProxyAuthentication(java.lang.String proxyUsername, java.lang.String proxyPassword)
#clearProxySettings
method.proxyUsername
- the proxy usernameproxyPassword
- the proxy passwordclearProxySettings()
public void setProxyHost(java.lang.String proxyHostname, int proxyPort)
#clearProxySettings
method.proxyHostname
- the hostname or ip address of the proxy serverproxyPort
- the port of the proxy serverclearProxySettings()
public void setProxyType(java.lang.String proxyType)
proxyType
- The proxy type. Valid values: HTTP, SOCKS5public void clearProxySettings()
public java.lang.String query(java.lang.String command) throws WhoisException
command
- the domain or command to queryWhoisException
- if a Whois or I/O error occursCopyright © JSCAPE LLC. 1999-2021. All Rights Reserved