FileDocCategorySizeDatePackage
SendReq.javaAPI DocAndroid 5.1 API10126Thu Mar 12 22:22:54 GMT 2015com.google.android.mms.pdu

SendReq

public class SendReq extends MultimediaMessagePdu

Fields Summary
private static final String
TAG
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.

param
contentType the content type value
param
from the from value
param
mmsVersion current viersion of mms
param
transactionId the transaction-id value
throws
InvalidHeaderValueException if parameters are invalid. NullPointerException if contentType, form or transactionId is null.

        super();
        setMessageType(PduHeaders.MESSAGE_TYPE_SEND_REQ);
        setContentType(contentType);
        setFrom(from);
        setMmsVersion(mmsVersion);
        setTransactionId(transactionId);
    
SendReq(PduHeaders headers)
Constructor with given headers.

param
headers Headers for this PDU.

        super(headers);
    
SendReq(PduHeaders headers, PduBody body)
Constructor with given headers and body

param
headers Headers for this PDU.
param
body Body of this PDu.

        super(headers, body);
    
Methods Summary
public voidaddBcc(EncodedStringValue value)
Add a "BCC" value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.appendEncodedStringValue(value, PduHeaders.BCC);
    
public voidaddCc(EncodedStringValue value)
Add a "CC" value.

param
value the value
throws
NullPointerException if the value is null.

        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
the value

        return mPduHeaders.getEncodedStringValues(PduHeaders.BCC);
    
public EncodedStringValue[]getCc()
Get CC value.

return
the value

        return mPduHeaders.getEncodedStringValues(PduHeaders.CC);
    
public byte[]getContentType()
Get Content-type value.

return
the value

        return mPduHeaders.getTextString(PduHeaders.CONTENT_TYPE);
    
public intgetDeliveryReport()
Get X-Mms-Delivery-Report value.

return
the value

        return mPduHeaders.getOctet(PduHeaders.DELIVERY_REPORT);
    
public longgetExpiry()
Get X-Mms-Expiry value. Expiry-value = Value-length (Absolute-token Date-value | Relative-token Delta-seconds-value)

return
the 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
the value

        return mPduHeaders.getTextString(PduHeaders.MESSAGE_CLASS);
    
public longgetMessageSize()
Get X-Mms-MessageSize value. Expiry-value = size of message

return
the value

        return mPduHeaders.getLongInteger(PduHeaders.MESSAGE_SIZE);
    
public intgetReadReport()
Get X-Mms-Read-Report value.

return
the value

        return mPduHeaders.getOctet(PduHeaders.READ_REPORT);
    
public byte[]getTransactionId()
Get X-Mms-Transaction-Id field value.

return
the X-Mms-Report-Allowed value

        return mPduHeaders.getTextString(PduHeaders.TRANSACTION_ID);
    
public voidsetBcc(EncodedStringValue[] value)
Set "BCC" value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.setEncodedStringValues(value, PduHeaders.BCC);
    
public voidsetCc(EncodedStringValue[] value)
Set "CC" value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.setEncodedStringValues(value, PduHeaders.CC);
    
public voidsetContentType(byte[] value)
Set Content-type value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.setTextString(value, PduHeaders.CONTENT_TYPE);
    
public voidsetDeliveryReport(int value)
Set X-Mms-Delivery-Report value.

param
value the value
throws
InvalidHeaderValueException if the value is invalid.

        mPduHeaders.setOctet(value, PduHeaders.DELIVERY_REPORT);
    
public voidsetExpiry(long value)
Set X-Mms-Expiry value.

param
value the value

        mPduHeaders.setLongInteger(value, PduHeaders.EXPIRY);
    
public voidsetMessageClass(byte[] value)
Set X-Mms-Message-Class value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.setTextString(value, PduHeaders.MESSAGE_CLASS);
    
public voidsetMessageSize(long value)
Set X-Mms-MessageSize value.

param
value the value

        mPduHeaders.setLongInteger(value, PduHeaders.MESSAGE_SIZE);
    
public voidsetReadReport(int value)
Set X-Mms-Read-Report value.

param
value the value
throws
InvalidHeaderValueException if the value is invalid.

        mPduHeaders.setOctet(value, PduHeaders.READ_REPORT);
    
public voidsetTo(EncodedStringValue[] value)
Set "To" value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.setEncodedStringValues(value, PduHeaders.TO);
    
public voidsetTransactionId(byte[] value)
Set X-Mms-Transaction-Id field value.

param
value the value
throws
NullPointerException if the value is null.

        mPduHeaders.setTextString(value, PduHeaders.TRANSACTION_ID);