org.jsmpp.session
Interface BaseResponseHandler

All Known Subinterfaces:
ResponseHandler, ServerResponseHandler

public interface BaseResponseHandler

Author:
uudashr

Method Summary
 void notifyUnbonded()
          Notify for unbind.
 DataSmResult processDataSm(DataSm dataSm)
          Process the data short message.
 PendingResponse<Command> removeSentItem(int sequenceNumber)
          Remove the previously PendingResponse that set when the request was sent.
 void sendDataSmResp(DataSmResult dataSmResult, int sequenceNumber)
          Response by sending DATA_SM_RESP to SMSC.
 void sendEnquireLinkResp(int sequenceNumber)
          Response by sending ENQUIRE_LINK_RESP.
 void sendGenerickNack(int commandStatus, int sequenceNumber)
          Response by sending GENERICK_NACK.
 void sendNegativeResponse(int originalCommandId, int commandStatus, int sequenceNumber)
          Response by sending negative response.
 void sendUnbindResp(int sequenceNumber)
          Response by send UNBIND_RESP.
 

Method Detail

removeSentItem

PendingResponse<Command> removeSentItem(int sequenceNumber)
Remove the previously PendingResponse that set when the request was sent.

Parameters:
sequenceNumber - the sequence number of the request.
Returns:
the PendingResponse correspond to specified sequenceNumber. Return null if the the mapped sequenceNumber not found

sendGenerickNack

void sendGenerickNack(int commandStatus,
                      int sequenceNumber)
                      throws java.io.IOException
Response by sending GENERICK_NACK.

Parameters:
commandStatus - is the command status.
sequenceNumber - is the sequence number original PDU if can be decoded.
Throws:
java.io.IOException - if an IO error occur.

sendNegativeResponse

void sendNegativeResponse(int originalCommandId,
                          int commandStatus,
                          int sequenceNumber)
                          throws java.io.IOException
Response by sending negative response.

Parameters:
originalCommandId - is the original command id.
commandStatus - is the command status.
sequenceNumber - is the sequence number of original PDU request.
Throws:
java.io.IOException - if an IO error occur.

sendEnquireLinkResp

void sendEnquireLinkResp(int sequenceNumber)
                         throws java.io.IOException
Response by sending ENQUIRE_LINK_RESP.

Parameters:
sequenceNumber - is the sequence number of original ENQUIRE_LINK request.
Throws:
java.io.IOException - if an IO error occur.

sendUnbindResp

void sendUnbindResp(int sequenceNumber)
                    throws java.io.IOException
Response by send UNBIND_RESP.

Parameters:
sequenceNumber - is the sequence number of original UNBIND request.
Throws:
java.io.IOException - if an IO error occur.

processDataSm

DataSmResult processDataSm(DataSm dataSm)
                           throws ProcessRequestException
Process the data short message.

Parameters:
dataSm - is the data short message.
Returns:
the result for response.
Throws:
ProcessRequestException - if there is a failure when processing data_sm.

sendDataSmResp

void sendDataSmResp(DataSmResult dataSmResult,
                    int sequenceNumber)
                    throws java.io.IOException
Response by sending DATA_SM_RESP to SMSC.

Parameters:
dataSmResult - is the result of data_sm.
sequenceNumber - is the sequence number of original DATA_SM request.
Throws:
java.io.IOException - if an IO error occur.

notifyUnbonded

void notifyUnbonded()
Notify for unbind.