Constructors Summary |
---|
public SendReq()
super();
try {
setMessageType(PduHeaders.MESSAGE_TYPE_SEND_REQ);
setMmsVersion(PduHeaders.CURRENT_MMS_VERSION);
// FIXME: Content-type must be decided according to whether
// SMIL part present.
setContentType("application/vnd.wap.multipart.related".getBytes());
setFrom(new EncodedStringValue(PduHeaders.FROM_INSERT_ADDRESS_TOKEN_STR.getBytes()));
setTransactionId(generateTransactionId());
} catch (InvalidHeaderValueException e) {
// Impossible to reach here since all headers we set above are valid.
Log.e(TAG, "Unexpected InvalidHeaderValueException.", e);
throw new RuntimeException(e);
}
|
public SendReq(byte[] contentType, EncodedStringValue from, int mmsVersion, byte[] transactionId)Constructor, used when composing a M-Send.req pdu.
super();
setMessageType(PduHeaders.MESSAGE_TYPE_SEND_REQ);
setContentType(contentType);
setFrom(from);
setMmsVersion(mmsVersion);
setTransactionId(transactionId);
|
SendReq(PduHeaders headers)Constructor with given headers.
super(headers);
|
SendReq(PduHeaders headers, PduBody body)Constructor with given headers and body
super(headers, body);
|
Methods Summary |
---|
public void | addBcc(EncodedStringValue value)Add a "BCC" value.
mPduHeaders.appendEncodedStringValue(value, PduHeaders.BCC);
|
public void | addCc(EncodedStringValue value)Add a "CC" value.
mPduHeaders.appendEncodedStringValue(value, PduHeaders.CC);
|
private byte[] | generateTransactionId()
String transactionId = "T" + Long.toHexString(System.currentTimeMillis());
return transactionId.getBytes();
|
public EncodedStringValue[] | getBcc()Get Bcc value.
return mPduHeaders.getEncodedStringValues(PduHeaders.BCC);
|
public EncodedStringValue[] | getCc()Get CC value.
return mPduHeaders.getEncodedStringValues(PduHeaders.CC);
|
public byte[] | getContentType()Get Content-type value.
return mPduHeaders.getTextString(PduHeaders.CONTENT_TYPE);
|
public int | getDeliveryReport()Get X-Mms-Delivery-Report value.
return mPduHeaders.getOctet(PduHeaders.DELIVERY_REPORT);
|
public long | getExpiry()Get X-Mms-Expiry value.
Expiry-value = Value-length
(Absolute-token Date-value | Relative-token Delta-seconds-value)
return mPduHeaders.getLongInteger(PduHeaders.EXPIRY);
|
public byte[] | getMessageClass()Get X-Mms-Message-Class value.
Message-class-value = Class-identifier | Token-text
Class-identifier = Personal | Advertisement | Informational | Auto
return mPduHeaders.getTextString(PduHeaders.MESSAGE_CLASS);
|
public long | getMessageSize()Get X-Mms-MessageSize value.
Expiry-value = size of message
return mPduHeaders.getLongInteger(PduHeaders.MESSAGE_SIZE);
|
public int | getReadReport()Get X-Mms-Read-Report value.
return mPduHeaders.getOctet(PduHeaders.READ_REPORT);
|
public byte[] | getTransactionId()Get X-Mms-Transaction-Id field value.
return mPduHeaders.getTextString(PduHeaders.TRANSACTION_ID);
|
public void | setBcc(EncodedStringValue[] value)Set "BCC" value.
mPduHeaders.setEncodedStringValues(value, PduHeaders.BCC);
|
public void | setCc(EncodedStringValue[] value)Set "CC" value.
mPduHeaders.setEncodedStringValues(value, PduHeaders.CC);
|
public void | setContentType(byte[] value)Set Content-type value.
mPduHeaders.setTextString(value, PduHeaders.CONTENT_TYPE);
|
public void | setDeliveryReport(int value)Set X-Mms-Delivery-Report value.
mPduHeaders.setOctet(value, PduHeaders.DELIVERY_REPORT);
|
public void | setExpiry(long value)Set X-Mms-Expiry value.
mPduHeaders.setLongInteger(value, PduHeaders.EXPIRY);
|
public void | setMessageClass(byte[] value)Set X-Mms-Message-Class value.
mPduHeaders.setTextString(value, PduHeaders.MESSAGE_CLASS);
|
public void | setMessageSize(long value)Set X-Mms-MessageSize value.
mPduHeaders.setLongInteger(value, PduHeaders.MESSAGE_SIZE);
|
public void | setReadReport(int value)Set X-Mms-Read-Report value.
mPduHeaders.setOctet(value, PduHeaders.READ_REPORT);
|
public void | setTo(EncodedStringValue[] value)Set "To" value.
mPduHeaders.setEncodedStringValues(value, PduHeaders.TO);
|
public void | setTransactionId(byte[] value)Set X-Mms-Transaction-Id field value.
mPduHeaders.setTextString(value, PduHeaders.TRANSACTION_ID);
|