public class ConnectorNetworkManager extends java.lang.Object implements INetworkImplementation
DEFAULT_LINK_SPEED, DEFAULT_PHONE_NUMBER, ETH_TYPE, MOBILE_TYPE, UNKNOWN_TYPE, WIFI_TYPE| Constructor and Description |
|---|
ConnectorNetworkManager(INetworkImplementation networkImpl)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getActiveNetwork()
Retrieves the active network connection identifier.
|
java.lang.String |
getLocalIpAddress()
Retrieves the active connection IP address.
|
byte[] |
getPPPLinkSpeed()
Retrieves the PPP link speed in bits per second.
|
byte[] |
getPPPPhoneNumber()
Retrieves the phone number that was dialed for the PPP connection.
|
MacAddress |
getPrimaryMac()
Retrieves the primary MAC address of the device depending on the
active connection type.
|
ISocket |
getSocket(java.lang.String address,
int port)
Returns a socket from the given address and port.
|
ISocket |
getSSLSocket(java.lang.String address,
int port)
Returns a secure socket from the given address and port.
|
boolean |
internetAvailable()
Checks whether there is Internet connectivity or not.
|
public ConnectorNetworkManager(INetworkImplementation networkImpl)
networkImpl - Class implementing INetworkImplementation interface in
charge of managing all network methods that are
platform dependent.public int getActiveNetwork()
INetworkImplementationgetActiveNetwork in interface INetworkImplementationpublic java.lang.String getLocalIpAddress()
INetworkImplementationgetLocalIpAddress in interface INetworkImplementationpublic byte[] getPPPLinkSpeed()
INetworkImplementationThis only is needed when the connection type is PPP
(see MOBILE_TYPE).
getPPPLinkSpeed in interface INetworkImplementationINetworkImplementation.MOBILE_TYPEpublic byte[] getPPPPhoneNumber()
INetworkImplementationThis only is needed when the connection type is PPP
(see MOBILE_TYPE).
getPPPPhoneNumber in interface INetworkImplementationINetworkImplementation.MOBILE_TYPEpublic MacAddress getPrimaryMac()
INetworkImplementationgetPrimaryMac in interface INetworkImplementationpublic ISocket getSocket(java.lang.String address, int port) throws java.lang.Exception
INetworkImplementationgetSocket in interface INetworkImplementationaddress - The address of the host to connect.port - The port of the connection.java.lang.Exception - if any error occurs while getting a standard socket to
the given address and port.public ISocket getSSLSocket(java.lang.String address, int port) throws java.lang.Exception
INetworkImplementationgetSSLSocket in interface INetworkImplementationaddress - The address of the host to connect.port - The port of the connection.java.lang.Exception - if any error occurs while getting a SSL socket to the
given address and port.public boolean internetAvailable()
INetworkImplementationinternetAvailable in interface INetworkImplementationtrue if there is Internet connectivity, false
otherwise.© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.