|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.sms.tap.TapSender
Class to connect to a SMS Gateway (SMSC) and attempt to deliver a number of SMS messages using the Telelocator Alphanumeric Protocol (TAP).
Field Summary | |
Logger |
logger
Logger object to be used to monitor the protocol interactions. |
Constructor Summary | |
TapSender(CommConnector connector,
java.lang.String password)
|
Method Summary | |
void |
close()
Ends the TAP transaction. |
boolean |
open()
Opens Communication Connexion and performs initial TAP protocol steps (logon). |
boolean |
sendMessage(SmsMessage m)
Sends an SMS Message (low level method). |
boolean |
sendMessageList(java.util.ArrayList mlist)
Send a number of messages (high level method). |
boolean |
sendOneMessage(SmsMessage message)
Sends One Message (high level method). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public Logger logger
TapSender sender = new TapSender( cx, "" ); sender.logger = Logger.getLogger("com.java4less.sms.tap"); sender.logger.setLevel( 7 );
Constructor Detail |
public TapSender(CommConnector connector, java.lang.String password)
connector
- Communitactions Connector that will be used to connect
to the SMSC.
Usually it's a
modem connection
but it could be also a
direct serial connection
or any other, as long as it allows to reach an SMSC that "talks" TAP.password
- TAP password. It will ve provided by the company that
offers the TAP gateway. Very often is omitted, just use an empty string
in such case.Method Detail |
public boolean sendOneMessage(SmsMessage message)
message status
.sendMessageList
public boolean sendMessageList(java.util.ArrayList mlist)
message status
.
You should check it to know if a particular message was accepted or not.
mlist
- To use this method you should first prepare an ArrayList
of SmsMessage
objects.public boolean open() throws TapException, CommException, java.io.IOException
sendMessage
.
TapException
CommException
java.io.IOException
public boolean sendMessage(SmsMessage m) throws TapException, java.io.IOException
open()
.
close()
when you have finished.
TapException
java.io.IOException
public void close() throws BadCloseException
BadCloseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |