|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectAbstractSmsService
com.objectxp.msg.TapSmsService
public class TapSmsService
This class may be used to send Short Messages (SMS) to a mobile recipient using TAP/IXO.
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.
| Field Summary | |
|---|---|
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) |
| Fields inherited from interface com.objectxp.msg.SmsService |
|---|
VERSION |
| Constructor Summary | |
|---|---|
TapSmsService()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.objectxp.msg.SmsService |
|---|
addMessageEventListener, cancel, getKeepAliveInterval, getLastIsAliveTime, getProperties, init, init, isAlive, isInitialized, isKeepAliveActive, isReceiving, query, removeMessageEventListener, replace, setKeepAliveInterval, startReceiving, stopReceiving, supportDeleteMessage, supportReadMessage |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public TapSmsService()
| Method Detail |
|---|
public final java.lang.String getServiceName()
getServiceName in interface SmsService
public void init(java.util.Properties props)
throws MessageException
SmsService
init in interface SmsServiceMessageExceptionSmsService.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 SmsServicemessage - 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
SmsServiceMessageEvent.DEVICE_READY event to all registered
MessageEventListeners.
connect in interface SmsServiceMessageExceptionMessageEvent,
MessageEventListener
public void disconnect()
throws MessageException
SmsServiceMessageEvent.DEVICE_NOT_READY even to all
registered MessageEventListeners.
disconnect in interface SmsServiceMessageExceptionMessageEvent,
MessageEventListenerpublic boolean isConnected()
SmsService
isConnected in interface SmsServicepublic boolean hasCapability(Capability capability)
SmsService
hasCapability in interface SmsServicecapability - one of the Constants in the Capability class.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||