org.marre.sms.transport.clickatell
Class ClickatellTransport

java.lang.Object
  extended byorg.marre.sms.transport.clickatell.ClickatellTransport
All Implemented Interfaces:
SmsTransport

public class ClickatellTransport
extends java.lang.Object
implements SmsTransport

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.

Version:
$Id: ClickatellTransport.java,v 1.27 2005/11/26 16:37:57 c95men Exp $
Author:
Markus Eriksson

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

FEAT_TEXT

public static final int FEAT_TEXT
Required feature "Text". Set by default.

See Also:
Constant Field Values

FEAT_8BIT

public static final int FEAT_8BIT
Required feature "8-bit messaging". Set by default.

See Also:
Constant Field Values

FEAT_UDH

public static final int FEAT_UDH
Required feature "udh (binary)". Set by default.

See Also:
Constant Field Values

FEAT_UCS2

public static final int FEAT_UCS2
Required feature "ucs2/unicode". Set by default.

See Also:
Constant Field Values

FEAT_ALPHA

public static final int FEAT_ALPHA
Required feature "alpha originator (sender id)".

See Also:
Constant Field Values

FEAT_NUMBER

public static final int FEAT_NUMBER
Required feature "numeric originator (sender id)".

See Also:
Constant Field Values

FEAT_REPLY

public static final int FEAT_REPLY
Required feature "reply to an mt message with a numeric sender id".

See Also:
Constant Field Values

FEAT_FLASH

public static final int FEAT_FLASH
Required feature "Flash messaging".

See Also:
Constant Field Values

FEAT_DELIVACK

public static final int FEAT_DELIVACK
Required feature "Delivery acknowledgements".

See Also:
Constant Field Values

FEAT_CONCAT

public static final int FEAT_CONCAT
Required feature "Concatenation". Set by default.

See Also:
Constant Field Values

FEAT_DEFAULT

public static final int FEAT_DEFAULT
The default required features as explained in HTTP API v224.

See Also:
Constant Field Values
Constructor Detail

ClickatellTransport

public ClickatellTransport()
Method Detail

init

public void init(java.util.Properties props)
          throws SmsException
Initializes the transport.

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
 

Specified by:
init in interface SmsTransport
Parameters:
props - Properties to initialize the library
Throws:
SmsException - If not given the needed params

connect

public void connect()
             throws SmsException,
                    java.io.IOException
Sends an auth command to clickatell to get an session id that can be used later.

Specified by:
connect in interface SmsTransport
Throws:
SmsException - If we fail to authenticate to clickatell or if we fail to connect.
java.io.IOException

send

public java.lang.String send(SmsMessage msg,
                             SmsAddress dest,
                             SmsAddress sender)
                      throws SmsException,
                             java.io.IOException
Sends an SMS Message.

Specified by:
send in interface SmsTransport
Parameters:
msg -
dest -
sender -
Returns:
Message ids
Throws:
SmsException
java.io.IOException - Inidicates a failure to communicate with the SMS server.

disconnect

public void disconnect()
                throws SmsException,
                       java.io.IOException
Disconnect from clickatell. Not needed for the clickatell API

Specified by:
disconnect in interface SmsTransport
Throws:
SmsException - Never
java.io.IOException - Never

ping

public void ping()
          throws SmsException,
                 java.io.IOException
Pings the clickatell service Not needed for the clickatell API

Specified by:
ping in interface SmsTransport
Throws:
SmsException - Never
java.io.IOException - Never


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.