|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.marre.sms.transport.clickatell.ClickatellTransport
An SmsTransport that sends the SMS with clickatell over HTTP.
It is developed to use the "Clickatell HTTP API v. 2.2.4".
Known limitations:
- Cannot send 8-Bit messages without an UDH.
- DCS is not supported. Only UCS2, 7bit, 8bit and SMS class 0 or 1.
- Cannot set validity period (not implemented)
- Doesn't acknowledge the TON or NPI, everything is sent as NPI_ISDN_TELEPHONE and TON_INTERNATIONAL.
Field Summary | |
static int |
FEAT_8BIT
Required feature "8-bit messaging". |
static int |
FEAT_ALPHA
Required feature "alpha originator (sender id)". |
static int |
FEAT_CONCAT
Required feature "Concatenation". |
static int |
FEAT_DEFAULT
The default required features as explained in HTTP API v224. |
static int |
FEAT_DELIVACK
Required feature "Delivery acknowledgements". |
static int |
FEAT_FLASH
Required feature "Flash messaging". |
static int |
FEAT_NUMBER
Required feature "numeric originator (sender id)". |
static int |
FEAT_REPLY
Required feature "reply to an mt message with a numeric sender id". |
static int |
FEAT_TEXT
Required feature "Text". |
static int |
FEAT_UCS2
Required feature "ucs2/unicode". |
static int |
FEAT_UDH
Required feature "udh (binary)". |
Constructor Summary | |
ClickatellTransport()
|
Method Summary | |
void |
connect()
Sends an auth command to clickatell to get an session id that can be used later. |
void |
disconnect()
Disconnect from clickatell. |
void |
init(java.util.Properties props)
Initializes the transport. |
void |
ping()
Pings the clickatell service Not needed for the clickatell API |
java.lang.String |
send(SmsMessage msg,
SmsAddress dest,
SmsAddress sender)
Sends an SMS Message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FEAT_TEXT
public static final int FEAT_8BIT
public static final int FEAT_UDH
public static final int FEAT_UCS2
public static final int FEAT_ALPHA
public static final int FEAT_NUMBER
public static final int FEAT_REPLY
public static final int FEAT_FLASH
public static final int FEAT_DELIVACK
public static final int FEAT_CONCAT
public static final int FEAT_DEFAULT
Constructor Detail |
public ClickatellTransport()
Method Detail |
public void init(java.util.Properties props) throws SmsException
It expects the following properties in theProps param:
smsj.clickatell.username - clickatell username smsj.clickatell.password - clickatell password smsj.clickatell.apiid - clickatell apiid smsj.clickatell.protocol - http or https
init
in interface SmsTransport
props
- Properties to initialize the library
SmsException
- If not given the needed paramspublic void connect() throws SmsException, java.io.IOException
connect
in interface SmsTransport
SmsException
- If we fail to authenticate to clickatell or if we fail to
connect.
java.io.IOException
public java.lang.String send(SmsMessage msg, SmsAddress dest, SmsAddress sender) throws SmsException, java.io.IOException
send
in interface SmsTransport
msg
- dest
- sender
-
SmsException
java.io.IOException
- Inidicates a failure to communicate with the SMS server.public void disconnect() throws SmsException, java.io.IOException
disconnect
in interface SmsTransport
SmsException
- Never
java.io.IOException
- Neverpublic void ping() throws SmsException, java.io.IOException
ping
in interface SmsTransport
SmsException
- Never
java.io.IOException
- Never
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |