org.jsmpp.session
Interface ClientSession

All Superinterfaces:
Session
All Known Implementing Classes:
SMPPSession

public interface ClientSession
extends Session

This interface provides all operation that the client session can do. It doesn't distinct the operation of specific session type (Transmitter, Receiver) it's just like Transceiver. The distinction might should be recognized in a different way, such as by user code when they do a binding or by throwing exception when invoking illegal operation.

Author:
uudashr

Method Summary
 void cancelShortMessage(java.lang.String serviceType, java.lang.String messageId, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, java.lang.String sourceAddr, TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi, java.lang.String destinationAddress)
          Cancel the previous submitted short message.
 QuerySmResult queryShortMessage(java.lang.String messageId, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, java.lang.String sourceAddr)
          Query previous submitted short message based on it's message_id and message_id.
 void replaceShortMessage(java.lang.String messageId, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, java.lang.String sourceAddr, java.lang.String scheduleDeliveryTime, java.lang.String validityPeriod, RegisteredDelivery registeredDelivery, byte smDefaultMsgId, byte[] shortMessage)
          Replace the previous submitted short message.
 SubmitMultiResult submitMultiple(java.lang.String serviceType, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, java.lang.String sourceAddr, Address[] destinationAddresses, ESMClass esmClass, byte protocolId, byte priorityFlag, java.lang.String scheduleDeliveryTime, java.lang.String validityPeriod, RegisteredDelivery registeredDelivery, ReplaceIfPresentFlag replaceIfPresentFlag, DataCoding dataCoding, byte smDefaultMsgId, byte[] shortMessage, OptionalParameter[] optionalParameters)
          Submit short message to multiple destination address.
 java.lang.String submitShortMessage(java.lang.String serviceType, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, java.lang.String sourceAddr, TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi, java.lang.String destinationAddr, ESMClass esmClass, byte protocolId, byte priorityFlag, java.lang.String scheduleDeliveryTime, java.lang.String validityPeriod, RegisteredDelivery registeredDelivery, byte replaceIfPresentFlag, DataCoding dataCoding, byte smDefaultMsgId, byte[] shortMessage, OptionalParameter... optionalParameters)
          Submit a short message to specified destination address.
 
Methods inherited from interface org.jsmpp.session.Session
addSessionStateListener, close, dataShortMessage, getEnquireLinkTimer, getLastActivityTimestamp, getSessionId, getSessionState, getTransactionTimer, removeSessionStateListener, setEnquireLinkTimer, setTransactionTimer, unbindAndClose
 

Method Detail

submitShortMessage

java.lang.String submitShortMessage(java.lang.String serviceType,
                                    TypeOfNumber sourceAddrTon,
                                    NumberingPlanIndicator sourceAddrNpi,
                                    java.lang.String sourceAddr,
                                    TypeOfNumber destAddrTon,
                                    NumberingPlanIndicator destAddrNpi,
                                    java.lang.String destinationAddr,
                                    ESMClass esmClass,
                                    byte protocolId,
                                    byte priorityFlag,
                                    java.lang.String scheduleDeliveryTime,
                                    java.lang.String validityPeriod,
                                    RegisteredDelivery registeredDelivery,
                                    byte replaceIfPresentFlag,
                                    DataCoding dataCoding,
                                    byte smDefaultMsgId,
                                    byte[] shortMessage,
                                    OptionalParameter... optionalParameters)
                                    throws PDUException,
                                           ResponseTimeoutException,
                                           InvalidResponseException,
                                           NegativeResponseException,
                                           java.io.IOException
Submit a short message to specified destination address. This method will blocks until response received or timeout reached. This method simplify operations of sending SUBMIT_SM command and receiving the SUBMIT_SM_RESP.

Parameters:
serviceType - is the service_type.
sourceAddrTon - is the source_addr_ton.
sourceAddrNpi - is the source_addr_npi.
sourceAddr - is the source_addr.
destAddrTon - is the dest_addr_ton.
destAddrNpi - is the dest_addr_npi.
destinationAddr - is the destination_addr.
esmClass - is the esm_class.
protocolId - is the protocol_id.
priorityFlag - is the priority_flag.
scheduleDeliveryTime - is the schedule_delivery_time.
validityPeriod - is the validity_period.
registeredDelivery - is the registered_delivery.
replaceIfPresentFlag - is the replace_if_present_flag.
dataCoding - is the data_coding.
smDefaultMsgId - is the sm_default_msg_id.
shortMessage - is the short_message.
optionalParameters - is the optional parameters.
Returns:
the message_id to identified the submitted short message for later use (delivery receipt, QUERY_SM, CANCEL_SM, REPLACE_SM).
Throws:
PDUException - if there is invalid PDU parameter found..
ResponseTimeoutException - if timeout has been reach.
InvalidResponseException - if response is invalid.
NegativeResponseException - if negative response received.
java.io.IOException - if there is an I/O error found.

submitMultiple

SubmitMultiResult submitMultiple(java.lang.String serviceType,
                                 TypeOfNumber sourceAddrTon,
                                 NumberingPlanIndicator sourceAddrNpi,
                                 java.lang.String sourceAddr,
                                 Address[] destinationAddresses,
                                 ESMClass esmClass,
                                 byte protocolId,
                                 byte priorityFlag,
                                 java.lang.String scheduleDeliveryTime,
                                 java.lang.String validityPeriod,
                                 RegisteredDelivery registeredDelivery,
                                 ReplaceIfPresentFlag replaceIfPresentFlag,
                                 DataCoding dataCoding,
                                 byte smDefaultMsgId,
                                 byte[] shortMessage,
                                 OptionalParameter[] optionalParameters)
                                 throws PDUException,
                                        ResponseTimeoutException,
                                        InvalidResponseException,
                                        NegativeResponseException,
                                        java.io.IOException
Submit short message to multiple destination address. It's similar to submit short message, but it sending to multiple address. This method will blocks until response received or timeout reached. This method is simplify operations of sending SUBMIT_MULTI and receiving SUBMIT_MULTI_RESP.

Parameters:
serviceType - is the service_type.
sourceAddrTon - is the source_addr_ton.
sourceAddrNpi - is the source_addr_npi.
sourceAddr - is the source_addr.
destinationAddresses - is the destination addresses.
esmClass - is the esm_class.
protocolId - is the protocol_id.
priorityFlag - is the priority_flag.
scheduleDeliveryTime - is the schedule_delivery_time.
validityPeriod - is the validity_period.
registeredDelivery - is the registered_delivery.
replaceIfPresentFlag - is the replace_if_present_flag.
dataCoding - is the data_coding.
smDefaultMsgId - is the sm_default_msg_id.
shortMessage - is the short_message.
optionalParameters - is the optional parameters.
Returns:
the message_id and the un-success deliveries.
Throws:
PDUException - if there is invalid PDU parameter found.
ResponseTimeoutException - if timeout has been reach.
InvalidResponseException - if response is invalid.
NegativeResponseException - if negative response received.
java.io.IOException - if there is an I/O error found.

queryShortMessage

QuerySmResult queryShortMessage(java.lang.String messageId,
                                TypeOfNumber sourceAddrTon,
                                NumberingPlanIndicator sourceAddrNpi,
                                java.lang.String sourceAddr)
                                throws PDUException,
                                       ResponseTimeoutException,
                                       InvalidResponseException,
                                       NegativeResponseException,
                                       java.io.IOException
Query previous submitted short message based on it's message_id and message_id. This method will blocks until response received or timeout reached. This method is simplify operations of sending QUERY_SM and receiving QUERY_SM_RESP.

Parameters:
messageId - is the message_id.
sourceAddrTon - is the source_addr_ton.
sourceAddrNpi - is the source_addr_npi.
sourceAddr - is the source_addr.
Returns:
the result of query short message.
Throws:
PDUException - if there is invalid PDU parameter found.
ResponseTimeoutException - if timeout has been reach.
InvalidResponseException - if response is invalid.
NegativeResponseException - if negative response received.
java.io.IOException - if there is an I/O error found.

cancelShortMessage

void cancelShortMessage(java.lang.String serviceType,
                        java.lang.String messageId,
                        TypeOfNumber sourceAddrTon,
                        NumberingPlanIndicator sourceAddrNpi,
                        java.lang.String sourceAddr,
                        TypeOfNumber destAddrTon,
                        NumberingPlanIndicator destAddrNpi,
                        java.lang.String destinationAddress)
                        throws PDUException,
                               ResponseTimeoutException,
                               InvalidResponseException,
                               NegativeResponseException,
                               java.io.IOException
Cancel the previous submitted short message. This method will blocks until response received or timeout reached. This method is simplify operations of sending CANCEL_SM and receiving CANCEL_SM_RESP.

Parameters:
serviceType - is the service_type.
messageId - is the message_id.
sourceAddrTon - is the source_addr_ton.
sourceAddrNpi - is the source_addr_npi.
sourceAddr - is the source_addr.
destAddrTon - is the dest_addr_ton.
destAddrNpi - is the dest_addr_npi.
destinationAddress - is destination_address.
Throws:
PDUException - if there is invalid PDU parameter found.
ResponseTimeoutException - if timeout has been reach.
InvalidResponseException - if response is invalid.
NegativeResponseException - if negative response received.
java.io.IOException - if there is an I/O error found.

replaceShortMessage

void replaceShortMessage(java.lang.String messageId,
                         TypeOfNumber sourceAddrTon,
                         NumberingPlanIndicator sourceAddrNpi,
                         java.lang.String sourceAddr,
                         java.lang.String scheduleDeliveryTime,
                         java.lang.String validityPeriod,
                         RegisteredDelivery registeredDelivery,
                         byte smDefaultMsgId,
                         byte[] shortMessage)
                         throws PDUException,
                                ResponseTimeoutException,
                                InvalidResponseException,
                                NegativeResponseException,
                                java.io.IOException
Replace the previous submitted short message. This method will blocks until response received or timeout reached. This method is simplify operations of sending REPLACE_SM and receiving REPLACE_SM_RESP.

Parameters:
messageId - is the message_id.
sourceAddrTon - is the source_addr_ton.
sourceAddrNpi - is the source_addr_npi.
sourceAddr - is the source_addr.
scheduleDeliveryTime - is the schedule_delivery_time.
validityPeriod - is the validity_period.
registeredDelivery - is the registered_delivery.
smDefaultMsgId - is the sm_default_msg_id.
shortMessage - is the short_message.
Throws:
PDUException - if there is invalid PDU parameter found.
ResponseTimeoutException - if timeout has been reach.
InvalidResponseException - if response is invalid.
NegativeResponseException - if negative response received.
java.io.IOException - if there is an I/O error found.