com.objectxp.msg
Class SmppSmsService

java.lang.Object
  extended by AbstractSmsService
      extended by com.objectxp.msg.SmppSmsService
All Implemented Interfaces:
ManualAck, SmsService, WindowingService

public class SmppSmsService
extends AbstractSmsService
implements SmsService, WindowingService, ManualAck

This class may be used to send (and receive) Short Messages (SMS) to a mobile recipient using the SMPP Protocol.

The message will be sent through a SMS Center (SMSC) reachable over a TCP/IP network connection


Field Summary
static java.lang.String BIND_RECEIVER
          BIND_RECEIVER is the name of the constant holding the value "receiver"
static java.lang.String BIND_TRANSCEIVER
          BIND_TRANSCEIVER is the name of the constant holding the value "transceiver"
static java.lang.String BIND_TRANSMITTER
          BIND_TRANSMITTER is the name of the constant holding the value "transmitter"
static java.lang.String CFG_ADDR_NPI
          CFG_ADDR_NPI is the name of the constant holding the value "smpp.addr.npi"
static java.lang.String CFG_ADDR_RANGE
          CFG_ADDR_RANGE is the name of the constant holding the value "smpp.addr.range"
static java.lang.String CFG_ADDR_TON
          CFG_ADDR_TON is the name of the constant holding the value "smpp.addr.ton"
static java.lang.String CFG_BIND_OPERATION
          CFG_BIND_OPERATION is the name of the constant holding the value "smpp.bind.operation"
static java.lang.String CFG_DATA_CODING
          CFG_DATA_CODING is the name of the constant holding the value "smpp.data.coding"
static java.lang.String CFG_ESCAPE_SPECIAL
          CFG_ESCAPE_SPECIAL is the name of the constant holding the value "smpp.escape.special"
static java.lang.String CFG_GSM_PACKING
          CFG_GSM_PACKING is the name of the constant holding the value "smpp.gsm.packing"
static java.lang.String CFG_ID_QUIRKS
          CFG_ID_QUIRKS is the name of the constant holding the value "smpp.id.quirks"
static java.lang.String CFG_INTERFACE_VERSION
          CFG_INTERFACE_VERSION is the name of the constant holding the value "smpp.interface.version"
static java.lang.String CFG_LOCAL_ADDRESS
          CFG_LOCAL_ADDRESS is the name of the constant holding the value "smpp.local.address"
static java.lang.String CFG_LOGIN
          CFG_LOGIN is the name of the constant holding the value "smpp.login"
static java.lang.String CFG_MSG_MODE
          CFG_MSG_MODE is the name of the constant holding the value "smpp.message.mode"
static java.lang.String CFG_PASSWORD
          CFG_PASSWORD is the name of the constant holding the value "smpp.password"
static java.lang.String CFG_SMSC_ADDRESS
          CFG_SMSC_ADDRESS is the name of the constant holding the value "smpp.smsc.address"
static java.lang.String CFG_SMSC_CHARSET
          CFG_SMSC_CHARSET is the name of the constant holding the value "smpp.smsc.charset"
static java.lang.String CFG_STATUS_FORMAT
          CFG_STATUS_FMT is the name of the constant holding the value "smpp.status.format"
static java.lang.String CFG_SYSTEM_TYPE
          CFG_SYSTEM_TYPE is the name of the constant holding the value "smpp.system.type"
static java.lang.String CFG_UNBIND_ON_IOE
          CFG_UNBIND_ON_IOE is the name of the constant holding the value "smpp.unbind.on.ioe"
static java.lang.String CFG_WINDOW_SIZE
          CFG_WINDOW_SIZE is the name of the constant holding the value "smpp.window.size".
static java.lang.String DEST_ADDR_SUBUNIT
          DEST_ADDR_SUBUNIT is the name of the constant holding the value "smpp.dest_addr_subunit"
static java.lang.String MSG_MODE_DEFAULT
          MSG_MODE_DEFAULT is the name of the constant holding the value "Default"
