Java Reference
In-Depth Information
Table 8-3. Whois prefixes
Prefix
Meaning
Domain
Find only domain records.
Gateway
Find only gateway records.
Group
Find only group records.
Host
Find only host records.
Network
Find only network records.
Organization
Find only organization records.
Person
Find only person records.
ASN
Find only autonomous system number records.
Handle or !
Search only for matching handles.
Mailbox or @
Search only for matching email addresses.
Name or :
Search only for matching names.
Expand or *
Search only for group records and show all individuals in that group.
Full or =
Show complete record for each match.
Partial or suffix
Match records that start with the given string.
Summary or $
Show just the summary, even if there's only one match.
SUBdisplay or %
Show the users of the specified host, the hosts on the specified network, etc.
These keywords are all useful, but they're way too much trouble to remember. In fact,
most people don't even know that they exist. They just type “whois Harold” at the com‐
mand line and sort through the mess that comes back. A good whois client doesn't rely
on users remembering arcane keywords; rather, it shows them the options. Supplying
this requires a graphical user interface for end users and a better API for client pro‐
grammers.
A Network Client Library
It's best to think of network protocols like whois in terms of the bits and bytes that move
across the network, whether as packets, datagrams, or streams. No network protocol
neatly fits into a GUI (with the arguable exception of the Remote Framebuffer Protocol
used by VNC and X11). It's usually best to encapsulate the network code into a separate
library that the GUI code can invoke as needed.
Example 8-7 is a reusable Whois class. Two fields define the state of each Whois object:
host , an InetAddress object, and port , an int . Together, these define the server that
this particular Whois object connects to. Five constructors set these fields from various
combinations of arguments. Furthermore, the host can be changed using the se
tHost() method.
 
Search WWH ::




Custom Search