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.
sms.smpp.connections.maxAmount
-- the maximum amount of connections. The default value is one.
sms.smpp.connections.idleMillis
-- time (in ms) after which idle connections are allowed to be evicted. Defaults to two minutes.
sms.smpp.host
-- the host name of your SMPP Server or SMSC, i.e. smsc.example.org. The default value is "localhost".
sms.smpp.port
-- the port on which the SMSC is listening. Defaults to 2775.
sms.smpp.systemId
-- the 'user name' to use when connecting to the SMSC.
sms.smpp.password
-- the password that authenticates the systemId value when connecting to the SMSC.
sms.smpp.systemType
-- an optional system type, which, if defined, will be used when connecting to the SMSC.
sms.smpp.receive.ton
-- The type-of-number value for 'receiving' SMS messages. Defaults to 'UNKNOWN'.
sms.smpp.receive.npi
-- The number-plan-indicator value for 'receiving' SMS messages. Defaults to 'UNKNOWN'.
sms.smpp.source.ton
-- The type-of-number value for the source of SMS messages. Defaults to 'UNKNOWN'.
sms.smpp.source.npi
-- The number-plan-indicator value for the source of SMS messages. Defaults to 'UNKNOWN'.
sms.smpp.source.address
-- The source address of SMS messages.
sms.smpp.destination.ton
-- The type-of-number value for the destination of SMS messages. Defaults to 'UNKNOWN'.
sms.smpp.destination.npi
-- The number-plan-indicator value for the destination of SMS messages. Defaults to 'UNKNOWN'.
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–2020 Ignite Realtime. All rights reserved.