public abstract class Pdu extends Object
| Constructor and Description |
|---|
Pdu(int commandId,
String name,
boolean isRequest) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOptionalParameter(Tlv tlv)
Adds an optional parameter to this PDU.
|
protected abstract void |
appendBodyToString(StringBuilder buffer) |
protected void |
appendOptionalParameterToString(StringBuilder buffer) |
int |
calculateAndSetCommandLength()
Calculates and sets the commandLength for the PDU based on all currently
set values and optional parameters.
|
protected abstract int |
calculateByteSizeOfBody() |
protected int |
calculateByteSizeOfOptionalParameters() |
protected int |
findOptionalParameter(short tag) |
int |
getCommandId() |
int |
getCommandLength() |
int |
getCommandStatus() |
String |
getName() |
Tlv |
getOptionalParameter(short tag)
Gets a TLV by tag.
|
int |
getOptionalParameterCount() |
ArrayList<Tlv> |
getOptionalParameters()
Gets the current list of optional parameters.
|
Object |
getReferenceObject() |
int |
getSequenceNumber() |
boolean |
hasCommandLengthCalculated() |
boolean |
hasOptionalParameter(short tag)
Checks if an optional parameter by tag exists.
|
boolean |
hasSequenceNumberAssigned() |
boolean |
isRequest() |
boolean |
isResponse() |
abstract void |
readBody(org.jboss.netty.buffer.ChannelBuffer buffer) |
void |
readOptionalParameters(org.jboss.netty.buffer.ChannelBuffer buffer,
PduTranscoderContext context) |
void |
removeCommandLength() |
Tlv |
removeOptionalParameter(short tag)
Removes an optional parameter by tag.
|
void |
removeSequenceNumber() |
void |
setCommandLength(int value) |
void |
setCommandStatus(int value) |
Tlv |
setOptionalParameter(Tlv tlv)
Sets an optional parameter by checking if the tag already exists in our
list of optional parameters.
|
void |
setReferenceObject(Object value) |
void |
setSequenceNumber(int value) |
String |
toString() |
abstract void |
writeBody(org.jboss.netty.buffer.ChannelBuffer buffer) |
void |
writeOptionalParameters(org.jboss.netty.buffer.ChannelBuffer buffer,
PduTranscoderContext context) |
public Pdu(int commandId, String name, boolean isRequest)
public void setReferenceObject(Object value)
public Object getReferenceObject()
public String getName()
public boolean isRequest()
public boolean isResponse()
public boolean hasCommandLengthCalculated()
public void removeCommandLength()
public void setCommandLength(int value)
public int getCommandLength()
public int calculateAndSetCommandLength()
public int getCommandId()
public void setCommandStatus(int value)
public int getCommandStatus()
public boolean hasSequenceNumberAssigned()
public void removeSequenceNumber()
public void setSequenceNumber(int value)
public int getSequenceNumber()
public int getOptionalParameterCount()
public ArrayList<Tlv> getOptionalParameters()
public void addOptionalParameter(Tlv tlv)
tlv - The TLV to addsetOptionalParameter(com.cloudhopper.smpp.tlv.Tlv)public Tlv removeOptionalParameter(short tag)
tag - That tag to removepublic Tlv setOptionalParameter(Tlv tlv)
tlv - The TLV to add/setpublic boolean hasOptionalParameter(short tag)
tag - The TLV to search forprotected int findOptionalParameter(short tag)
public Tlv getOptionalParameter(short tag)
tag - The TLV tag to search forprotected abstract int calculateByteSizeOfBody()
public abstract void readBody(org.jboss.netty.buffer.ChannelBuffer buffer)
throws UnrecoverablePduException,
RecoverablePduException
public abstract void writeBody(org.jboss.netty.buffer.ChannelBuffer buffer)
throws UnrecoverablePduException,
RecoverablePduException
protected abstract void appendBodyToString(StringBuilder buffer)
protected int calculateByteSizeOfOptionalParameters()
public void readOptionalParameters(org.jboss.netty.buffer.ChannelBuffer buffer,
PduTranscoderContext context)
throws UnrecoverablePduException,
RecoverablePduException
public void writeOptionalParameters(org.jboss.netty.buffer.ChannelBuffer buffer,
PduTranscoderContext context)
throws UnrecoverablePduException,
RecoverablePduException
protected void appendOptionalParameterToString(StringBuilder buffer)
Copyright © 2009-2014 Cloudhopper by Twitter. All Rights Reserved.