public interface NetworkAddress
NetworkAddress interface provides information of IP addresses available in which execution environment on a Network Interface Information Service bundle is running. IP address information service is set the following information as service property.
NETWORKADAPTER_TYPE
: Network Interface TypeIPADDRESS_VERSION
: IP Address VersionIPADDRESS_SCOPE
: IP Address ScopeIPADDRESS
: IP AddressSUBNETMASK_LENGTH
: Subnet Mask Length(IPv4) or Prefix
Length(IPv6)NETWORKADAPTER_PID
: Service PID of the NetworkAdapter service
to which this service belongsNetworkAddress service is registered with the service registry for each available IP address. When associated IP addresses are deleted, or the network interface to which the IP address is bound becomes unavailable, the NetworkAddress service is unregistered. When the associated IP address changes, NetworkAddress service is updated. The user bundle can detect the change of IP address by monitoring the registration or unregistering, updating of NetworkAddress service. Because IP addresses are bound to the network interface, if any, Service PID of the associated NetworkAdapter service and its network interface type are set to service property. NetworkAdapter service MUST be registered after the all associated NetworkAddress services are registered. On the other hand, when unregistering services, after associated NetworkAdapter service is unregistered, NetworkAddress of all related services are unregistered.
Modifier and Type | Field and Description |
---|---|
static Integer |
EMPTY_INTEGER
The value integer of service property, when information is not available.
|
static String |
IPADDRESS
The key string of "ipAddress" service property.
|
static String |
IPADDRESS_SCOPE
The key string of "ipAddress.scope" service property.
|
static String |
IPADDRESS_SCOPE_GLOBAL
The string of IP address scope which means global address.
|
static String |
IPADDRESS_SCOPE_HOST
The string of IP address scope which means "This host on this network".
|
static String |
IPADDRESS_SCOPE_LINKED_SCOPED_UNICAST
The string of IP address scope which means "Linked-Scoped Unicast".
|
static String |
IPADDRESS_SCOPE_LINKLOCAL
The string of IP address scope which means "Link Local".
|
static String |
IPADDRESS_SCOPE_LOOPBACK
The string of IP address scope which means "Loopback".
|
static String |
IPADDRESS_SCOPE_PRIVATE_USE
The string of IP address scope which means "Private-Use Networks".
|
static String |
IPADDRESS_SCOPE_SHARED
The string of IP address scope which means "Shared Address Space".
|
static String |
IPADDRESS_SCOPE_UNIQUE_LOCAL
The string of IP address scope which means "Unique-Local".
|
static String |
IPADDRESS_SCOPE_UNSPECIFIED
The string of IP address scope which means "Unspecified Address".
|
static String |
IPADDRESS_VERSION
The key string of "ipAddress.version" service property.
|
static String |
IPADDRESS_VERSION_4
The string of IP address version which means IP address version 4.
|
static String |
IPADDRESS_VERSION_6
The string of IP address version which means IP address version 6.
|
static String |
NETWORKADAPTER_PID
The key string of "networkAdapter.pid" service property.
|
static String |
NETWORKADAPTER_TYPE
The key string of "networkAdapter.type" service property.
|
static String |
SUBNETMASK_LENGTH
The key string of "subnetmask.length" service property.
|
Modifier and Type | Method and Description |
---|---|
InetAddress |
getInetAddress()
Returns the InetAddress object of this IP address.
|
String |
getIpAddress()
Returns the IP address of "ipaddress" service property value.
|
String |
getIpAddressScope()
Returns the IP address scope of "ipaddress.scope" service property value.
|
String |
getIpAddressVersion()
Returns the IP address version of "ipaddress.version" service property
value.
|
String |
getNetworkAdapterPid()
Returns the "networkadapter.pid" service property value.
|
String |
getNetworkAdapterType()
Returns the network interface type of "networkAdapter.type" service
property value.
|
int |
getSubnetMaskLength()
Returns the "subnetmask.length" service property value.
|
static final Integer EMPTY_INTEGER
static final String NETWORKADAPTER_TYPE
static final String IPADDRESS_VERSION
static final String IPADDRESS_SCOPE
static final String IPADDRESS
static final String SUBNETMASK_LENGTH
Subnet Mask Length(IPv4) or Prefix Length(IPv6) is specified.
EMPTY_INTEGER
if no length is available.
static final String NETWORKADAPTER_PID
Service PID of the interface information service to which it belongs is specified.
static final String IPADDRESS_VERSION_4
static final String IPADDRESS_VERSION_6
static final String IPADDRESS_SCOPE_GLOBAL
The global address is defined as the address other than the address defined in the RFC6890.
static final String IPADDRESS_SCOPE_PRIVATE_USE
See RFC6890 for the definition of "Private-Use Networks".
static final String IPADDRESS_SCOPE_LOOPBACK
See RFC6890 for the definition of "Loopback".
static final String IPADDRESS_SCOPE_LINKLOCAL
See RFC6890 for the definition of "Link Local".
static final String IPADDRESS_SCOPE_UNIQUE_LOCAL
See RFC6890 for the definition of "Unique-Local".
static final String IPADDRESS_SCOPE_UNSPECIFIED
See RFC6890 for the definition of "Unspecified Address".
static final String IPADDRESS_SCOPE_HOST
See RFC6890 for the definition of "This host on this network".
static final String IPADDRESS_SCOPE_SHARED
See RFC6890 for the definition of "Shared Address Space".
static final String IPADDRESS_SCOPE_LINKED_SCOPED_UNICAST
See RFC6890 for the definition of "Linked-Scoped Unicast".
String getNetworkAdapterType()
String getIpAddressVersion()
String getIpAddressScope()
String getIpAddress()
InetAddress getInetAddress()
Returned object is created from "ipaddress" service property value.
int getSubnetMaskLength()
String getNetworkAdapterPid()
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0