com.unipro.smlib
Class Configurator

java.lang.Object
  |
  +--com.unipro.smlib.Configurator

public class Configurator
extends java.lang.Object

Class represents settings for smlib.
Configurator object must be passed to the init() method of SmsManager. You can set and get parameters of the message by calling set/get methods.

Parameters are:
Port Port name, which will be used by SMLib. COM1 by default
Baud baud rate, 19200 by default
Mess pool size Messages pool size (about pools), 50 by default
ACKs pool size ACKs pool size (about pools), 50 by default.


Field Summary
static int BAUD_19200
          baud rate = 19200
static int BAUD_2400
          baud rate = 2400
static int BAUD_4800
          baud rate = 4800
static int BAUD_9600
          baud rate = 9600
static java.lang.String PORT_COM1
          Port COM1
static java.lang.String PORT_COM2
          Port COM2
static java.lang.String PORT_COM3
          Port COM3
static java.lang.String PORT_COM4
          Port COM4
static java.lang.String PORT_COM5
          Port COM5
static java.lang.String PORT_COM6
          Port COM6
static java.lang.String PORT_COM7
          Port COM7
static java.lang.String PORT_COM8
          Port COM8
 
Constructor Summary
Configurator()
          Creates new Configurator object with default settings.
Configurator(java.lang.String port, int baud)
          Creates new Configurator with the specified port name and baud rate.
 
Method Summary
 int getACKPoolSize()
          Gets ACKs pool size.
 int getBaud()
          Gets baud rate.
 int getMessagePoolSize()
          Gets messages pool size.
 java.lang.String getPort()
          Gets port name.
 void setACKPoolSize(int size)
          Sets ACKs pool size.
 void setBaud(int b)
          Sets baud rate.
 void setMessagePoolSize(int size)
          Sets messages pool size.
 void setPort(java.lang.String port)
          Sets port name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT_COM1

public static java.lang.String PORT_COM1
Port COM1

PORT_COM2

public static java.lang.String PORT_COM2
Port COM2

PORT_COM3

public static java.lang.String PORT_COM3
Port COM3

PORT_COM4

public static java.lang.String PORT_COM4
Port COM4

PORT_COM5

public static java.lang.String PORT_COM5
Port COM5

PORT_COM6

public static java.lang.String PORT_COM6
Port COM6

PORT_COM7

public static java.lang.String PORT_COM7
Port COM7

PORT_COM8

public static java.lang.String PORT_COM8
Port COM8

BAUD_19200

public static int BAUD_19200
baud rate = 19200

BAUD_9600

public static int BAUD_9600
baud rate = 9600

BAUD_4800

public static int BAUD_4800
baud rate = 4800

BAUD_2400

public static int BAUD_2400
baud rate = 2400
Constructor Detail

Configurator

public Configurator()
Creates new Configurator object with default settings.
Default values.

Configurator

public Configurator(java.lang.String port,
                    int baud)
             throws ValidationException
Creates new Configurator with the specified port name and baud rate.
Parameters:
port - port name.
baud - baud rate.
Default values.
Throws:
ValidationException - - If any parameter is invalid.
  1. If port name is null
  2. If port name is not one of PORT_XXX constants.
  3. If baud rate is not one of BAUD_XXX constants
Additional information about smlib exceptions: Smlib exceptions.
Method Detail

setPort

public void setPort(java.lang.String port)
             throws ValidationException
Sets port name.
Parameters:
port - port name which will be used by SmsManager, you can set it using PORT_XXX constants.
Throws:
ValidationException - - If parameter is invalid.
  1. If port's name is null
  2. If port's name is not form PORT_ constants set
Default values.

setBaud

public void setBaud(int b)
             throws ValidationException
Sets baud rate.
Parameters:
b - baud rate , you can set it using BAUND_XXX constants.
Default values.
Throws:
ValidationException - - If parameter is invalid: if baud rate is not one of BAUD_XXX constants
There is additional information about SMLib exceptions at all: SMLib exceptions.

getPort

public java.lang.String getPort()
Gets port name.
Returns:
port name. One of PORT_XXX constants.

getBaud

public int getBaud()
Gets baud rate. One of BAUD_XXX constants.
Returns:
baud rate

setMessagePoolSize

public void setMessagePoolSize(int size)
                        throws ValidationException
Sets messages pool size. Valid value is from 0 to 200. About pools. Changing of pool size require SmsManager reinitialization.
Parameters:
size - pool size.
Default values.
Throws:
ValidationException - If parameter is invalid:
  1. If size is negative
  2. If size value is more than 200
Additional information about SMLib exceptions: SMLib exceptions.

getMessagePoolSize

public int getMessagePoolSize()
Gets messages pool size. About pools.
Returns:
messages pool size

setACKPoolSize

public void setACKPoolSize(int size)
                    throws ValidationException
Sets ACKs pool size. Valid value is from 0 to 200. About pools. Changing of pool size require SmsManager reinitialization.
Parameters:
size - pool size.
Default values.
Throws:
ValidationException - If parameter is invalid:
  1. If size is negative
  2. If size value is more than 200
Additional information about SMLib exceptions: SMLib exceptions.

getACKPoolSize

public int getACKPoolSize()
Gets ACKs pool size. About pools.
Returns:
ACKs pool size