static java.lang.String MSG_MODE_DGRAM
          MSG_MODE_DGRAM is the name of the constant holding the value "Datagram"
static java.lang.String MSG_MODE_SAF
          MSG_MODE_SAF is the name of the constant holding the value "StoreAndForward"
static java.lang.String MSG_MODE_TRX
          MSG_MODE_TRX is the name of the constant holding the value "Transaction"
 
Constructor Summary
SmppSmsService()
          Creates a new SmppSmsService.
 
Method Summary
 void acknowledge(Message msg)
          Accept a incoming message.
 void acknowledge(Message msg, java.lang.Object status)
          Accept/reject a incoming message.
 void cancel(Message msg)
          Cancel a previously submitted message.
 void connect()
          Connect to the GSM device or SMS gateway.
 void destroy()
          Release allocated resources and destroy this service.
 void disableManualAck()
          Disable manual acknowledgement.
 void disconnect()
          Disconnect from the GSM device or SMS gateway.
 void enableManualAck()
          Enable manual acknowledgement.
 int getNumberOfPendingMessages()
          Returns the number of pending (unprocessed messages).
 java.lang.String getServiceName()
          Returns the name of the service.
 int getWindowSize()
          Returns the current window size or 1 if windowing is disabled.
 boolean hasCapability(Capability cap)
          Determine if a SMS Service has a specific capability.
 void init(java.util.Properties props)
           Initialize the SMPP service.
 boolean isManualAckEnabled()
          Check if manual acknowledgement is enabled/disabled.
 SmppStatus query_sm(Message msg)
          Query the Status of a previously submitted short message.
 void query(Message msg)
          Query the status of a previously submitted message.
 void replace(Message oldMessage, Message newMessage)
          Replace a previously submitted message.
 void sendMessage(Message message)
          Send a message to a GSM recipient.
 void setWindowSize(int size)
          Set the window size for this service.
 void startReceiving()
          Start receiving Messages.
 boolean supportReadMessage()
          Deprecated. since jSMS 2.1.8, use hasCapability(Capability.RECEIVE) instead.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.objectxp.msg.SmsService
addMessageEventListener, getKeepAliveInterval, getLastIsAliveTime, getProperties, init, init, isAlive, isConnected, isInitialized, isKeepAliveActive, isReceiving, removeMessageEventListener, setKeepAliveInterval, stopReceiving, supportDeleteMessage
 

Field Detail

CFG_SMSC_ADDRESS

public static final java.lang.String CFG_SMSC_ADDRESS
CFG_SMSC_ADDRESS is the name of the constant holding the value "smpp.smsc.address"

See Also:
Constant Field Values

CFG_LOCAL_ADDRESS

public static final java.lang.String CFG_LOCAL_ADDRESS
CFG_LOCAL_ADDRESS is the name of the constant holding the value "smpp.local.address"

See Also:
Constant Field Values

CFG_SYSTEM_TYPE

public static final java.lang.String CFG_SYSTEM_TYPE
CFG_SYSTEM_TYPE is the name of the constant holding the value "smpp.system.type"

See Also:
Constant Field Values

CFG_INTERFACE_VERSION

public static final java.lang.String CFG_INTERFACE_VERSION
CFG_INTERFACE_VERSION is the name of the constant holding the value "smpp.interface.version"

See Also:
Constant Field Values

CFG_ADDR_TON

public static final java.lang.String CFG_ADDR_TON
CFG_ADDR_TON is the name of the constant holding the value "smpp.addr.ton"

See Also:
Constant Field Values

CFG_ADDR_NPI

public static final java.lang.String CFG_ADDR_NPI
CFG_ADDR_NPI is the name of the constant holding the value "smpp.addr.npi"

See Also:
Constant Field Values

CFG_ADDR_RANGE

public static final java.lang.String CFG_ADDR_RANGE
CFG_ADDR_RANGE is the name of the constant holding the value "smpp.addr.range"

See Also:
Constant Field Values

CFG_LOGIN

public static final java.lang.String CFG_LOGIN
CFG_LOGIN is the name of the constant holding the value "smpp.login"

See Also:
Constant Field Values

CFG_PASSWORD

public static final java.lang.String CFG_PASSWORD
CFG_PASSWORD is the name of the constant holding the value "smpp.password"

See Also:
Constant Field Values

CFG_BIND_OPERATION

public static final java.lang.String CFG_BIND_OPERATION
CFG_BIND_OPERATION is the name of the constant holding the value "smpp.bind.operation"

See Also:
Constant Field Values

CFG_STATUS_FORMAT

public static final java.lang.String CFG_STATUS_FORMAT
CFG_STATUS_FMT is the name of the constant holding the value "smpp.status.format"

See Also:
Constant Field Values

CFG_MSG_MODE

public static final java.lang.String CFG_MSG_MODE
CFG_MSG_MODE is the name of the constant holding the value "smpp.message.mode"

See Also:
Constant Field Values

CFG_WINDOW_SIZE

public static final java.lang.String CFG_WINDOW_SIZE
CFG_WINDOW_SIZE is the name of the constant holding the value "smpp.window.size".

See Also:
Constant Field Values

CFG_SMSC_CHARSET

public static final java.lang.String CFG_SMSC_CHARSET
CFG_SMSC_CHARSET is the name of the constant holding the value "smpp.smsc.charset"

See Also:
Constant Field Values

CFG_ESCAPE_SPECIAL

public static final java.lang.String CFG_ESCAPE_SPECIAL
CFG_ESCAPE_SPECIAL is the name of the constant holding the value "smpp.escape.special"

See Also:
Constant Field Values

CFG_DATA_CODING

public static final java.lang.String CFG_DATA_CODING
CFG_DATA_CODING is the name of the constant holding the value "smpp.data.coding"

See Also:
Constant Field Values

CFG_GSM_PACKING

public static final java.lang.String CFG_GSM_PACKING
CFG_GSM_PACKING is the name of the constant holding the value "smpp.gsm.packing"

See Also:
Constant Field Values

CFG_ID_QUIRKS

public static final java.lang.String CFG_ID_QUIRKS
CFG_ID_QUIRKS is the name of the constant holding the value "smpp.id.quirks"

See Also:
Constant Field Values

CFG_UNBIND_ON_IOE

public static final java.lang.String CFG_UNBIND_ON_IOE
CFG_UNBIND_ON_IOE is the name of the constant holding the value "smpp.unbind.on.ioe"

See Also:
Constant Field Values

DEST_ADDR_SUBUNIT

public static final java.lang.String DEST_ADDR_SUBUNIT
DEST_ADDR_SUBUNIT is the name of the constant holding the value "smpp.dest_addr_subunit"

See Also:
Constant Field Values

BIND_RECEIVER

public static final java.lang.String BIND_RECEIVER
BIND_RECEIVER is the name of the constant holding the value "receiver"

See Also:
Constant Field Values

BIND_TRANSMITTER

public static final java.lang.String BIND_TRANSMITTER
BIND_TRANSMITTER is the name of the constant holding the value "transmitter"

See Also:
Constant Field Values

BIND_TRANSCEIVER

public static final java.lang.String BIND_TRANSCEIVER
BIND_TRANSCEIVER is the name of the constant holding the value "transceiver"

See Also:
Constant Field Values

MSG_MODE_DEFAULT

public static final java.lang.String MSG_MODE_DEFAULT
MSG_MODE_DEFAULT is the name of the constant holding the value "Default"

See Also:
Constant Field Values

MSG_MODE_SAF

public static final java.lang.String MSG_MODE_SAF
MSG_MODE_SAF is the name of the constant holding the value "StoreAndForward"

See Also:
Constant Field Values

MSG_MODE_DGRAM

public static final java.lang.String MSG_MODE_DGRAM
MSG_MODE_DGRAM is the name of the constant holding the value "Datagram"

See Also:
Constant Field Values

