|
IP*Works! V9 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectipworks.Ipinfo
public class 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
or HostAddress
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()
Creates an instance of Ipinfo Bean. |
|
Ipinfo(java.lang.String runtimeLicense)
Creates an instance of Ipinfo Bean with specified run-time license. |
Method Summary | |
---|---|
void |
addIpinfoEventListener(IpinfoEventListener l)
|
java.lang.String |
config(java.lang.String configurationString)
Sets or retrieves a configuration 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 address of the DNS Server. |
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 the 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 completion. |
int |
getRequestId()
The handle of the last request. |
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 local computer is acting as an ARP proxy. |
boolean |
isDNSEnabled()
Shows whether DNS is enabled on the local computer. |
boolean |
isRoutingEnabled()
Shows whether routing is enabled on the local computer. |
void |
removeIpinfoEventListener(IpinfoEventListener l)
|
void |
reset()
Resets the bean, stopping all pending requests and refreshing network information. |
java.lang.String |
resolveAddress(java.lang.String hostAddress)
Resolves an IP address. |
java.lang.String |
resolveName(java.lang.String hostName)
Resolves 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 completion. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Ipinfo()
public Ipinfo(java.lang.String runtimeLicense)
Method Detail |
---|
public int getAdapterCount()
This property shows how many adapters are installed in the system. You can set the AdapterIndex
from 0 to the AdapterCount
, and then examine the Adapter properties such
as AdapterDescription
, AdapterName
, and AdapterIPAddress
to retrieve information about
each adapter.
public java.lang.String getAdapterDescription()
AdapterIndex
.
This property contains the description of the adapter identified by AdapterIndex
, as returned by the system.
NOTE: This functionality is only available in Windows.
public int getAdapterDeviceIndex()
AdapterIndex
.
This property contains the system index of the adapter identified by AdapterIndex
, as returned by the system.
public boolean isAdapterDHCPEnabled()
AdapterIndex
has DHCP Enabled.
This property indicates whether or not the adapter identified by 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
.
This property contains the DHCP server of the adapter identified by 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
.
This property contains 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 this property is 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.
public void setAdapterIndex(int adapterIndex) throws IPWorksException
When this property is 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.
IPWorksException
public java.lang.String getAdapterIPAddress()
AdapterIndex
.
This property contains the IP address of the adapter identified by AdapterIndex
, as returned by the system.
public java.lang.String getAdapterLeaseExpires()
AdapterIndex
.
This property contains 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
.
This property contains 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
.
This property contains the name of the adapter identified by AdapterIndex
, as returned by the system.
public java.lang.String getAdapterOtherIPAddresses()
AdapterIndex
, if any.
This property contains 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
.
This property contains the physical address of the adapter identified by AdapterIndex
, as returned from the system.
This property is not supported in MacOS or iOS.
public java.lang.String getAdapterPrimaryWINSServer()
AdapterIndex
.
This property contains the primary WINS server of the adapter identified by AdapterIndex
, as returned by the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterSecondaryWINSServer()
AdapterIndex
.
This property contains the secondary WINS server of the adapter identified by AdapterIndex
, as returned by the system.
NOTE: This functionality is only available in Windows.
public java.lang.String getAdapterSubnetMask()
AdapterIndex
.
This property contains the subnet of the adapter identified by AdapterIndex
, as returned by the system.
public java.lang.String getAdapterType()
AdapterIndex
.
This property contains the type of adapter identified by AdapterIndex
, as returned by the system.
Possible values include:
Possible values include (Unix OS):
public boolean isAdapterUsesWINS()
AdapterIndex
uses WINS.
This property indicates 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()
This property indicates whether the local computer is acting as an ARP proxy. If true, the local computer will act as an ARP proxy, and will respond to ARP requests with its own hardware address.
NOTE: This functionality is only available in Windows.
public java.lang.String getDHCPScope()
This property contains a range of IP addresses which the Dynamic Host Configuration Protocol (DHCP) server can lease to clients.
NOTE: This functionality is only available in Windows.
public boolean isDNSEnabled()
This property indicates whether DNS is enabled on the local computer. If true, DNS is enabled, and name resolution will be available.
NOTE: This functionality is only available in Windows.
public java.lang.String getDNSServer()
The bean attempts to find the default DNS server for the machine where it is installed, and provide it in this property.
If the bean cannot determine the default DNS server address, this property value will be an empty string.
NOTE: This functionality is only available in Windows.
public java.lang.String getDomainName()
This property contains the domain name to which the system is joined.
NOTE: This functionality is only available in Windows.
public java.lang.String getHostAddress()
This property contains 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
This property contains 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
IPWorksException
public java.lang.String getHostAliases()
This property contains a list of alternate names
for the host specified by HostName
and HostAddress
separated by
spaces.
public java.lang.String getHostName()
This property contains the domain name of the host
whose IP address is specified by HostAddress
.
If this property 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
This property contains the domain name of the host
whose IP address is specified by HostAddress
.
If this property 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
IPWorksException
public java.lang.String getLocalHost()
This property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, it will contain the value of that address.
public java.lang.String getNodeType()
This property contains the type of node for the system. Possible values include 'BROADCAST', 'PEERTOPEER', 'MIXED', 'HYBRID'.
NOTE: This functionality is only available in Windows.
public java.lang.String getOtherAddresses()
This 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()
This property contains 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()
This 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.
NOTE: This functionality is only available in Windows.
public void setPendingRequests(int pendingRequests) throws IPWorksException
This 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.
NOTE: This functionality is only available in Windows.
IPWorksException
public int getRequestId()
This property contains the handle of the last request.
This handle can be later used to identify the request when
the RequestComplete
event is fired.
NOTE: This functionality is only available in Windows.
public boolean isRoutingEnabled()
This property indicates whether routing is enabled on the local computer.
NOTE: This functionality is only available in Windows.
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 retrieve configuration settings
for 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.
The bean accepts one or more of the following configuration settings .
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.
NOTE: This functionality is only available in Windows.
NOTE: This config should only be needed when using the XP operating system.
GetMAC
is called the bean will attempt the address resolution
from the first adapter listed by the system. In multi-homed machines it may be necessary
to specify the IP address of the interface to be used as the source of the address
resolution request. Set this setting to the local IP address of the adapter to be used
when making this request.
IPWorksException
public void DHCPRelease() throws IPWorksException
AdapterIndex
.
This method releases the IP Address of the current adapter specified by 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
.
This method renews the IP Address of the current adapter specified by 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
This method 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
This method resets the bean, stopping all pending requests and refreshing network information. 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
This method 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)
String hostname = IPInfoControl.ResolveAddress("10.0.1.10");
IPWorksException
public java.lang.String resolveName(java.lang.String hostName) throws IPWorksException
This method resolves the host name HostName and sets HostAddress
to the IP Address of the host corresponding to HostName .
Calling this method is equivalent to setting the HostName
property
to HostName .
Example (Resolve a Name)
String ipaddress = IPInfoControl.ResolveName("MyHostName");
IPWorksException
public void addIpinfoEventListener(IpinfoEventListener l) throws java.util.TooManyListenersException
java.util.TooManyListenersException
public void removeIpinfoEventListener(IpinfoEventListener l)
|
IP*Works! V9 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |