public interface NetworkAdapter
If multiple network interfaces are present, NetworkAdapter Services that correspond to each network interface must be registered. Network interface information service is set the following information as service property.
NETWORKADAPTER_TYPE
: Network Interface TypeNETWORKADAPTER_DISPLAYNAME
: Network Interface Display NameNETWORKADAPTER_NAME
: Network Interface NameNETWORKADAPTER_HARDWAREADDRESS
: Hardware AddressNETWORKADAPTER_IS_UP
: Running status of Network InterfaceNETWORKADAPTER_IS_LOOPBACK
: To check loopback interfaceNETWORKADAPTER_IS_POINTTOPOINT
: To check point to point
interfaceNETWORKADAPTER_IS_VIRTUAL
: To check virtual interfaceNETWORKADAPTER_SUPPORTS_MULTICAST
: To check supports
multicastingNETWORKADAPTER_PARENT
: The PID of parent Network InterfaceNETWORKADAPTER_SUBINTERFACE
: The PID of sub Network InterfaceWhen a network interface becomes available, NetworkAdapter service associated with the network interface is registered with the service registry. If the network interface becomes unavailable, the corresponding NetworkAdapter service is unregistered.
When the attribute values of the network interface are set to the service property changes, NetworkAdapter service is updated. NetworkAdapter interface provides a method corresponding to java.net.NetworkInterface in order to provide information on the associated network interface. However, this interface method does not support the Static method. In addition, because NetworkInterface object or InetAddress object is registered in the service registry as NetworkAdapter and NetworkAddress, the NetworkAdapter interface does not provide a method to get those objects. NetworkAdapter provides a method to retrieve the value of an attribute of a network interface.
Modifier and Type | Field and Description |
---|---|
static byte[] |
EMPTY_BYTE_ARRAY
The value byte array of service property, when information is not
available.
|
static String |
EMPTY_STRING
The value string of service property, when information is not available.
|
static String[] |
EMPTY_STRING_ARRAY
The value string array of service property, when information is not
available.
|
static String |
LAN
The string of network interface type which means the network interface to
connect to a local area network.
|
static String |
NETWORKADAPTER_DISPLAYNAME
The key string of "networkAdapter.displayName" service property.
|
static String |
NETWORKADAPTER_HARDWAREADDRESS
The key string of "networkAdapter.hardwareAddress" service property.
|
static String |
NETWORKADAPTER_IS_LOOPBACK
The key string of "networkAdapter.isLoopback" service property.
|
static String |
NETWORKADAPTER_IS_POINTTOPOINT
The key string of "networkAdapter.isPointToPoint" service property.
|
static String |
NETWORKADAPTER_IS_UP
The key string of "networkAdapter.isUp" service property.
|
static String |
NETWORKADAPTER_IS_VIRTUAL
The key string of "networkAdapter.isVirtual" service property.
|
static String |
NETWORKADAPTER_NAME
The key string of "networkAdapter.name" service property.
|
static String |
NETWORKADAPTER_PARENT
The key string of "networkAdapter.parent" service property.
|
static String |
NETWORKADAPTER_SUBINTERFACE
The key string of "networkAdapter.subInterface" service property.
|
static String |
NETWORKADAPTER_SUPPORTS_MULTICAST
The key string of "networkAdapter.supportsMulticast" service property.
|
static String |
NETWORKADAPTER_TYPE
The key string of "networkAdapter.type" service property.
|
static String |
WAN
The string of network interface type which means the network interface to
connect to an external network (i.e.
|
Modifier and Type | Method and Description |
---|---|
String |
getDisplayName()
Returns the network interface display name of
"networkAdapter.displayname" service property value.
|
byte[] |
getHardwareAddress()
Returns the MAC address of "networkAdapter.hardwareAddress" service
property value.
|
int |
getMTU()
Returns the Maximum Transmission Unit (MTU) of this interface.
|
String |
getName()
Returns the network interface name of "networkAdapter.name" service
property value.
|
String |
getNetworkAdapterType()
Returns the network interface type of "networkAdapter.type" service
property value.
|
boolean |
isLoopback()
Returns whether a network interface is a loopback interface.
|
boolean |
isPointToPoint()
Returns whether a network interface is a point to point interface.
|
boolean |
isUp()
Returns whether a network interface is up and running.
|
boolean |
isVirtual()
Returns whether this interface is a virtual interface (also called
subinterface).
|
boolean |
supportsMulticast()
Returns whether a network interface supports multicasting or not.
|
static final String EMPTY_STRING
static final byte[] EMPTY_BYTE_ARRAY
static final String[] EMPTY_STRING_ARRAY
static final String NETWORKADAPTER_TYPE
Network Interface Type is specified.
static final String NETWORKADAPTER_DISPLAYNAME
Network Interface display name is specified. EMPTY_STRING
if no
display name is available.
static final String NETWORKADAPTER_NAME
Network Interface Name is specified. EMPTY_STRING
if no name is
available.
static final String NETWORKADAPTER_HARDWAREADDRESS
Hardware Address is specified. EMPTY_BYTE_ARRAY
if no hardware
address is available.
static final String NETWORKADAPTER_IS_UP
The value is true when a network interface is up and running, otherwise it is false.
static final String NETWORKADAPTER_IS_LOOPBACK
The value is true when a network interface is a loopback interface, otherwise it is false.
static final String NETWORKADAPTER_IS_POINTTOPOINT
The value is true when a network interface is a point to point interface, otherwise it is false.
static final String NETWORKADAPTER_IS_VIRTUAL
The value is true when a network interface is a virtual interface, otherwise it is false.
static final String NETWORKADAPTER_SUPPORTS_MULTICAST
The value is true when a network interface supports multicasting, otherwise it is false.
static final String NETWORKADAPTER_PARENT
Service PID of the NetworkAdapter service which is parent of this
NetworkAdapter is specified. EMPTY_STRING
if no parent is
available.
static final String NETWORKADAPTER_SUBINTERFACE
Service PID of the NetworkAdapter service which is subinterface of this
NetworkAdapter is specified. EMPTY_STRING_ARRAY
if no
subinterface is available.
static final String WAN
static final String LAN
String getNetworkAdapterType()
String getDisplayName()
String getName()
byte[] getHardwareAddress()
int getMTU() throws SocketException
SocketException
- If an I/O error occurs.boolean isLoopback() throws SocketException
SocketException
- If an I/O error occurs.boolean isPointToPoint() throws SocketException
SocketException
- If an I/O error occurs.boolean isUp() throws SocketException
SocketException
- If an I/O error occurs.boolean isVirtual()
boolean supportsMulticast() throws SocketException
SocketException
- If an I/O error occurs.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0