Interface NetworkAddress
-
public interface NetworkAddress
This interface represents an IP address information.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 belongs
NetworkAddress 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.
- Author:
- $Id: 8a0613ef45629927ec3b0da834273511e05521da $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Integer
EMPTY_INTEGER
The value integer of service property, when information is not available.static java.lang.String
IPADDRESS
The key string of "ipAddress" service property.static java.lang.String
IPADDRESS_SCOPE
The key string of "ipAddress.scope" service property.static java.lang.String
IPADDRESS_SCOPE_GLOBAL
The string of IP address scope which means global address.static java.lang.String
IPADDRESS_SCOPE_HOST
The string of IP address scope which means "This host on this network".static java.lang.String
IPADDRESS_SCOPE_LINKED_SCOPED_UNICAST
The string of IP address scope which means "Linked-Scoped Unicast".static java.lang.String
IPADDRESS_SCOPE_LINKLOCAL
The string of IP address scope which means "Link Local".static java.lang.String
IPADDRESS_SCOPE_LOOPBACK
The string of IP address scope which means "Loopback".static java.lang.String
IPADDRESS_SCOPE_PRIVATE_USE
The string of IP address scope which means "Private-Use Networks".static java.lang.String
IPADDRESS_SCOPE_SHARED
The string of IP address scope which means "Shared Address Space".static java.lang.String
IPADDRESS_SCOPE_UNIQUE_LOCAL
The string of IP address scope which means "Unique-Local".static java.lang.String
IPADDRESS_SCOPE_UNSPECIFIED
The string of IP address scope which means "Unspecified Address".static java.lang.String
IPADDRESS_VERSION
The key string of "ipAddress.version" service property.static java.lang.String
IPADDRESS_VERSION_4
The string of IP address version which means IP address version 4.static java.lang.String
IPADDRESS_VERSION_6
The string of IP address version which means IP address version 6.static java.lang.String
NETWORKADAPTER_PID
The key string of "networkAdapter.pid" service property.static java.lang.String
NETWORKADAPTER_TYPE
The key string of "networkAdapter.type" service property.static java.lang.String
SUBNETMASK_LENGTH
The key string of "subnetmask.length" service property.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.net.InetAddress
getInetAddress()
Returns the InetAddress object of this IP address.java.lang.String
getIpAddress()
Returns the IP address of "ipaddress" service property value.java.lang.String
getIpAddressScope()
Returns the IP address scope of "ipaddress.scope" service property value.java.lang.String
getIpAddressVersion()
Returns the IP address version of "ipaddress.version" service property value.java.lang.String
getNetworkAdapterPid()
Returns the "networkadapter.pid" service property value.java.lang.String
getNetworkAdapterType()
Returns the network interface type of "networkAdapter.type" service property value.int
getSubnetMaskLength()
Returns the "subnetmask.length" service property value.
-
-
-
Field Detail
-
EMPTY_INTEGER
static final java.lang.Integer EMPTY_INTEGER
The value integer of service property, when information is not available.
-
NETWORKADAPTER_TYPE
static final java.lang.String NETWORKADAPTER_TYPE
The key string of "networkAdapter.type" service property. Network Interface Type is specified.- See Also:
- Constant Field Values
-
IPADDRESS_VERSION
static final java.lang.String IPADDRESS_VERSION
The key string of "ipAddress.version" service property. IP Address version is specified.- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE
static final java.lang.String IPADDRESS_SCOPE
The key string of "ipAddress.scope" service property. IP Address scope is specified.- See Also:
- Constant Field Values
-
IPADDRESS
static final java.lang.String IPADDRESS
The key string of "ipAddress" service property. IP Address is specified.- See Also:
- Constant Field Values
-
SUBNETMASK_LENGTH
static final java.lang.String SUBNETMASK_LENGTH
The key string of "subnetmask.length" service property.Subnet Mask Length(IPv4) or Prefix Length(IPv6) is specified.
EMPTY_INTEGER
if no length is available.- See Also:
- Constant Field Values
-
NETWORKADAPTER_PID
static final java.lang.String NETWORKADAPTER_PID
The key string of "networkAdapter.pid" service property.Service PID of the interface information service to which it belongs is specified.
- See Also:
- Constant Field Values
-
IPADDRESS_VERSION_4
static final java.lang.String IPADDRESS_VERSION_4
The string of IP address version which means IP address version 4.- See Also:
- Constant Field Values
-
IPADDRESS_VERSION_6
static final java.lang.String IPADDRESS_VERSION_6
The string of IP address version which means IP address version 6.- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_GLOBAL
static final java.lang.String IPADDRESS_SCOPE_GLOBAL
The string of IP address scope which means global address.The global address is defined as the address other than the address defined in the RFC6890.
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_PRIVATE_USE
static final java.lang.String IPADDRESS_SCOPE_PRIVATE_USE
The string of IP address scope which means "Private-Use Networks".See RFC6890 for the definition of "Private-Use Networks".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_LOOPBACK
static final java.lang.String IPADDRESS_SCOPE_LOOPBACK
The string of IP address scope which means "Loopback".See RFC6890 for the definition of "Loopback".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_LINKLOCAL
static final java.lang.String IPADDRESS_SCOPE_LINKLOCAL
The string of IP address scope which means "Link Local".See RFC6890 for the definition of "Link Local".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_UNIQUE_LOCAL
static final java.lang.String IPADDRESS_SCOPE_UNIQUE_LOCAL
The string of IP address scope which means "Unique-Local".See RFC6890 for the definition of "Unique-Local".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_UNSPECIFIED
static final java.lang.String IPADDRESS_SCOPE_UNSPECIFIED
The string of IP address scope which means "Unspecified Address".See RFC6890 for the definition of "Unspecified Address".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_HOST
static final java.lang.String IPADDRESS_SCOPE_HOST
The string of IP address scope which means "This host on this network".See RFC6890 for the definition of "This host on this network".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_SHARED
static final java.lang.String IPADDRESS_SCOPE_SHARED
The string of IP address scope which means "Shared Address Space".See RFC6890 for the definition of "Shared Address Space".
- See Also:
- Constant Field Values
-
IPADDRESS_SCOPE_LINKED_SCOPED_UNICAST
static final java.lang.String IPADDRESS_SCOPE_LINKED_SCOPED_UNICAST
The string of IP address scope which means "Linked-Scoped Unicast".See RFC6890 for the definition of "Linked-Scoped Unicast".
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNetworkAdapterType
java.lang.String getNetworkAdapterType()
Returns the network interface type of "networkAdapter.type" service property value.- Returns:
- Network Interface Type, or null if "networkAdapter.type" service property value is empty.
-
getIpAddressVersion
java.lang.String getIpAddressVersion()
Returns the IP address version of "ipaddress.version" service property value.- Returns:
- IP Address Version, or null if "ipaddress.version" service property value is empty.
-
getIpAddressScope
java.lang.String getIpAddressScope()
Returns the IP address scope of "ipaddress.scope" service property value.- Returns:
- IP Address Scope, or null if "ipaddress.scope" service property value is empty.
-
getIpAddress
java.lang.String getIpAddress()
Returns the IP address of "ipaddress" service property value.- Returns:
- IP Address string, or null if "ipaddress" service property value is empty.
-
getInetAddress
java.net.InetAddress getInetAddress()
Returns the InetAddress object of this IP address.Returned object is created from "ipaddress" service property value.
- Returns:
- InetAddress, or null if "ipaddress" service property value is empty.
-
getSubnetMaskLength
int getSubnetMaskLength()
Returns the "subnetmask.length" service property value.- Returns:
- Subnet Mask Length(IPv4) or Prefix Length(IPv6), or -1 if "subnetmask.length" service property value is empty.
-
getNetworkAdapterPid
java.lang.String getNetworkAdapterPid()
Returns the "networkadapter.pid" service property value.- Returns:
- Service ID of the interface information service to which it belongs, or null if "networkadapter.pid" service property value is empty.
-
-