public class NetworkAddresses
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NetworkAddresses.InetAddressType |
class |
NetworkAddresses.NetworkAddress
The sub class NetworkAddress describes the list elements that are used within
the super class and their listing elements as listed below.
|
Constructor and Description |
---|
NetworkAddresses()
Instantiates a new local network interfaces.
|
Modifier and Type | Method and Description |
---|---|
java.util.Vector<NetworkAddresses.NetworkAddress> |
getInet4Addresses()
Returns the
Inet4Address addresses. |
java.util.Vector<NetworkAddresses.NetworkAddress> |
getInet4AddressesLoopBack()
Returns the loopback
Inet4Address addresses. |
java.util.Vector<NetworkAddresses.NetworkAddress> |
getInet6Addresses()
Returns the
Inet6Address addresses. |
java.util.Vector<NetworkAddresses.NetworkAddress> |
getInet6AddressesLoopBack()
Returns the loopback
Inet6Address addresses. |
javax.swing.JPopupMenu |
getJPopupMenu4NetworkAddresses(java.awt.event.ActionListener actListener)
Gets the JPopupMenu for the available network addresses.
|
java.util.Vector<NetworkAddresses.NetworkAddress> |
getNetworkAddressVector()
Gets the network address vector.
|
java.util.Vector<NetworkAddresses.NetworkAddress> |
getNetworkAddressVectorLoopBack()
Gets the network address vector.
|
java.net.InetAddress |
getPreferredInetAddress()
Returns the 'preferred'
InetAddress . |
boolean |
isAvailableIP(java.lang.String ipAddress)
Checks if the specified IP address is locally available.
|
public NetworkAddresses()
public java.util.Vector<NetworkAddresses.NetworkAddress> getNetworkAddressVector()
public java.util.Vector<NetworkAddresses.NetworkAddress> getNetworkAddressVectorLoopBack()
public boolean isAvailableIP(java.lang.String ipAddress)
ipAddress
- the IP address to checkpublic javax.swing.JPopupMenu getJPopupMenu4NetworkAddresses(java.awt.event.ActionListener actListener)
actListener
- the act listenerNetworkAddresses
NetworkAddresses
public java.util.Vector<NetworkAddresses.NetworkAddress> getInet4Addresses()
Inet4Address
addresses.public java.util.Vector<NetworkAddresses.NetworkAddress> getInet4AddressesLoopBack()
Inet4Address
addresses.public java.util.Vector<NetworkAddresses.NetworkAddress> getInet6Addresses()
Inet6Address
addresses.public java.util.Vector<NetworkAddresses.NetworkAddress> getInet6AddressesLoopBack()
Inet6Address
addresses.public java.net.InetAddress getPreferredInetAddress()
InetAddress
. That means that out of the currently
available IP-addresses, the IP-address will be selected and returned that can be used
for network communication (e.g. for the MTP of JADE).
Here the selection algorithm first tries to select out of the IP4 addresses and tries
to identify the network card connection. If not available, a WiFi connection will be used.
If no IP4 address is available, the same will be tried with the IP6 network connections.