org.jsmpp.util
Class DefaultDecomposer

java.lang.Object
  extended by org.jsmpp.util.DefaultDecomposer
All Implemented Interfaces:
PDUDecomposer

public class DefaultDecomposer
extends java.lang.Object
implements PDUDecomposer

Default implementation of SMPP PDU PDUDecomposer.

Since:
1.0
Version:
1.0
Author:
uudashr

Constructor Summary
DefaultDecomposer()
          Default constructor.
 
Method Summary
 AlertNotification alertNotification(byte[] data)
           
 Bind bind(byte[] b)
          Decompose the SMPP PDU bind command.
 BindResp bindResp(byte[] b)
          Decompose the SMPP PDU bind response command.
 CancelSm cancelSm(byte[] data)
          Decompose the SMPP PDU cancel short message command.
 CancelSmResp cancelSmResp(byte[] data)
          Decompose the SMPP PDU cancel short message response command.
 DataSm dataSm(byte[] data)
          Decompose the SMPP PDU data short message command.
 DataSmResp dataSmResp(byte[] data)
          Decompose the SMPP PDU data short message response command.
 DeliverSm deliverSm(byte[] b)
          Decompose the SMPP PDU deliver short message command.
 DeliverSmResp deliverSmResp(byte[] b)
          Decompose the SMPP PDU deliver short message response command.
 DeliveryReceipt deliveryReceipt(byte[] data)
          Decompose the SMPP PDU delivery receipt content.
 DeliveryReceipt deliveryReceipt(java.lang.String data)
          Decompose the SMPP PDU delivery receipt content.
 EnquireLink enquireLink(byte[] b)
          Decompose the SMPP PDU enquire link command.
 EnquireLinkResp enquireLinkResp(byte[] b)
          Decompose the SMPP PDU enquire link response command.
 GenericNack genericNack(byte[] b)
          Decompose the SMPP PDU generic nack command.
static PDUDecomposer getInstance()
           
 Command header(byte[] b)
          Decompose the header only SMPP PDU command.
 Outbind outbind(byte[] b)
          Decompose the SMPP PDU outbind command.
 QuerySm querySm(byte[] b)
          Decompose the SMPP PDU query short message command.
 QuerySmResp querySmResp(byte[] b)
          Decompose the SMPP PDU query short message reponse command.
 ReplaceSm replaceSm(byte[] data)
           
 ReplaceSmResp replaceSmResp(byte[] data)
           
 SubmitMulti submitMulti(byte[] data)
           
 SubmitMultiResp submitMultiResp(byte[] data)
           
 SubmitSm submitSm(byte[] b)
          Decompose the SMPP PDU submit short message command.
 SubmitSmResp submitSmResp(byte[] b)
          Decompose the SMPP PDU submit short message response command.
 Unbind unbind(byte[] b)
          Decompose the SMPP PDU unbind command.
 UnbindResp unbindResp(byte[] b)
          Decompose the SMPP PDU unbind response command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDecomposer

public DefaultDecomposer()
Default constructor.

Method Detail

getInstance

public static final PDUDecomposer getInstance()

header

