|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Ipinfo
The IPInfo control is used to resolve host names to host addresses and vice-versa using asynchronous DNS. The control provides access to other Winsock database functions as well.
The IPInfo control operates asynchronously. Requests are posted to the
control by setting a property like HostName
, HostAddress
, ServiceName
, ServicePort
and then waiting for the RequestComplete
event. The RequestId
property identifies the request.
Up to 100 simultaneous requests can be queued at any moment. PendingRequests
shows the number of pending requests, and may also be used to adjust the size of
the queue (by dumping a number of the pending requests).
Constructor Summary | |
Ipinfo()
|
Method Summary | |
void |
addIpinfoEventListener(IpinfoEventListener l)
|
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
fireRequestComplete(int requestId,
int statusCode,
java.lang.String description)
Fired after an asynchronous request completes. |
java.lang.String |
getHostAddress()
An Internet Address in dotted format. |
java.lang.String |
getHostAliases()
Other names corresponding to the host with name HostName. |
java.lang.String |
getHostName()
The Domain Name of an Internet host. |
java.lang.String |
getLocalHost()
The name of the local host. |
java.lang.String |
getOtherAddresses()
Other addresses for the host identified by HostName (for multihomed hosts). |
int |
getPendingRequests()
The number of requests awaiting for completion. |
int |
getRequestId()
The handle of the last request. |
java.lang.String |
getServiceAliases()
Other names by which the service specified by ServiceName / ServicePort is known. |
java.lang.String |
getServiceName()
A name for a service. |
int |
getServicePort()
A port number for a service. |
java.lang.String |
getServiceProtocol()
The protocol of the service specified by ServiceName / ServicePort . |
void |
removeIpinfoEventListener(IpinfoEventListener l)
|
java.lang.String |
resolveAddress(java.lang.String hostAddress)
Resolve an IP address. |
java.lang.String |
resolveName(java.lang.String hostName)
Resolve a host name. |
void |
setHostAddress(java.lang.String hostAddress)
An Internet Address in dotted format. |
void |
setHostName(java.lang.String hostName)
The Domain Name of an Internet host. |
void |
setPendingRequests(int pendingRequests)
The number of requests awaiting for completion. |
void |
setServiceName(java.lang.String serviceName)
A name for a service. |
void |
setServicePort(int servicePort)
A port number for a service. |
void |
setServiceProtocol(java.lang.String serviceProtocol)
The protocol of the service specified by ServiceName / ServicePort . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Ipinfo()
Method Detail |
public java.lang.String getHostAddress()
HostAddress
property shows the IP address (in internet
dotted format aaa.bbb.ccc.ddd) of the host whose domain name
is specified by HostName
If HostAddress
is set to an IP address, a search is initiated
for the corresponding host names(s).
The RequestComplete
event is fired when the search is complete.
The RequestId
property identifies the pending request.
public void setHostAddress(java.lang.String hostAddress) throws IPWorksException
HostAddress
property shows the IP address (in internet
dotted format aaa.bbb.ccc.ddd) of the host whose domain name
is specified by HostName
If HostAddress
is set to an IP address, a search is initiated
for the corresponding host names(s).
The RequestComplete
event is fired when the search is complete.
The RequestId
property identifies the pending request.
public java.lang.String getHostAliases()
HostAliases
property contains a list of alternate names
for the host specified by HostName
and HostAddress
separated by
spaces.
public java.lang.String getHostName()
HostName
property shows the domain name of the host
whose IP address is specified by HostAddress
.
If HostName
is set to a domain name, a search is initiated
for the corresponding host address(s).
The RequestComplete
event is fired when the search is complete.
The RequestId
property identifies the pending request.
public void setHostName(java.lang.String hostName) throws IPWorksException
HostName
property shows the domain name of the host
whose IP address is specified by HostAddress
.
If HostName
is set to a domain name, a search is initiated
for the corresponding host address(s).
The RequestComplete
event is fired when the search is complete.
The RequestId
property identifies the pending request.
public java.lang.String getLocalHost()
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.
public java.lang.String getOtherAddresses()
OtherAddresses
property contains a list of alternate addresses
for the host specified by HostName
and HostAddress
separated by spaces.
Most hosts have only one IP interface. This property is useful
when querying multihomed hosts (hosts with more than one interface).
public int getPendingRequests()
PendingRequests
property serves two functions: it shows
the number of requests that are pending completion, but it
can also be used to adjust the size of the queue by dumping
part of or all the pending requests.
To cancel all the pending requests at any moment, simply
set PendingRequests
to 0.
public void setPendingRequests(int pendingRequests) throws IPWorksException
PendingRequests
property serves two functions: it shows
the number of requests that are pending completion, but it
can also be used to adjust the size of the queue by dumping
part of or all the pending requests.
To cancel all the pending requests at any moment, simply
set PendingRequests
to 0.
public int getRequestId()
RequestId
property gives the handle of the last request.
This handle can be later used to identify the request when
the RequestComplete
event is fired.
public java.lang.String getServiceAliases()
ServiceAliases
property contains a list of alternate service names
separated by spaces.
In most cases, this list is empty.
public java.lang.String getServiceName()
ServiceName
property shows the name of the service
specified located at ServicePort
.
If ServiceName
is set to a service name, a search is initiated
for the corresponding ServicePort
and other information related
to the service (if any).
The RequestComplete
event is fired when the search is complete. RequestId
identifies the pending request.
public void setServiceName(java.lang.String serviceName) throws IPWorksException
ServiceName
property shows the name of the service
specified located at ServicePort
.
If ServiceName
is set to a service name, a search is initiated
for the corresponding ServicePort
and other information related
to the service (if any).
The RequestComplete
event is fired when the search is complete. RequestId
identifies the pending request.
public int getServicePort()
ServicePort
property shows the port number for the service
specified by ServiceName
.
If ServicePort
is set to a port number, a search is initiated for
the ServiceName
and other information related to the service (if any).
The RequestComplete
event is fired when the search is complete. RequestId
identifies the pending request.
public void setServicePort(int servicePort) throws IPWorksException
ServicePort
property shows the port number for the service
specified by ServiceName
.
If ServicePort
is set to a port number, a search is initiated for
the ServiceName
and other information related to the service (if any).
The RequestComplete
event is fired when the search is complete. RequestId
identifies the pending request.
public java.lang.String getServiceProtocol()
ServiceProtocol
shows the protocol for the service specified
by ServiceName
.
Setting ServiceProtocol
to a particular protocol name (for example
'udp' or 'tcp') will force a search for a service for that protocol
only. If ServiceProtocol
is set to "" (empty string) then the
first entry for the service will be returned and ServiceProtocol
will be set to the corresponding protocol.
public void setServiceProtocol(java.lang.String serviceProtocol) throws IPWorksException
ServiceProtocol
shows the protocol for the service specified
by ServiceName
.
Setting ServiceProtocol
to a particular protocol name (for example
'udp' or 'tcp') will force a search for a service for that protocol
only. If ServiceProtocol
is set to "" (empty string) then the
first entry for the service will be returned and ServiceProtocol
will be set to the corresponding protocol.
public void fireError(int errorCode, java.lang.String description)
IpinfoErrorEvent
public void fireRequestComplete(int requestId, int statusCode, java.lang.String description)
IpinfoRequestCompleteEvent
public java.lang.String resolveAddress(java.lang.String hostAddress) throws IPWorksException
Calling this method is equivalent to setting the HostAddress
property
to HostAddress .
public java.lang.String resolveName(java.lang.String hostName) throws IPWorksException
Calling this method is equivalent to setting the HostName
property
to HostName .
public void addIpinfoEventListener(IpinfoEventListener l) throws java.util.TooManyListenersException
public void removeIpinfoEventListener(IpinfoEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |