com.eurotech.framework.net.modem
Class ModemConfig

java.lang.Object
  extended by com.eurotech.framework.net.modem.ModemConfig
All Implemented Interfaces:
NetConfig

public class ModemConfig
extends Object
implements NetConfig

Modem configuration representation


Nested Class Summary
static class ModemConfig.AuthType
           
static class ModemConfig.PdpType
          Configuration for a cellular modem.
 
Constructor Summary
ModemConfig()
          Empty constructor
ModemConfig(int profileID, ModemConfig.PdpType pdpType, String apn, IPAddress ipAddress, int dataCompression, int headerCompresion)
          PDP config constructor
 
Method Summary
 boolean equals(Object obj)
           
 String getApn()
          Reports access point name.
 ModemConfig.AuthType getAuthType()
          Reports authentication type.
 int getDataCompression()
          Reports a value of numeric parameter that supports PDP data compression.
 String getDialString()
          Gets the dial string.
 int getHeaderCompression()
          Reports a value of numeric parameter that supports PDP header compression.
 IPAddress getIpAddress()
          Reports PDP IP address.
 int getLcpEchoFailure()
          Reports number of failed LCP echo requests
 int getLcpEchoInterval()
          Reports LCP echo interval
 String getPassword()
          Reports password.
 ModemConfig.PdpType getPdpType()
          Reports PDP type.
 int getPppNumber()
          Reports PPP number (i.e.
 int getProfileID()
          Reports PDP profile ID.
 String getUsername()
          Reports user name.
 int hashCode()
           
 boolean isDataCompression()
          Reports if PDP data compression is enabled.
 boolean isEnabled()
          Reports whether it is enabled.
 boolean isHeaderCompression()
          Reports if PDP header compression is enabled.
 boolean isValid()
          Checks whether or not this configuration is valid.
 void setApn(String apn)
          Sets access point name.
 void setAuthType(ModemConfig.AuthType authType)
          Sets authentication type.
 void setDataCompression(int dataCompression)
          Sets a value of numeric parameter that supports PDP data compression.
 void setDialString(String dialString)
          Sets the dial string.
 void setEnabled(boolean enabled)
          Sets the enabled setting.
 void setHeaderCompression(int headerCompression)
          Sets a value of numeric parameter that supports PDP header compression.
 void setIpAddress(IPAddress address)
          Sets PDP IP address.
 void setLcpEchoFailure(int lcpEchoFailure)
          Sets number of failed LCP echo requests (unacknowledged LCP echo requests to be sent for pppd to presume the peer to be dead)
 void setLcpEchoInterval(int lcpEchoInterval)
          Sets LCP echo interval
 void setPassword(String password)
          Sets password.
 void setPdpType(ModemConfig.PdpType pdpType)
          Sets PDP type.
 void setPppNumber(int pppNumber)
          Sets PPP number (i.e.
 void setProfileID(int id)
          Sets PDP profile ID.
 void setUsername(String username)
          Sets user name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModemConfig

public ModemConfig()
Empty constructor


ModemConfig

public ModemConfig(int profileID,
                   ModemConfig.PdpType pdpType,
                   String apn,
                   IPAddress ipAddress,
                   int dataCompression,
                   int headerCompresion)
PDP config constructor

Parameters:
apn - - access point name as String
ipAddress - - IP address as String
profileID - - PDP profile ID as int
pdpType - - PDP type as PDP_Type
dataCompression - - PDP data compression as int
headerCompresion - - PDP header compression as int
Method Detail

isEnabled

public boolean isEnabled()
Reports whether it is enabled.

Returns:
is enabled as boolean

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled setting.

Parameters:
enabled - - enabled status as boolean

getDialString

public String getDialString()
Gets the dial string.

Returns:
dial string as String

setDialString

public void setDialString(String dialString)
Sets the dial string.

Parameters:
dialString - - dial string as String

getAuthType

public ModemConfig.AuthType getAuthType()
Reports authentication type.

Returns:
authentication type as ModemConfig.AuthType

setAuthType

public void setAuthType(ModemConfig.AuthType authType)
Sets authentication type.

Parameters:
authType - - authentication type as ModemConfig.AuthType

getUsername

public String getUsername()
Reports user name.

Returns:
user name as String

setUsername

public void setUsername(String username)
Sets user name.

Parameters:
username - - user name as String

getPassword

public String getPassword()
Reports password.

Returns:
password as String

setPassword

public void setPassword(String password)
Sets password.

Parameters:
password - - password as String

getLcpEchoInterval

public int getLcpEchoInterval()
Reports LCP echo interval

Returns:
LCP echo interval (in sec) as int

setLcpEchoInterval

public void setLcpEchoInterval(int lcpEchoInterval)
Sets LCP echo interval

Parameters:
lcpEchoInterval - - LCP Echo interval as int

getLcpEchoFailure

public int getLcpEchoFailure()
Reports number of failed LCP echo requests

Returns:
number of failed LCP echo requests as int

setLcpEchoFailure

public void setLcpEchoFailure(int lcpEchoFailure)
Sets number of failed LCP echo requests (unacknowledged LCP echo requests to be sent for pppd to presume the peer to be dead)

Parameters:
lcpEchoFailure -

getPppNumber

public int getPppNumber()
Reports PPP number (i.e. '0' for ppp0).

Returns:
PPP number as int

setPppNumber

public void setPppNumber(int pppNumber)
Sets PPP number (i.e. '0' for ppp0).

Parameters:
pppNumber - - PPP number as int

getProfileID

public int getProfileID()
Reports PDP profile ID.

Returns:
PDP profile ID as int

setProfileID

public void setProfileID(int id)
Sets PDP profile ID.

Parameters:
id - - PDP profile ID as int

getPdpType

public ModemConfig.PdpType getPdpType()
Reports PDP type.

Returns:
PDP type as PDP_Type

setPdpType

public void setPdpType(ModemConfig.PdpType pdpType)
Sets PDP type.

Parameters:
pdpType - - PDP type as PDP_Type

getApn

public String getApn()
Reports access point name.

Returns:
access point name as String

setApn

public void setApn(String apn)
Sets access point name.

Parameters:
apn - - access point name as String

getIpAddress

public IPAddress getIpAddress()
Reports PDP IP address.

Returns:
IP address as IPAddress

setIpAddress

public void setIpAddress(IPAddress address)
Sets PDP IP address.

Parameters:
ip - - IP address as IPAddress

getDataCompression

public int getDataCompression()
Reports a value of numeric parameter that supports PDP data compression.

Returns:
PDP data compression as int

setDataCompression

public void setDataCompression(int dataCompression)
Sets a value of numeric parameter that supports PDP data compression.

Parameters:
dataCompression - - PDP data compression as int

getHeaderCompression

public int getHeaderCompression()
Reports a value of numeric parameter that supports PDP header compression.

Returns:
PDP header compression as int

setHeaderCompression

public void setHeaderCompression(int headerCompression)
Sets a value of numeric parameter that supports PDP header compression.

Parameters:
- - headerCompression PDP header compression as int

isDataCompression

public boolean isDataCompression()
Reports if PDP data compression is enabled.

Returns:
boolean

isHeaderCompression

public boolean isHeaderCompression()
Reports if PDP header compression is enabled.

Returns:
boolean

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

isValid

public boolean isValid()
Description copied from interface: NetConfig
Checks whether or not this configuration is valid.

Specified by:
isValid in interface NetConfig
Returns:
true if the configuration is valid, otherwise false


Copyright © 2013. All Rights Reserved.