public class TapSmsService extends AbstractSmsService implements SmsService
The message will be sent through the SMS Center (SMSC). The SMSC may be reached by either a modem or ISDN connection.
TAP/IXO only supports 7-Bit encoded messages. All characters in a message above ASCII(127) will therefore be truncated to a dot (.).
Notice: Receiving Messages through TAP is not supported.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFG_BPS
Port speed (baud rate)
|
static java.lang.String |
CFG_DATABITS
Number of databits (5,6,7,8)
|
static java.lang.String |
CFG_FLOWCTRL
Flow-Control ("RTSCTS", "XONXOFF", "NONE")
|
static java.lang.String |
CFG_INITSTRING
CFG_INITSTRING is the name of the constant holding the value "tap.initstring".
|
static java.lang.String |
CFG_LOGIN
Login name (if required by tap gateway)
|
static java.lang.String |
CFG_PARITY
Parity ("NONE","ODD","EVEN", "MARK","SPACE")
|
static java.lang.String |
CFG_PORT
name of the serial port where your modem / ISDN adapter is attached (e.g.
|
static java.lang.String |
CFG_SENDER
Default message sender address
|
static java.lang.String |
CFG_SMSC
configuration property for specifing the SMSC phone number
|
static java.lang.String |
CFG_STOPBITS
Stop bits (1,15,2)
|
VERSION
Constructor and Description |
---|
TapSmsService() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the GSM device or SMS gateway.
|
void |
destroy()
Release allocated resources and destroy this service.
|
void |
disconnect()
Disconnect from the GSM device or SMS gateway.
|
java.lang.String |
getServiceName()
Gets the name of the service.
|
boolean |
hasCapability(Capability capability)
Determine if a SMS Service has a specific capability.
|
void |
init(java.util.Properties props)
Initialize this service.
|
boolean |
isConnected()
Returns true if the Service is currently connected to the GSM device or SMS gateway,
false otherwise.
|
void |
sendMessage(Message message)
Send a message to a GSM recipient.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMessageEventListener, cancel, getKeepAliveInterval, getLastIsAliveTime, getProperties, init, init, isAlive, isInitialized, isKeepAliveActive, isReceiving, query, removeMessageEventListener, replace, setKeepAliveInterval, startReceiving, stopReceiving, supportDeleteMessage, supportReadMessage
public static final java.lang.String CFG_SMSC
public static final java.lang.String CFG_PORT
public static final java.lang.String CFG_BPS
public static final java.lang.String CFG_DATABITS
public static final java.lang.String CFG_PARITY
public static final java.lang.String CFG_STOPBITS
public static final java.lang.String CFG_FLOWCTRL
public static final java.lang.String CFG_LOGIN
public static final java.lang.String CFG_SENDER
public static final java.lang.String CFG_INITSTRING
public final java.lang.String getServiceName()
getServiceName
in interface SmsService
public void init(java.util.Properties props) throws MessageException
SmsService
init
in interface SmsService
MessageException
SmsService.init()
,
SmsService.init(java.io.File)
public void sendMessage(Message message) throws MessageException
SmsService
If the message to send is not a binary or unicode message, the
service will convert the message to the default GSM character set
using GsmHelper.iso2gsm()
.
This method will broadcast a MessageEvent
to all registered
MessageEventListener's. In case of success a MessageEvent
of type MESSAGE_SENT is broadcasted. Otherwise, the MessageEvent is of
type MESSAGE_NOT_SENT.
sendMessage
in interface SmsService
message
- the message to send.MessageException
- if the message could not be sent.public void destroy()
SmsService
destroy
in interface SmsService
public void connect() throws MessageException
SmsService
MessageEvent.DEVICE_READY
event to all registered
MessageEventListeners.connect
in interface SmsService
MessageException
MessageEvent
,
MessageEventListener
public void disconnect() throws MessageException
SmsService
MessageEvent.DEVICE_NOT_READY
even to all
registered MessageEventListeners.disconnect
in interface SmsService
MessageException
MessageEvent
,
MessageEventListener
public boolean isConnected()
SmsService
isConnected
in interface SmsService
public boolean hasCapability(Capability capability)
SmsService
hasCapability
in interface SmsService
capability
- one of the Constants in the Capability
class.object XP, Inc. © 2000-2013. All rights reserved object XP