MSG_MODE_TRX

public static final java.lang.String MSG_MODE_TRX
MSG_MODE_TRX is the name of the constant holding the value "Transaction"

See Also:
Constant Field Values
Constructor Detail

SmppSmsService

public SmppSmsService()
Creates a new SmppSmsService. The service has to be initialized by calling init(Properties)

Method Detail

init

public void init(java.util.Properties props)
          throws MessageException

Initialize the SMPP service. The Properties object passed as argument to this method may contain the following properties:

Key Value
smpp.smsc.address SMSC address in the format 'address:port', e.g. 'smsc.xyz.org:1234'
smpp.login The SMPP system_id parameter is used to identify an ESME or an SMSC at bind time. An ESME system_id identifies the ESME or ESME agent to the SMSC. The SMSC system_id provides an identification of the SMSC to the ESME.SMPP System ID
smpp.password
The password parameter is used by the SMSC to authenticate the identity of the binding ESME. The Service Provider may require ESME s to provide a password when binding to the SMSC. This password is normally issued by the SMSC system administrator.
smpp.local.address Local address to bind (format: address[:port]) Example: 192.168.1.1:5000 (if unset, the operation system decides which address to use based on the SMSC host address).
smpp.bind.operation Type of BIND operation to use. Possible values are:
  • 'receiver' (receive-only)
  • 'transmitter' (send-only)
  • 'transceiver' (send and receive, default-setting)
smpp.system.type The system_type parameter is used to categorize the type of ESME that is binding to the SMSC. Examples include VMS (voice mail system) and OTA (over-the-air activation system). Specification of the system_type is optional - some SMSC s may not require ESME's to provide this detail.
smpp.interface.version This parameter is used to indicate the version of the SMPP protocol. (Defaults to 0x34)
smpp.addr.ton Indicates Type of Number of the ESME address. This parameter will be used for the SMPP bind operation. If unset, the TON will be set to NULL when binding to the SMSC. The following TON values are defined:
  • 0 - Unknown
  • 1 - International
  • 2 - National
  • 3 - Network Specific
  • 4 - Subscriber Number
  • 5 - Alphanumeric
  • 6 - Abbreviated
  • All other values reserved
smpp.addr.npi Numbering Plan Indicator for ESME address. This parameter will be used for the SMPP bind operation. If unset, the NPI will be set to NULL when binding to the SMSC. The following NPI values are defined:
  • 0 - Unknown
  • 1 - ISDN (E163/E164)
  • 3 - Data (X.121)
  • 4 - Telex (F.69)
  • 6 - Land Mobile (E.212)
  • 8 - National
  • 9 - Private
  • 10 - ERMES
  • 14 - Internet (IP)
  • 18 - WAP Client Id
  • All other values reserved
smpp.addr.range The smpp.addr.range property is used in for connecting as receiver or transceiver to the SMSC. It specifies a set of SME addresses serviced by the ESME client. A single SME address may also be specified in the smpp.addr.range property. UNIX Regular Expression notation should be used to specify a range of addresses. Messages addressed to any destination in this range shall be routed to the ESME.
smpp.keepalive.interval Keepalive interval in seconds. Set to 0 to turn off keep-alive
smpp.connector.timeout Communication timeout in milliseconds
smpp.message.mode SMPP Message Mode to use ("Default", "StoreAndForward", "Datagram", "Transaction"). If unset, the default MC Mode will be used.
smpp.status.format Delivery Receipt format for SMPP Interface Version <= 0x34. Use this property to specify the format of incoming delivery receipts (Status Reports). The default format is:
"id:{0} sub:{1} dlvrd:{2} submit date:{3} done date:{4} stat:{5} err:{6} text:{7}"
smpp.smsc.charset Character Set (Encoding) to use for communicating with the SMSC. If unset, the default encoding of your VM will be used. If smpp.smsc.charset is set to "GSM", jSMS will convert text messages to the GSM default 7 bit alphabet.

