public class SmsService extends Object
This class is configured with a set of Jive properties. Note that each service provider can require a different set of properties to be set.
Modifier and Type | Method and Description |
---|---|
static String |
getDescriptiveMessage(Throwable ex)
Checks if an exception in the chain of the provided throwable contains a 'command status' that can be
translated in a somewhat more helpful error message.
|
static SmsService |
getInstance() |
void |
send(String message,
String recipient)
Causes a new SMS message to be sent.
|
void |
sendImmediately(String message,
String recipient)
Causes a new SMS message to be sent.
|
public static SmsService getInstance()
public void send(String message, String recipient)
message
- The body of the message (cannot be null or empty).recipient
- The address / phone number to which the message is to be send (cannot be null or empty).public void sendImmediately(String message, String recipient) throws Exception
send(String, String)
in that the message is sent before this method returns,
rather than queueing the messages to be sent later (in an async fashion). As a result, any exceptions that occur
while sending the message are thrown by this method (which can be useful to test the configuration of this
service).message
- The body of the message (cannot be null or empty).recipient
- The address / phone number to which the message is to be send (cannot be null or empty).Exception
- On any problem.public static String getDescriptiveMessage(Throwable ex)
ex
- The exception in which to search for a command status.Copyright © 2003-2008 Jive Software.