org.mobicents.slee.resources.smpp.pdu
Class PDUImpl

java.lang.Object
  extended by org.mobicents.slee.resources.smpp.pdu.PDUImpl
All Implemented Interfaces:
java.io.Serializable, PDU
Direct Known Subclasses:
AlertNotificationImpl, BroadcastSMImpl, BroadcastSMRespImpl, CancelBroadcastSMImpl, CancelBroadcastSMRespImpl, CancelSMImpl, CancelSMRespImpl, DataSMImpl, DataSMRespImpl, DeliverSMImpl, DeliverSMRespImpl, GenericNackImpl, QueryBroadcastSMImpl, QueryBroadcastSMRespImpl, QuerySMImpl, QuerySMRespImpl, ReplaceSMImpl, ReplaceSMRespImpl, SubmitMultiImpl, SubmitMultiRespImpl, SubmitSMImpl, SubmitSMRespImpl

public abstract class PDUImpl
extends java.lang.Object
implements PDU

See Also:
Serialized Form

Field Summary
protected  org.mobicents.protocols.smpp.message.SMPPPacket smppPacket
           
 
Constructor Summary
PDUImpl()
           
 
Method Summary
 void addTLV(Tag tag, java.lang.Object value)
          Tagged Length Value (TLV) parameters are identified by a tag, length and value and can be appended to a PDU in any order.
protected  Address convertProtoAddress(org.mobicents.protocols.smpp.Address address)
           
protected  SMPPDate convertProtoDate(org.mobicents.protocols.smpp.util.SMPPDate protoSmppDate)
           
protected  ErrorAddress convertProtoErrorAddress(org.mobicents.protocols.smpp.ErrorAddress errorAddress)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Map<Tag,java.lang.Object> getAllTLVs()
           
 int getCommandId()
           The command_id identifies the SMPP operation e.g.
 int getCommandStatus()
           The command_status represents the means by which an ESME or MC sends an error code to its peer.
 long getSequenceNum()
          Each SMPP request PDU has an identifier called a sequence number that is used to uniquely identify the PDU in the context of its‚Äô originating entity and the current SMPP session.
 java.lang.Object getValue(Tag tag)
           
 int hashCode()
           
 boolean hasTLV(Tag tag)
           
 java.lang.Object removeTLV(Tag tag)
           
 void setSequenceNum(long sequenceNum)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.slee.resources.smpp.pdu.PDU
isTLVPermitted
 

Field Detail

smppPacket

protected org.mobicents.protocols.smpp.message.SMPPPacket smppPacket
Constructor Detail

PDUImpl

public PDUImpl()
Method Detail

getCommandId

public int getCommandId()
Description copied from interface: PDU

The command_id identifies the SMPP operation e.g. submit_sm, bind_transmitter etc. The command_id is encoded as a 4-octet integer value.

Command_ids for request PDUs are allocated from a range of numbers; 0x00000000 to 0x000001FF.

Command_ids for response PDUs are allocated from a range of numbers; 0x80000000 to 0x800001FF.

The relationship between the command_id for a request PDU and its associated response PDU is that bit 31 is cleared for the request and set for the response. For example, replace_sm has a command_id = 0x00000007 and its’ response PDU replace_sm_resp has a command_id = 0x80000007.

Specified by:
getCommandId in interface PDU
Returns:

getCommandStatus

public int getCommandStatus()
Description copied from interface: PDU

The command_status represents the means by which an ESME or MC sends an error code to its peer. This field is only relevant in response PDUs. Thus PDU requests always have this field set to NULL (0x00000000).

When a response PDU carries a non-NULL command_status field, it is indicating some form of error or rejection of the original request PDU. In such circumstances, a PDU body should not be included in the PDU and the command_length of the PDU should therefore be set to 16 (0x00000010). However some ESMEs or Message Centers may always include a PDU body regardless of the command_status being returned. In such circumstances, the receiving ESME or MC should ignore its contents, based on the knowledge that the original request failed.

Specified by:
getCommandStatus in interface PDU
Returns:

getSequenceNum

public long getSequenceNum()
Description copied from interface: PDU
Each SMPP request PDU has an identifier called a sequence number that is used to uniquely identify the PDU in the context of its’ originating entity and the current SMPP session. The resulting response PDU (which must be returned on the same SMPP session) is expected to mirror the sequence number of the original request.

Specified by:
getSequenceNum in interface PDU
Returns:

setSequenceNum

public void setSequenceNum(long sequenceNum)

addTLV

public void addTLV(Tag tag,
                   java.lang.Object value)
            throws TLVNotPermittedException
Description copied from interface: PDU
Tagged Length Value (TLV) parameters are identified by a tag, length and value and can be appended to a PDU in any order. The only requirement is that the PDU’s standard fields are first encoded, and then followed by the TLV parameters. Otherwise, the PDU decoding by the peer would be unable to decode the PDU.

Specified by:
addTLV in interface PDU
Throws:
TLVNotPermittedException

getAllTLVs

public java.util.Map<Tag,java.lang.Object> getAllTLVs()
Specified by:
getAllTLVs in interface PDU

getValue

public java.lang.Object getValue(Tag tag)
Specified by:
getValue in interface PDU

hasTLV

public boolean hasTLV(Tag tag)
Specified by:
hasTLV in interface PDU

removeTLV

public java.lang.Object removeTLV(Tag tag)
Specified by:
removeTLV in interface PDU

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

convertProtoDate

protected SMPPDate convertProtoDate(org.mobicents.protocols.smpp.util.SMPPDate protoSmppDate)

convertProtoAddress

protected Address convertProtoAddress(org.mobicents.protocols.smpp.Address address)

convertProtoErrorAddress

protected ErrorAddress convertProtoErrorAddress(org.mobicents.protocols.smpp.ErrorAddress errorAddress)


Copyright © 2011. All Rights Reserved.