Contact your SMPP SMSC provider to ask for the correct encoding to use.

Example:
smpp.smsc.charset=ISO-8859-15.

By default, this property is unset (and therefore, the default encoding of your platform will be used). For more information about Java Character Encodings, have a look at the package specification of the package java.lang in the Java API-Docs of your JVM.

smpp.data.coding SMPP data_coding to use for text messages. If unset, jSMS uses the GSM DCS (Data coding scheme) "as-is" for the data_coding field. If this property is set, jSMS will encode the message class and the MWI indications as optional parameters to the SMPP submit operation.

Consult your SMPP provider and the SMPP and GSM-03.38 specifications for more information about the DCS and data_coding parameters.

By default, this property is unset.

smpp.escape.special Specify if certain characters from the extended GSM alphabet should be escaped using a "<ESC>char" sequence (e.g. the character '[' will be converted to '<ESC>('). This property has no influence if the SMSC charset (smpp.smsc.charset) is set to "GSM". Default value: "true"
smpp.gsm.packing Specify if text messages should be 7-bit packed/unpacked. Packing will only be done if the character set in use (smpp.smsc.charset) is set to "GSM". Please note that packing will not be applied to 8-bit or Unicode (UCS) messages. Chances are high that you must also set smpp.data.coding property to 0 (SMSC Default Alphabet) to prevent your SMSC from converting the message. Default value: "false".
smpp.id.quirks Most SMPP SMSC's return the ID for a sent message as an integer with radix 10 and leading zeros, but for status reports, they use radix 16 (hex-values). If smpp.id.quirks is enabled (true), jSMS tries to make sure that those IDs match by converting them to a common base.

By default, this property is enabled. Set it to "false" to turn this feature off.

smpp.dest_addr_subunit When this property is set to "true", jSMS converts the GSM Message class for outgoing messages to the corresponding SMPP "dest_addr_subunit" parameter.

By default, this property is "true". Set it to "false" to turn this feature off.

smpp.unbind.on.ioe When this property is set to false, jSMS does not issue an SMPP UNBIND operation if an I/O Exception occurs while receiving data from the SMSC.

By default, this property is true.

Notice: Properties in Italics are optional

Specified by:
init in interface SmsService
Throws:
MessageException
See Also:
SmsService.init(), SmsService.init(java.io.File)

connect

public void connect()
             throws MessageException,
                    TimeoutException,
                    SmppException
Description copied from interface: SmsService
Connect to the GSM device or SMS gateway. Before sending and receiving messages, this method must be called. When the connection is established, the Service broadcasts a MessageEvent.DEVICE_READY event to all registered MessageEventListeners.

Specified by:
connect in interface SmsService
Throws:
MessageException
TimeoutException
SmppException
See Also:
MessageEvent, MessageEventListener

disconnect

public void disconnect()
                throws MessageException
Description copied from interface: SmsService
Disconnect from the GSM device or SMS gateway. Call this method after sending/receiving messages. After the connection has been disconnected, jSMS broadcasts a MessageEvent.DEVICE_NOT_READY even to all registered MessageEventListeners.

Specified by:
disconnect in interface SmsService
Throws:
MessageException
See Also:
MessageEvent, MessageEventListener

destroy

public void destroy()
Description copied from interface: SmsService
Release allocated resources and destroy this service. The service may not be re-used after calling destroy(). This method has to be invoked when the SMS Service will not be used anymore.

Specified by:
destroy in interface SmsService

getServiceName

public final java.lang.String getServiceName()
Description copied from interface: SmsService
Returns the name of the service.

Specified by:
getServiceName in interface SmsService

sendMessage

public void sendMessage(Message message)
                 throws MessageException
Description copied from interface: SmsService
Send a message to a GSM recipient. The recipient must be a valid GSM phone number. The message will be truncated to 160 characters.

If the message to send is not a binary or unicode message, the service will convert the message to the default GSM character set using GsmHelper.iso2gsm().