public Command header(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the header only SMPP PDU command.

Specified by:
header in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the header ( Command ) object.

bind

public Bind bind(byte[] b)
          throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU bind command.

Specified by:
bind in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the bind command object. PDUStringException if there is an invalid constraint of string parameter found.
Throws:
PDUStringException

bindResp

public BindResp bindResp(byte[] b)
                  throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU bind response command.

Specified by:
bindResp in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the bind response command object.
Throws:
PDUStringException

unbind

public Unbind unbind(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU unbind command.

Specified by:
unbind in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the unbind command object.

unbindResp

public UnbindResp unbindResp(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU unbind response command.

Specified by:
unbindResp in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the unbind response command object.

outbind

public Outbind outbind(byte[] b)
                throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU outbind command.

Specified by:
outbind in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the outbind command object. PDUStringException if there is an invalid constraint of string parameter found.
Throws:
PDUStringException

enquireLink

public EnquireLink enquireLink(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU enquire link command.

Specified by:
enquireLink in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the enquire link command object.

enquireLinkResp

public EnquireLinkResp enquireLinkResp(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU enquire link response command.

Specified by:
enquireLinkResp in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the enquire link response command object.

genericNack

public GenericNack genericNack(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU generic nack command.

Specified by:
genericNack in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the generic nack command object.

submitSm

public SubmitSm submitSm(byte[] b)
                  throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU submit short message command.

Specified by:
submitSm in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the submit short message command object. PDUStringException if there is an invalid constraint of string parameter found.
Throws:
PDUStringException

submitSmResp

public SubmitSmResp submitSmResp(byte[] b)
                          throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU submit short message response command.

Specified by:
submitSmResp in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the submit short message response command object. PDUStringException if there is an invalid constraint of string parameter found.
Throws:
PDUStringException

querySm

public QuerySm querySm(byte[] b)
                throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU query short message command.

Specified by:
querySm in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the query short message command object. PDUStringException if there is an invalid constraint of string parameter found.
Throws:
PDUStringException

querySmResp

public QuerySmResp querySmResp(byte[] b)
                        throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU query short message reponse command.

Specified by:
querySmResp in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the query short message response command object. PDUStringException if there is an invalid constraint of string parameter found.
Throws:
PDUStringException

deliverSm

public DeliverSm deliverSm(byte[] b)
                    throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU deliver short message command.

Specified by:
deliverSm in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the deliver short message command object.
Throws:
PDUStringException - if there is an invalid constraint of string parameter found.

deliverSmResp

public DeliverSmResp deliverSmResp(byte[] b)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU deliver short message response command.

Specified by:
deliverSmResp in interface PDUDecomposer
Parameters:
b - is the PDU.
Returns:
the deliver short message response command object.

deliveryReceipt

public DeliveryReceipt deliveryReceipt(java.lang.String data)
                                throws InvalidDeliveryReceiptException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU delivery receipt content.

Specified by:
deliveryReceipt in interface PDUDecomposer
Parameters:
data - is the content.
Returns:
the delivery receipt object.
Throws:
InvalidDeliveryReceiptException - throw if the data is invalid, so it can be parsed.

deliveryReceipt

public DeliveryReceipt deliveryReceipt(byte[] data)
                                throws InvalidDeliveryReceiptException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU delivery receipt content.

Specified by:
deliveryReceipt in interface PDUDecomposer
Parameters:
data - is the content.
Returns:
the delivery receipt object.
Throws:
InvalidDeliveryReceiptException - throw if the data is invalid, so it can be parsed.

dataSm

public DataSm dataSm(byte[] data)
              throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU data short message command.

Specified by:
dataSm in interface PDUDecomposer
Parameters:
data - is the PDU.
Returns:
the data short message command object.
Throws:
PDUStringException - if there is an invalid constraint of string parameter found.

dataSmResp

public DataSmResp dataSmResp(byte[] data)
                      throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU data short message response command.

Specified by:
dataSmResp in interface PDUDecomposer
Parameters:
data - is the PDU.
Returns:
the data short message command object.
Throws:
PDUStringException

cancelSm

public CancelSm cancelSm(byte[] data)
                  throws PDUStringException
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU cancel short message command.

Specified by:
cancelSm in interface PDUDecomposer
Parameters:
data - is the PDU.
Returns:
the cancel short message command object.
Throws:
PDUStringException - if there is an invalid constraint of string parameter found.

cancelSmResp

public CancelSmResp cancelSmResp(byte[] data)
Description copied from interface: PDUDecomposer
Decompose the SMPP PDU cancel short message response command.

Specified by:
cancelSmResp in interface PDUDecomposer
Parameters:
data - is the PDU.
Returns:
the cancel short message command object.

submitMulti

public SubmitMulti submitMulti(byte[] data)
                        throws PDUStringException,
                               InvalidNumberOfDestinationsException
Specified by:
submitMulti in interface PDUDecomposer
Throws:
PDUStringException
InvalidNumberOfDestinationsException

submitMultiResp

public SubmitMultiResp submitMultiResp(byte[] data)
                                throws PDUStringException
Specified by:
submitMultiResp in interface PDUDecomposer
Throws:
PDUStringException

replaceSm

public ReplaceSm replaceSm(byte[] data)
                    throws PDUStringException
Specified by:
replaceSm in interface PDUDecomposer
Throws:
PDUStringException

replaceSmResp

public ReplaceSmResp replaceSmResp(byte[] data)
Specified by:
replaceSmResp in interface PDUDecomposer

alertNotification

public AlertNotification alertNotification(byte[] data)
                                    throws PDUStringException
Specified by:
alertNotification in interface PDUDecomposer
Throws:
PDUStringException