|
IP*Works! V8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ipworks.Ipinfo
The IPInfo bean is used to resolve host names to host addresses and vice-versa using asynchronous DNS. The bean provides access to other TCP/IP database functions as well.
The IPInfo bean operates asynchronously. Requests are posted to the
bean 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(ipworks.IpinfoEventListener l)
|
java.lang.String |
config(java.lang.String configurationString)
Sets or retrieves a beanconfiguration setting. |
void |
DHCPRelease()
Releases the IP Address of the current adapter specified by AdapterIndex . |
void |
DHCPRenew()
Renews the IP Address of the current adapter specified by AdapterIndex . |
void |
doEvents()
Processes events from the internal message queue. |
int |
getAdapterCount()
The number of adapters in the system. |
java.lang.String |
getAdapterDescription()
The description of the adapter identified by AdapterIndex . |
int |
getAdapterDeviceIndex()
The system index of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterDHCPServer()
The DHCP server of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterGateway()
The default gateway of the adapter identified by AdapterIndex . |
int |
getAdapterIndex()
Sets the current adapter. |
java.lang.String |
getAdapterIPAddress()
The IP address of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterLeaseExpires()
The expiration date and time of the lease obtained by the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterLeaseObtained()
The date and time of when the current lease was obtained by the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterName()
The name of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterOtherIPAddresses()
Other IP addresses leased by the adapter specified by AdapterIndex , if any. |
java.lang.String |
getAdapterPhysicalAddress()
The physical address of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterPrimaryWINSServer()
The primary WINS server of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterSecondaryWINSServer()
The secondary WINS server of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterSubnetMask()
The subnet of the adapter identified by AdapterIndex . |
java.lang.String |
getAdapterType()
The type of adapter identified by AdapterIndex . |
java.lang.String |
getDHCPScope()
The DHCP Scope of the DHCP server. |
java.lang.String |
getDNSServer()
The DNS server for the adapter specified by LocalHost . |
java.lang.String |
getDomainName()
The current network domain on which the system resides. |
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 |
getMAC(java.lang.String IPAddress)
Returns the MAC address of the network interface at IPAddress . |
java.lang.String |
getNodeType()
The type of node for the system. |
java.lang.String |
getOtherAddresses()
Other addresses for the host identified by HostName (for multihomed hosts). |
java.lang.String |
getOtherDNSServers()
Other DNS servers configured for the host machine. |
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 . |
boolean |
isAdapterDHCPEnabled()
Shows whether or not the adapter identified by AdapterIndex has DHCP Enabled. |
boolean |
isAdapterUsesWINS()
Shows whether or not the adapter identified by AdapterIndex uses WINS. |
boolean |
isARPProxy()
Shows whether the adapter can act as an ARP proxy. |
boolean |
isDNSEnabled()
Shows whether or not the adapter identified by LocalHost has DNS Enabled. |
boolean |
isRoutingEnabled()
Shows whether routing is enabled on the adapter. |
void |
removeIpinfoEventListener(ipworks.IpinfoEventListener l)
|
void |
reset()
Resets the bean stopping all pending requests and refreshing network information. |
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 |
setAdapterIndex(int adapterIndex)
Sets the current adapter. |
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 int getAdapterCount()
The AdapterCount property shows how many adapters are installed in the system. You can set
the AdapterIndex to 1 through AdapterCount , and then examine the Adapter properties such
as AdapterDescription , AdapterName , and AdapterIPAddress to retreive information about
each adapter.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterDescription()
AdapterIndex .
The description of the adapter identified by AdapterIndex , as returned from the system.
NOTE: This functionality is only available in Windows.
public int getAdapterDeviceIndex()
AdapterIndex .
The system index of the adapter identified by AdapterIndex , as returned by the system.
NOTE: This functionality is only available in Windows.
public boolean isAdapterDHCPEnabled()
AdapterIndex has DHCP Enabled.
Dynamic Host Configuration Protocol (DHCP) is used for automatically assigning IP Addresses on a network.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterDHCPServer()
AdapterIndex .
Dynamic Host Configuration Protocol (DHCP) is used for automatically assigning IP Addresses on a network.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterGateway()
AdapterIndex .
The default gateway of the adapter identified by AdapterIndex , as returned by the system.
NOTE: This functionality is only available in Windows.
public int getAdapterIndex()
When set, the bean asks the system for information on the adapter with an index of AdapterIndex . If the system has information, the Adapter properties will be populated with the data returned.
AdapterCount is the number of adapters located in the system.
NOTE: This functionality is only available in Windows.
public void setAdapterIndex(int adapterIndex)
throws IPWorksException
When set, the bean asks the system for information on the adapter with an index of AdapterIndex . If the system has information, the Adapter properties will be populated with the data returned.
AdapterCount is the number of adapters located in the system.
NOTE: This functionality is only available in Windows.
IPWorksExceptionpublic java.lang.String getAdapterIPAddress()
AdapterIndex .
The IP address of the adapter identified by AdapterIndex , as returned by the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterLeaseExpires()
AdapterIndex .
The expiration date and time of the lease obtained by the adapter identified by AdapterIndex ,
as returned by the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterLeaseObtained()
AdapterIndex .
The date and time of when the current lease was obtained by the adapter identified by AdapterIndex ,
as returned by the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterName()
AdapterIndex .
The name of the adapter identified by AdapterIndex , as returned from the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterOtherIPAddresses()
AdapterIndex , if any.
A space separated list of any other IP addresses leased by the adapter specified
by AdapterIndex , if any.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterPhysicalAddress()
AdapterIndex .
The physical address of the adapter identified by AdapterIndex , as returned from the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterPrimaryWINSServer()
AdapterIndex .
The primary WINS server of the adapter identified by AdapterIndex , as returned from the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterSecondaryWINSServer()
AdapterIndex .
The secondary WINS server of the adapter identified by AdapterIndex , as returned from the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterSubnetMask()
AdapterIndex .
The subnet of the adapter identified by AdapterIndex , as returned from the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterType()
AdapterIndex .
The type of adapter identified by AdapterIndex , as returned from the system.
Possible values include:
NOTE: This functionality is only available in Windows.
public boolean isAdapterUsesWINS()
AdapterIndex uses WINS.
Shows whether or not the adapter identified by AdapterIndex uses WINS.
Windows Internet Name Service (WINS) is a name resolution service which is used to
resolve Windows network hostnames to IP addresses.
NOTE: This functionality is only available in Windows.
public boolean isARPProxy()
The adapter is identified by AdapterIndex .
NOTE: This functionality is only available in Windows.
public java.lang.String getDHCPScope()
If the DHCP Server.is true, the DHCPScope is the DHCP Scope of the DHCP server. The DHCP Scope is a range of IP addresses which the DHCP server can lease to clients.
NOTE: This functionality is only available in Windows.
public boolean isDNSEnabled()
LocalHost has DNS Enabled.
If true, DNS is enabled, and name resolution will be available.
NOTE: This functionality is only available in Windows.
public java.lang.String getDNSServer()
LocalHost .
The DNS server for the adapter specified by LocalHost , as returned by the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getDomainName()
The domain name of which the system is joined.
NOTE: This functionality is only available in Windows.
public java.lang.String getHostAddress()
The 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.
Example (Resolve an Address)
IPInfoControl.HostAddress = "10.0.1.10"
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedName = IPInfoControl.HostName
public void setHostAddress(java.lang.String hostAddress)
throws IPWorksException
The 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.
Example (Resolve an Address)
IPInfoControl.HostAddress = "10.0.1.10"
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedName = IPInfoControl.HostName
IPWorksExceptionpublic java.lang.String getHostAliases()
The HostAliases property contains a list of alternate names
for the host specified by HostName and HostAddress separated by
spaces.
public java.lang.String getHostName()
The 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.
Example (Resolve a Name)
IPInfoControl.HostName = "MyHostName"
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedAddress = IPInfoControl.HostAddress
public void setHostName(java.lang.String hostName)
throws IPWorksException
The 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.
Example (Resolve a Name)
IPInfoControl.HostName = "MyHostName"
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedAddress = IPInfoControl.HostAddress
IPWorksExceptionpublic java.lang.String getLocalHost()
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.
public java.lang.String getNodeType()
Possible values include "BROADCAST", "PEERTOPEER", "MIXED", "HYBRID".
NOTE: This functionality is only available in Windows.
public java.lang.String getOtherAddresses()
The 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 java.lang.String getOtherDNSServers()
OtherDNSServers is a space-separated list of DNS servers configured for the host machine. Note that the primary server is provided in the DNSServer property.
NOTE: This functionality is only available in Windows.
public int getPendingRequests()
The 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
The 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.
IPWorksExceptionpublic int getRequestId()
The 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 boolean isRoutingEnabled()
The adapter is identified by AdapterIndex .
NOTE: This functionality is only available in Windows.
public java.lang.String getServiceAliases()
ServiceName / ServicePort is known.
The ServiceAliases property contains a list of alternate service names
separated by spaces.
In most cases, this list is empty.
public java.lang.String getServiceName()
The 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
The 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.
IPWorksExceptionpublic int getServicePort()
The 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
The 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.
IPWorksExceptionpublic java.lang.String getServiceProtocol()
ServiceName / ServicePort .
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
ServiceName / ServicePort .
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.
IPWorksException
public java.lang.String config(java.lang.String configurationString)
throws IPWorksException
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
public void DHCPRelease()
throws IPWorksException
AdapterIndex .
If AdapterDHCPEnabled is true, the lease of the IP Address assigned to
the current adapter specified by AdapterIndex is released.
NOTE: This functionality is only available in Windows.
IPWorksException
public void DHCPRenew()
throws IPWorksException
AdapterIndex .
If AdapterDHCPEnabled is true, the lease of the IP Address assigned
to the current adapter specified by AdapterIndex is renewed.
NOTE: This functionality is only available in Windows.
IPWorksException
public void doEvents()
throws IPWorksException
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
public java.lang.String getMAC(java.lang.String IPAddress)
throws IPWorksException
Returns the unique Media Access Control (MAC) address of the network interface at IPAddress .
NOTE: This functionality is only available in Windows.
IPWorksException
public void reset()
throws IPWorksException
If the network configuration has changed, call this method to retrieve the latest information.
IPWorksException
public java.lang.String resolveAddress(java.lang.String hostAddress)
throws IPWorksException
Resolves the IP Address HostAddress and sets HostName to the name of the host corresponding to HostAddress .
Calling this method is equivalent to setting the HostAddress property
to HostAddress .
Example (Resolve an Address)
IPInfoControl.ResolveAddress("10.0.1.10")
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedName = IPInfoControl.HostName
IPWorksException
public java.lang.String resolveName(java.lang.String hostName)
throws IPWorksException
Returns the IP address corresponding to HostName .
Resolves the host name HostName and sets HostAddress to the IP Address of the host
corresponding to HostName .
IPWorksException
public void addIpinfoEventListener(ipworks.IpinfoEventListener l)
throws java.util.TooManyListenersException
java.util.TooManyListenersExceptionpublic void removeIpinfoEventListener(ipworks.IpinfoEventListener l)
|
IP*Works! V8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||