Top Description Fields Methods
org.osgi.service.networkadapter

public Interface NetworkAdapter

Imports
java.net.SocketException

NetworkAdapter is an interface that provides information about single network interfaces provided by the execution environment.

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.

When 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.

Author
$Id: 07c677445b11954d7cd3aa30a089c737b3ef1783 $

Field Summary

Modifier and TypeField and Description
public static final byte[]
EMPTY_BYTE_ARRAY

The value byte array of service property, when information is not available.

public static final String
EMPTY_STRING

The value string of service property, when information is not available.

public static final String[]
EMPTY_STRING_ARRAY

The value string array of service property, when information is not available.

public static final String
LAN

The string of network interface type which means the network interface to connect to a local area network.

public static final String
NETWORKADAPTER_DISPLAYNAME

The key string of "networkAdapter.displayName" service property.

public static final String
NETWORKADAPTER_HARDWAREADDRESS

The key string of "networkAdapter.hardwareAddress" service property.

public static final String
NETWORKADAPTER_IS_LOOPBACK

The key string of "networkAdapter.isLoopback" service property.

public static final String
NETWORKADAPTER_IS_POINTTOPOINT

The key string of "networkAdapter.isPointToPoint" service property.

public static final String
NETWORKADAPTER_IS_UP

The key string of "networkAdapter.isUp" service property.

public static final String
NETWORKADAPTER_IS_VIRTUAL

The key string of "networkAdapter.isVirtual" service property.

public static final String
NETWORKADAPTER_NAME

The key string of "networkAdapter.name" service property.

public static final String
NETWORKADAPTER_PARENT

The key string of "networkAdapter.parent" service property.

public static final String
NETWORKADAPTER_SUBINTERFACE

The key string of "networkAdapter.subInterface" service property.

public static final String
NETWORKADAPTER_SUPPORTS_MULTICAST

The key string of "networkAdapter.supportsMulticast" service property.

public static final String
NETWORKADAPTER_TYPE

The key string of "networkAdapter.type" service property.

public static final String
WAN

The string of network interface type which means the network interface to connect to an external network (i.e. Internet).

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Network Interface display name, or null if "networkAdapter.displayname" service property value is empty.
getDisplayName
()

Returns the network interface display name of "networkAdapter.displayname" service property value.

public byte[]

Returns:

Hardware Address, or null if "networkAdapter.hardwareAddress" service property value is empty.
getHardwareAddress
()

Returns the MAC address of "networkAdapter.hardwareAddress" service property value.

public int

Returns:

The value of the MTU for that interface.
getMTU
()

Returns the Maximum Transmission Unit (MTU) of this interface.

public String

Returns:

Network Interface Name, or null if "networkAdapter.name" service property value is empty.
getName
()

Returns the network interface name of "networkAdapter.name" service property value.

public String

Returns:

Network Interface Type, or null if "networkAdapter.type" service property value is empty.
getNetworkAdapterType
()

Returns the network interface type of "networkAdapter.type" service property value.

public boolean

Returns:

true if the interface is a loopback interface.
isLoopback
()

Returns whether a network interface is a loopback interface.

public boolean

Returns:

true if the interface is a point to point interface.
isPointToPoint
()

Returns whether a network interface is a point to point interface.

public boolean

Returns:

true if the interface is up and running.
isUp
()

Returns whether a network interface is up and running.

public boolean

Returns:

true if this interface is a virtual interface.
isVirtual
()

Returns whether this interface is a virtual interface (also called subinterface).

public boolean

Returns:

true if the interface supports Multicasting.
supportsMulticast
()

Returns whether a network interface supports multicasting or not.

Field Detail

EMPTY_BYTE_ARRAYback to summary
public static final byte[] EMPTY_BYTE_ARRAY

The value byte array of service property, when information is not available.

EMPTY_STRINGback to summary
public static final String EMPTY_STRING

The value string of service property, when information is not available.

EMPTY_STRING_ARRAYback to summary
public static final String[] EMPTY_STRING_ARRAY

The value string array of service property, when information is not available.

LANback to summary
public static final String LAN

The string of network interface type which means the network interface to connect to a local area network.

NETWORKADAPTER_DISPLAYNAMEback to summary
public static final String NETWORKADAPTER_DISPLAYNAME

The key string of "networkAdapter.displayName" service property.

Network Interface display name is specified. EMPTY_STRING if no display name is available.

NETWORKADAPTER_HARDWAREADDRESSback to summary
public static final String NETWORKADAPTER_HARDWAREADDRESS

The key string of "networkAdapter.hardwareAddress" service property.

Hardware Address is specified. EMPTY_BYTE_ARRAY if no hardware address is available.

NETWORKADAPTER_IS_LOOPBACKback to summary
public static final String NETWORKADAPTER_IS_LOOPBACK

The key string of "networkAdapter.isLoopback" service property.

The value is true when a network interface is a loopback interface, otherwise it is false.

NETWORKADAPTER_IS_POINTTOPOINTback to summary
public static final String NETWORKADAPTER_IS_POINTTOPOINT

The key string of "networkAdapter.isPointToPoint" service property.

The value is true when a network interface is a point to point interface, otherwise it is false.

NETWORKADAPTER_IS_UPback to summary
public static final String NETWORKADAPTER_IS_UP

The key string of "networkAdapter.isUp" service property.

The value is true when a network interface is up and running, otherwise it is false.

NETWORKADAPTER_IS_VIRTUALback to summary
public static final String NETWORKADAPTER_IS_VIRTUAL

The key string of "networkAdapter.isVirtual" service property.

The value is true when a network interface is a virtual interface, otherwise it is false.

NETWORKADAPTER_NAMEback to summary
public static final String NETWORKADAPTER_NAME

The key string of "networkAdapter.name" service property.

Network Interface Name is specified. EMPTY_STRING if no name is available.

NETWORKADAPTER_PARENTback to summary
public static final String NETWORKADAPTER_PARENT

The key string of "networkAdapter.parent" service property.

Service PID of the NetworkAdapter service which is parent of this NetworkAdapter is specified. EMPTY_STRING if no parent is available.

NETWORKADAPTER_SUBINTERFACEback to summary
public static final String NETWORKADAPTER_SUBINTERFACE

The key string of "networkAdapter.subInterface" service property.

Service PID of the NetworkAdapter service which is subinterface of this NetworkAdapter is specified. EMPTY_STRING_ARRAY if no subinterface is available.

NETWORKADAPTER_SUPPORTS_MULTICASTback to summary
public static final String NETWORKADAPTER_SUPPORTS_MULTICAST

The key string of "networkAdapter.supportsMulticast" service property.

The value is true when a network interface supports multicasting, otherwise it is false.

NETWORKADAPTER_TYPEback to summary
public static final String NETWORKADAPTER_TYPE

The key string of "networkAdapter.type" service property.

Network Interface Type is specified.

WANback to summary
public static final String WAN

The string of network interface type which means the network interface to connect to an external network (i.e. Internet).

Method Detail

getDisplayNameback to summary
public String getDisplayName()

Returns the network interface display name of "networkAdapter.displayname" service property value.

Returns:String

Network Interface display name, or null if "networkAdapter.displayname" service property value is empty.

getHardwareAddressback to summary
public byte[] getHardwareAddress()

Returns the MAC address of "networkAdapter.hardwareAddress" service property value.

Returns:byte[]

Hardware Address, or null if "networkAdapter.hardwareAddress" service property value is empty.

getMTUback to summary
public int getMTU() throws SocketException

Returns the Maximum Transmission Unit (MTU) of this interface.

Returns:int

The value of the MTU for that interface.

Exceptions
SocketException:
If an I/O error occurs.
getNameback to summary
public String getName()

Returns the network interface name of "networkAdapter.name" service property value.

Returns:String

Network Interface Name, or null if "networkAdapter.name" service property value is empty.

getNetworkAdapterTypeback to summary
public String getNetworkAdapterType()

Returns the network interface type of "networkAdapter.type" service property value.

Returns:String

Network Interface Type, or null if "networkAdapter.type" service property value is empty.

isLoopbackback to summary
public boolean isLoopback() throws SocketException

Returns whether a network interface is a loopback interface.

Returns:boolean

true if the interface is a loopback interface.

Exceptions
SocketException:
If an I/O error occurs.
isPointToPointback to summary
public boolean isPointToPoint() throws SocketException

Returns whether a network interface is a point to point interface.

Returns:boolean

true if the interface is a point to point interface.

Exceptions
SocketException:
If an I/O error occurs.
isUpback to summary
public boolean isUp() throws SocketException

Returns whether a network interface is up and running.

Returns:boolean

true if the interface is up and running.

Exceptions
SocketException:
If an I/O error occurs.
isVirtualback to summary
public boolean isVirtual()

Returns whether this interface is a virtual interface (also called subinterface). Virtual interfaces are, on some systems, interfaces created as a child of a physical interface and given different settings (like address or MTU). Usually the name of the interface will the name of the parent followed by a colon (:) and a number identifying the child since there can be several virtual interfaces attached to a single physical interface.

Returns:boolean

true if this interface is a virtual interface.

supportsMulticastback to summary
public boolean supportsMulticast() throws SocketException

Returns whether a network interface supports multicasting or not.

Returns:boolean

true if the interface supports Multicasting.

Exceptions
SocketException:
If an I/O error occurs.