SMSLib 3.5.3

org.smslib.http
Class ClickatellHTTPGateway

java.lang.Object
  extended by org.smslib.AGateway
      extended by org.smslib.http.ClickatellHTTPGateway

public class ClickatellHTTPGateway
extends AGateway

Gateway for Clickatell bulk operator (http://www.clickatell.com) Outbound only - implements HTTP & HTTPS interface.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.smslib.AGateway
AGateway.AsyncEvents, AGateway.GatewayAttributes, AGateway.GatewayStatuses, AGateway.Protocols
 
Constructor Summary
ClickatellHTTPGateway(java.lang.String id, java.lang.String myApiId, java.lang.String myUsername, java.lang.String myPassword)
           
 
Method Summary
 int getQueueSchedulingInterval()
          Returns the Gateway Queue sending internal (in milliseconds).
 boolean getSecure()
          Return the operation mode (HTTP or HTTPS).
 float queryBalance()
          Queries the gateway for remaining credit.
 boolean queryCoverage(OutboundMessage msg)
          Queries the gateway to see if a specific message and its recipient are covered.
 StatusReportMessage.DeliveryStatuses queryMessage(java.lang.String refNo)
          Query the gateway for message delivery status.
 boolean sendMessage(OutboundMessage msg)
           
 void setSecure(boolean mySecure)
          Sets whether the gateway works in unsecured (HTTP) or secured (HTTPS) mode.
 void startGateway()
           
 void stopGateway()
           
 
Methods inherited from class org.smslib.AGateway
deleteMessage, getAttributes, getDeliveryErrorCode, getFrom, getGatewayId, getInboundMessageCount, getMyself, getOutboundMessageCount, getProtocol, getRestartCount, getStatus, incInboundMessageCount, incOutboundMessageCount, isInbound, isOutbound, queryMessage, readMessage, readMessages, readPhonebook, sendMessages, sendUSSDCommand, sendUSSDCommand, sendUSSDRequest, setAttributes, setDeliveryErrorCode, setFrom, setInbound, setOutbound, setProtocol, setStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClickatellHTTPGateway

public ClickatellHTTPGateway(java.lang.String id,
                             java.lang.String myApiId,
                             java.lang.String myUsername,
                             java.lang.String myPassword)
Method Detail

setSecure

public void setSecure(boolean mySecure)
Sets whether the gateway works in unsecured (HTTP) or secured (HTTPS) mode. False denotes unsecured.

Parameters:
mySecure - True for HTTPS, false for plain HTTP.

getSecure

public boolean getSecure()
Return the operation mode (HTTP or HTTPS).

Returns:
True for HTTPS, false for HTTP.
See Also:
setSecure(boolean)

startGateway

public void startGateway()
                  throws TimeoutException,
                         GatewayException,
                         java.io.IOException,
                         java.lang.InterruptedException
Overrides:
startGateway in class AGateway
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

stopGateway

public void stopGateway()
                 throws TimeoutException,
                        GatewayException,
                        java.io.IOException,
                        java.lang.InterruptedException
Overrides:
stopGateway in class AGateway
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

queryBalance

public float queryBalance()
                   throws TimeoutException,
                          GatewayException,
                          java.io.IOException,
                          java.lang.InterruptedException
Description copied from class: AGateway
Queries the gateway for remaining credit.

Overrides:
queryBalance in class AGateway
Returns:
Remaining credit.
Throws:
TimeoutException - The gateway did not respond in a timely manner.
GatewayException - A Gateway error occurred.
java.io.IOException - An IO error occurred.
java.lang.InterruptedException - The call was interrupted.

queryCoverage

public boolean queryCoverage(OutboundMessage msg)
                      throws TimeoutException,
                             GatewayException,
                             java.io.IOException,
                             java.lang.InterruptedException
Description copied from class: AGateway
Queries the gateway to see if a specific message and its recipient are covered. The given message is not sent out - it is just tested.

Overrides:
queryCoverage in class AGateway
Parameters:
msg - The message to test.
Returns:
True is the recipient is covered by the network.
Throws:
TimeoutException - The gateway did not respond in a timely manner.
GatewayException - A Gateway error occurred.
java.io.IOException - An IO error occurred.
java.lang.InterruptedException - The call was interrupted.

queryMessage

public StatusReportMessage.DeliveryStatuses queryMessage(java.lang.String refNo)
                                                  throws TimeoutException,
                                                         GatewayException,
                                                         java.io.IOException,
                                                         java.lang.InterruptedException
Description copied from class: AGateway
Query the gateway for message delivery status.

Overrides:
queryMessage in class AGateway
Parameters:
refNo - The reference number of a previously sent message to be checked.
Returns:
The delivery status. This is interpreted and mapped to the standard SMSLib status codes. For detailed information, check method getDeliveryErrorCode().
Throws:
TimeoutException - The gateway did not respond in a timely manner.
GatewayException - A Gateway error occurred.
java.io.IOException - An IO error occurred.
java.lang.InterruptedException - The call was interrupted.
See Also:
StatusReportMessage.DeliveryStatuses, AGateway.getDeliveryErrorCode()

sendMessage

public boolean sendMessage(OutboundMessage msg)
                    throws TimeoutException,
                           GatewayException,
                           java.io.IOException,
                           java.lang.InterruptedException
Overrides:
sendMessage in class AGateway
Throws:
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException

getQueueSchedulingInterval

public int getQueueSchedulingInterval()
Description copied from class: AGateway
Returns the Gateway Queue sending internal (in milliseconds). Should be defined in every actual Gateway implementation.

Specified by:
getQueueSchedulingInterval in class AGateway
Returns:
The scheduling interval (in milliseconds).

SMSLib 3.5.3

(c) 2002-2011, http://smslib.org