This method will broadcast a MessageEvent to all registered MessageEventListener's. In case of success a MessageEvent of type MESSAGE_SENT is broadcasted. Otherwise, the MessageEvent is of type MESSAGE_NOT_SENT.

Specified by:
sendMessage in interface SmsService
Parameters:
message - the message to send.
Throws:
MessageException - if the message could not be sent.

supportReadMessage

public boolean supportReadMessage()
Deprecated. since jSMS 2.1.8, use hasCapability(Capability.RECEIVE) instead.

Description copied from interface: SmsService
This method returns true if the Service is able to receive messages from the SMS device or gateway, false otherwise.

Specified by:
supportReadMessage in interface SmsService

acknowledge

public void acknowledge(Message msg)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalStateException,
                        java.io.IOException
Description copied from interface: ManualAck
Accept a incoming message. The SmsService acknowledges the reception of the message to the Short Message Center (SMSC).

Specified by:
acknowledge in interface ManualAck
Parameters:
msg - the Message to accept
Throws:
java.lang.IllegalArgumentException - if the Message is null or not a incoming message, or if the message has been received by another SmsService.
java.lang.IllegalStateException - if the Service is not initialized or not connected to the SMSC.
IOException - if the communication with the SMSC fails.

acknowledge

public void acknowledge(Message msg,
                        java.lang.Object status)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalStateException,
                        java.io.IOException
Accept/reject a incoming message. The status parameter can be used to pass an Integer object holding the SMPP command_status. Consult the SMPP specification for more details about possible command_status values.

Specified by:
acknowledge in interface ManualAck
Parameters:
msg - the Message to acknowledge
status - an Integer holding the SMPP command_status or null to accept the message.
Throws:
java.lang.IllegalArgumentException - if the Message is null or not a incoming message, or if the message has been received by another SmsService.
java.lang.IllegalArgumentException - if the status parameter is not an instance of java.lang.Integer
java.lang.IllegalStateException - if the Service is not initialized or not connected to the SMSC.
java.io.IOException - if the communication with the SMSC fails.

disableManualAck

public void disableManualAck()
Description copied from interface: ManualAck
Disable manual acknowledgement. Incoming messages will automatically be acknowledged by the SmsService upon reception of the message.

Specified by:
disableManualAck in interface ManualAck

enableManualAck

public void enableManualAck()
Description copied from interface: ManualAck
Enable manual acknowledgement. Incoming messages have to be acknowledged by calling ManualAck.acknowledge(Message).

Specified by:
enableManualAck in interface ManualAck

isManualAckEnabled

public boolean isManualAckEnabled()
Description copied from interface: ManualAck
Check if manual acknowledgement is enabled/disabled.

Specified by:
isManualAckEnabled in interface ManualAck

startReceiving

public void startReceiving()
                    throws java.io.IOException,
                           java.lang.IllegalStateException
Description copied from interface: SmsService
Start receiving Messages. The Service has to be initialized and must be connected to the SMS gateway/device. Furthermore, you have to register at least one MessageEventListener with the Service. After receiving has started, the service will broadcast a MessageEvent of type MessageEvent.RECEIVING_STARTED to all registered MessageEvent listeners.

Specified by:
startReceiving in interface SmsService
Throws:
java.io.IOException - if the communication with the SMS gateway/device fails
java.lang.IllegalStateException - if the service isn't initialized and in connected state or there are no registered Message Event Listeners.
See Also:
SmsService.addMessageEventListener(MessageEventListener)

setWindowSize

public void setWindowSize(int size)
                   throws java.lang.IllegalAccessException
Description copied from interface: WindowingService
Set the window size for this service. To disable windowing, set the window size to 1. The window size can only be changed if the SmsService is not currently connected to the SMSC.

Specified by:
setWindowSize in interface WindowingService
Parameters:
size - the window size
Throws:
java.lang.IllegalAccessException - if the service is connected to the SMSC when calling this method

getWindowSize

public int getWindowSize()
Description copied from interface: WindowingService
Returns the current window size or 1 if windowing is disabled.

Specified by:
getWindowSize in interface WindowingService

getNumberOfPendingMessages

public int getNumberOfPendingMessages()
Description copied from interface: WindowingService
Returns the number of pending (unprocessed messages). You may use this method to check if all outgoing messages have been acknowledged by the SMSC prior to calling disconnect() on the SmsService.

Specified by:
getNumberOfPendingMessages in interface WindowingService

hasCapability

public boolean hasCapability(Capability cap)
Description copied from interface: SmsService
Determine if a SMS Service has a specific capability.

Specified by:
hasCapability in interface SmsService
Parameters:
cap - one of the Constants in the Capability class.
Returns:
true if the service provides the capability.

query

public void query(Message msg)
           throws java.lang.UnsupportedOperationException,
                  java.lang.IllegalStateException,
                  MessageException
Description copied from interface: SmsService
Query the status of a previously submitted message. The status of the message will be delivered asynchronously using a MessageEvent of type STATUS_RECEIVED.

Specified by:
query in interface SmsService
Parameters:
msg - the previously submitted message.
Throws:
java.lang.UnsupportedOperationException - if the service does not support canceling messages.
java.lang.IllegalStateException - if the service is not initialized or not connected to the SMSC.
MessageException - if querying the status failed.

query_sm

public SmppStatus query_sm(Message msg)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IllegalStateException,
                           java.lang.IllegalArgumentException,
                           MessageException
Query the Status of a previously submitted short message. This method is similar to query(Message) but immediately returns the Status of the message instead of providing this information in the form of a MessageEvent. The message to query must contain at least the message ID. If the sender address is set too, it will also be used in the SMPP query_sm operation (fields source_addr_ton, source_addr_npi, source_addr).

Parameters:
msg - the previously sent message
Returns:
a SMPP Status object.
Throws:
java.lang.UnsupportedOperationException - if the service does not support querying the message status.
java.lang.IllegalStateException - if the service is not initialized or not connected to the SMSC.
java.lang.IllegalArgumentException - if the message is null or doesn't contain a message ID.
MessageException - if querying the status failed.
Since:
jSMS 2.1.8

cancel

public void cancel(Message msg)
            throws java.lang.UnsupportedOperationException,
                   java.lang.IllegalStateException,
                   java.lang.IllegalArgumentException,
                   MessageException
Description copied from interface: SmsService
Cancel a previously submitted message. The message can only be cancelled if it has not yet been delivered to the recipient. For messages requesting a status report, a MessageEvent of type STATUS_RECEIVED will be generated upon cancellation of the message.

Specified by:
cancel in interface SmsService
Parameters:
msg - The previously sent message
Throws:
java.lang.UnsupportedOperationException - if the service does not support canceling messages.
java.lang.IllegalStateException - if the service is not initialized or not connected to the SMSC.
java.lang.IllegalArgumentException - if the message is null or doesn't contain the information required for cancelling the message (e.g. missing message ID).
MessageException - if cancellation failed.

replace

public void replace(Message oldMessage,
                    Message newMessage)
             throws java.lang.UnsupportedOperationException,
                    java.lang.IllegalStateException,
                    java.lang.IllegalArgumentException,
                    MessageException
Replace a previously submitted message. The message can only be replaced if it has not yet been delivered to the recipient. Please note that only the following attributes of a Message will be replaced: Please make sure that the message type (alphabet, coding group, etc.) of the new message matches the message to be replaced.

Specified by:
replace in interface SmsService
Parameters:
oldMessage - the previously sent message to replace.
newMessage - the replacement message.
Throws:
java.lang.UnsupportedOperationException - if the service is not bound as transceiver or BIND_TRANSMITTER.
java.lang.IllegalStateException - if the service is not initialized or not connected to the SMSC.
java.lang.IllegalArgumentException - if the old- and/or new message is null or the old message has no ID.
MessageException - if replacement failed.
Since:
jSMS 2.1.8


object XP, Inc. © 2000-2008. All rights reserved object XP