eWON JTK

com.ewon.ewonitf
Class NetManager

java.lang.Object
  extended by com.ewon.ewonitf.NetManager

public class NetManager
extends Object

This class provide access to the eWON netwrok functions like interface IP addresses, status, activation, etc.


Field Summary
static int LAN_INTERFACE_NDX
          Paramter used in readInterfaceInfo(int) to select LAN interface.
static int T2M_CNX_AUTO
          Automatic detection of the connection to Talk2M, connection type defined in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how it will force the connection to Talk2M.
static int T2M_CNX_FLAG_DONT_TOUCH_VPN_KEY_CONFIG
          This flag can be added to one of T2M_CNX_AUTO,T2M_CNX_UDP,T2M_CNX_TCP,T2M_CNX_TCP_PROXY in t2mCfgCommand(String , String , String , int ) It will prevent the Talk2M VPN keys to be retrieved from the Talk2M server and will leave the existing keys unchanged.
static int T2M_CNX_FLAG_DONT_TOUCH_VPN_SERVER_CONFIG
          This flag can be added to one of T2M_CNX_AUTO,T2M_CNX_UDP,T2M_CNX_TCP,T2M_CNX_TCP_PROXY in t2mCfgCommand(String , String , String , int ) It will prevent the main access server address to be modified during the wizard.
static int T2M_CNX_TCP
          Force TCP connection to Talk2M, connection type define in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how you will force the connection to Talk2M.
static int T2M_CNX_TCP_PROXY
          Force Proxied TCP connection to Talk2M, connection type define in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how you will force the connection to Talk2M.
static int T2M_CNX_UDP
          Force UDP connection to Talk2M, connection type defined in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how it will force the connection to Talk2M.
static int WAN_INTERFACE_NDX
          Paramter used in readInterfaceInfo(int) to select WAN interface.
 
Constructor Summary
NetManager()
          Creates a new instance of NetManager
 
Method Summary
static void closePppConnection()
          Close any currently opened PPP connection.
If connection is not open then the function does nothing.
static boolean getEthernetSwitchPortLink(int PortNum)
          Return The status of the given switch port.
static String getPppIp()
          Read the current PPP IP address.
static boolean getT2mCfgInProgress()
          Return true if the Talk2M configuration is currently in progress.
static String getVpnIp()
          Read the current eWON VPN IP address.
static String getWanIp()
          Read the current WAN IP address.
static InterfaceInfo readInterfaceInfo(int IfNum)
          Return an object containing information about the interface status
static void setEthernetSwitchPortState(int PortNum, boolean State)
          Enable or disable the given switch port.
static void setTransparentForwardingDest(String Address)
          Configure the destination address for transparent forwarding.
static void t2mCfgCommand(String ActivationKey)
          Triggers a Talk2M configuration by providing ActivationKey.
static void t2mCfgCommand(String ActivationKey, int CnxType)
          Triggers a Talk2M configuration by providing ActivationKey.
static void t2mCfgCommand(String eWonName, String UserName, String UserPassword)
          Triggers a Talk2M configuration by providing ActivationKey
static void t2mCfgCommand(String eWonName, String UserName, String UserPassword, int CnxType)
          Triggers a Talk2M configuration by providing ActivationKey
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAN_INTERFACE_NDX

public static final int LAN_INTERFACE_NDX
Paramter used in readInterfaceInfo(int) to select LAN interface.

See Also:
Constant Field Values

WAN_INTERFACE_NDX

public static final int WAN_INTERFACE_NDX
Paramter used in readInterfaceInfo(int) to select WAN interface.

See Also:
Constant Field Values

T2M_CNX_AUTO

public static final int T2M_CNX_AUTO
Automatic detection of the connection to Talk2M, connection type defined in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how it will force the connection to Talk2M.

See Also:
Constant Field Values

T2M_CNX_UDP

public static final int T2M_CNX_UDP
Force UDP connection to Talk2M, connection type defined in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how it will force the connection to Talk2M.

See Also:
Constant Field Values

T2M_CNX_TCP

public static final int T2M_CNX_TCP
Force TCP connection to Talk2M, connection type define in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how you will force the connection to Talk2M.

See Also:
Constant Field Values

T2M_CNX_TCP_PROXY

public static final int T2M_CNX_TCP_PROXY
Force Proxied TCP connection to Talk2M, connection type define in t2mCfgCommand(String , String , String , int ) to select how the wizard will try to detect or how you will force the connection to Talk2M.

See Also:
Constant Field Values

T2M_CNX_FLAG_DONT_TOUCH_VPN_SERVER_CONFIG

public static final int T2M_CNX_FLAG_DONT_TOUCH_VPN_SERVER_CONFIG
This flag can be added to one of T2M_CNX_AUTO,T2M_CNX_UDP,T2M_CNX_TCP,T2M_CNX_TCP_PROXY in t2mCfgCommand(String , String , String , int ) It will prevent the main access server address to be modified during the wizard.

See Also:
Constant Field Values

T2M_CNX_FLAG_DONT_TOUCH_VPN_KEY_CONFIG

public static final int T2M_CNX_FLAG_DONT_TOUCH_VPN_KEY_CONFIG
This flag can be added to one of T2M_CNX_AUTO,T2M_CNX_UDP,T2M_CNX_TCP,T2M_CNX_TCP_PROXY in t2mCfgCommand(String , String , String , int ) It will prevent the Talk2M VPN keys to be retrieved from the Talk2M server and will leave the existing keys unchanged.

See Also:
Constant Field Values
Constructor Detail

NetManager

public NetManager()
Creates a new instance of NetManager

Method Detail

getVpnIp

public static String getVpnIp()
Read the current eWON VPN IP address. If VPN is not currently connected, the value returned is "0.0.0.0".

Returns:
Current VPN IP address as "dotted decimal" notation.

getWanIp

public static String getWanIp()
Read the current WAN IP address. If WAN is not currently connected, the value returned is "0.0.0.0".

Returns:
Current WAN IP address as "dotted decimal" notation.

getPppIp

public static String getPppIp()
Read the current PPP IP address. If PPP is not currently connected, the value returned is "0.0.0.0".

Returns:
Current PPP IP address as "dotted decimal" notation.

closePppConnection

public static void closePppConnection()
Close any currently opened PPP connection.
If connection is not open then the function does nothing.


setTransparentForwardingDest

public static void setTransparentForwardingDest(String Address)
                                         throws EWException
Configure the destination address for transparent forwarding.

Throws:
EWExeption - in case the operation fails.
EWException

t2mCfgCommand

public static void t2mCfgCommand(String ActivationKey)
                          throws EWException
Triggers a Talk2M configuration by providing ActivationKey.

Parameters:
ActivationKey - is provided by the eCatcher client or Talk2M Access Server Webservices
Throws:
EWExeption - in case the operation fails. The operation will fail if it is already in progress.
EWException

t2mCfgCommand

public static void t2mCfgCommand(String eWonName,
                                 String UserName,
                                 String UserPassword)
                          throws EWException
Triggers a Talk2M configuration by providing ActivationKey

Parameters:
eWonName - The eWON name (as defined in Talk2M, not the eWON name fromeWON configuration)
UserName - The Talk2M user name with required access for eWON configuration.
UserPassword - The given user's password.
Throws:
EWExeption - in case the operation fails. The operation will fail if it is already in progress.
EWException

t2mCfgCommand

public static void t2mCfgCommand(String ActivationKey,
                                 int CnxType)
                          throws EWException
Triggers a Talk2M configuration by providing ActivationKey.

Parameters:
ActivationKey - is provided by the eCatcher client or Talk2M Access Server Webservices
CnxType - Defines the connection type to connect to Talk2M. One of T2M_CNX_AUTO, T2M_CNX_UDP, T2M_CNX_TCP, T2M_CNX_TCP_PROXY
Throws:
EWExeption - in case the operation fails. The operation will fail if it is already in progress.
EWException

t2mCfgCommand

public static void t2mCfgCommand(String eWonName,
                                 String UserName,
                                 String UserPassword,
                                 int CnxType)
                          throws EWException
Triggers a Talk2M configuration by providing ActivationKey

Parameters:
eWonName - The eWON name (as defined in Talk2M, not the eWON name fromeWON configuration)
UserName - The Talk2M user name with required access for eWON configuration.
UserPassword - The given user's password.
CnxType - Defines the connection type to connect to Talk2M. One of T2M_CNX_AUTO, T2M_CNX_UDP, T2M_CNX_TCP, T2M_CNX_TCP_PROXY
Throws:
EWExeption - in case the operation fails. The operation will fail if it is already in progress.
EWException

getT2mCfgInProgress

public static boolean getT2mCfgInProgress()
Return true if the Talk2M configuration is currently in progress.


readInterfaceInfo

public static InterfaceInfo readInterfaceInfo(int IfNum)
                                       throws EWException
Return an object containing information about the interface status

Parameters:
IfNum - one of LAN_INTERFACE_NDX or WAN_INTERFACE_NDX
Throws:
EWExeption - in case the operation fails.
EWException

getEthernetSwitchPortLink

public static boolean getEthernetSwitchPortLink(int PortNum)
                                         throws EWException
Return The status of the given switch port. true if link is good, false is link is disconnected.

Parameters:
PortNum - Is the port number between 0 and 4
Throws:
EWExeption - in case the operation fails.
EWException

setEthernetSwitchPortState

public static void setEthernetSwitchPortState(int PortNum,
                                              boolean State)
                                       throws EWException
Enable or disable the given switch port.

Parameters:
PortNum - Is the port number between 0 and 4 (0 is the eWON connected internally)
State - true if the port must be enabled, false otherwise.
Throws:
EWExeption - in case the operation fails.
EWException

eWON JTK

www.eWON.biz: Your Eyes Watching Over Net