/** Returns the command status of the PDU. */ public int getCommandStatus() { checkHeader(); return header.getCommandStatus(); }
/** * Sets the command status, i.e. error status of the PDU. */ public void setCommandStatus(int cmdStatus) { checkHeader(); header.setCommandStatus(cmdStatus); }
/** * Parses the header from the buffer. * Also sets the flag that the sequence number was changed as it was read * from the binary buffer. * @param buffer the buffer which contains the PDU * @see PDUHeader#setData(ByteBuffer) */ private void setHeader(ByteBuffer buffer) throws NotEnoughDataInByteBufferException { checkHeader(); header.setData(buffer); sequenceNumberChanged = true; }
/** * Returns the command id of the PDU object. * The command id can be either read from the binary data received from SMSC * or can be set by derived class as the command id of the PDU which is * represented by the class. */ public int getCommandId() { checkHeader(); return header.getCommandId(); }
/** * Returns the sequence number of the PDU. * If the PDU is created by yourself and not parsed from binary data * received from SMSC, then the sequence number will be very likely * incorrect until you didn't set it previously by calling function * <code>assignSequenceNumber</code> or <code>setSequenceNumber</code>. * @see #assignSequenceNumber() * @see #setSequenceNumber(int) */ public int getSequenceNumber() { checkHeader(); return header.getSequenceNumber(); }
/** Creates the binary PDU header from the header fields of the PDU. */ private ByteBuffer getHeader() { checkHeader(); return header.getData(); }
/** * Returns the length of this PDU. * The length is only valid if you probe the PDU which was parsed from * binary data received from SMSC. If you created the PDU and filled in the * filds of the PDU, the length returned by this function will be very * likely incorrect. */ public int getCommandLength() { checkHeader(); return header.getCommandLength(); }
/** * Sets the length of the PDU. Don't do it manually, it won't have * any wffect. */ public void setCommandLength(int cmdLen) { checkHeader(); header.setCommandLength(cmdLen); }
/** Sets the command id. */ public void setCommandId(int cmdId) { checkHeader(); header.setCommandId(cmdId); }
/** * Sets the sequence number of the PDU. * For PDUs whic are about to be sent to SMSC the sequence number is * generated automatically in the <code>Transmitter</code> class and * under normal cicumstances there is no need to set it explicitly. */ public void setSequenceNumber(int seqNr) { checkHeader(); header.setSequenceNumber(seqNr); sequenceNumberChanged = true; }
/** * Initialises PDU with given command id. Derived classes should * provide correct command id for their type, e.g. SubmitSM should * provide <code>Data.SUBMIT_SM</code>, which is equal to 4 (as defined * in SMPP 3.4 spec.) * * @param commandId the numerical id of the PDU as specified in SMPP * specification */ public PDU(int commandId) { super(); checkHeader(); setCommandId(commandId); }