Version
BaseSm
public abstract class BaseSm
Extends: PduRequest
BaseSm is an abstract base class for all SMPP message-related commands that carry or reference a short message. This includes PDUs such as SubmitSm, DeliverSm, DataSm, and SubmitMulti. It provides core fields and logic related to message content, addressing, delivery scheduling, and encoding settings.
Fields (Inherited from Pdu)
PDU_HEADER_LENGTH, PDU_INT_LENGTH
Constructor:
public BaseSm(CommandType commandId, String name)
commandId: SMPP command type (e.g., SUBMIT_SM).
name: Human-readable command name.
Initializes a new message-carrying PDU with the given command identifier and name.
Methods:
int getShortMessageLength() | Returns the length of the short message body. |
byte[] getShortMessage() | Retrieves the short message content. |
void setShortMessage(byte[] value) | Sets the message payload. May throw SmppInvalidArgumentException. |
byte getReplaceIfPresent() | Gets the flag that controls message replacement. |
void setReplaceIfPresent(byte value) | Sets the message replacement flag. |
byte getDataCoding() | Returns the data coding scheme used (e.g., GSM, UCS2). |
void setDataCoding(byte value) | Sets the data coding value. |
byte getDefaultMsgId() | Gets the default pre-defined message ID. |
void setDefaultMsgId(byte value) | Sets the default pre-defined message ID. |
byte getRegisteredDelivery() | Gets delivery receipt settings. |
void setRegisteredDelivery(byte value) | Configures whether delivery receipts are requested. |
String getValidityPeriod() | Gets the validity period for the message. |
void setValidityPeriod(String value) | Sets the validity period. |
String getScheduleDeliveryTime() | Gets the time the message should be delivered. |
void setScheduleDeliveryTime(String value) | Sets a scheduled delivery time. |
byte getPriority() | Gets the delivery priority value. |
void setPriority(byte value) | Sets delivery priority. |
byte getEsmClass() | Gets the ESM class, which affects message type/handling. |
void setEsmClass(byte value) | Sets the ESM class. |
byte getProtocolId() | Gets the protocol ID. |
void setProtocolId(byte value) | Sets the protocol ID. |
String getServiceType() | Returns the service type string. |
void setServiceType(String value) | Sets the service type (used for routing/categorization). |
Address getSourceAddress() | Gets the sender's address. |
void setSourceAddress(Address value) | Sets the sender’s address. |
Address getDestAddress() | Gets the destination address. |
void setDestAddress(Address value) | Sets the destination address. |
void readBody(ByteBuf buffer) | Deserializes the full body from binary. |
void writeBody(ByteBuf buffer) | Serializes the full body into binary. |
int calculateByteSizeOfBody() | Returns the total size of the body fields. |
void appendBodyToString(StringBu ilder buffer) |
Appends a text representation of the body (for logs/debug). |
Methods inherited from class com.mobius.software.protocols.smpp.PduRequest |
|
createGenericNack, createResponse, getResponseClass | |
Methods inherited from class com.mobius.software.protocols.smpp.Pdu |
|
addOptionalParameter, calculateAndSetCommandLength, getCommandId, getCommandLength, getCommandStatus, getName, getOptionalParameter, getOptionalParameterCount, getOptionalParameters, getReferenceObject, getSequenceNumber, hasCommandLengthCalculated, hasOptionalParameter, hasSequenceNumberAssigned, isRequest, isResponse, readOptionalParameters, removeCommandLength, removeOptionalParameter, removeSequenceNumber, setCommandLength, setCommandStatus, setOptionalParameter, setReferenceObject, setSequenceNumber, toString, writeOptionalParameters | |
Methods inherited from class java.lang.Object |
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Start innovating with Mobius
What's next? Let's talk!