FileDocCategorySizeDatePackage
TransactionBundle.javaAPI DocAndroid 1.5 API4733Wed May 06 22:42:46 BST 2009com.android.mms.transaction

TransactionBundle

public class TransactionBundle extends Object
A wrapper around the Bundle instances used to start the TransactionService. It provides high-level APIs to set the information required for the latter to instantiate transactions.

Fields Summary
public static final String
TRANSACTION_TYPE
Key for the transaction-type. Allowed values for this key are: TYPE_PUSH_TRANSACTION, TYPE_RETRIEVE_TRANSACTION, TYPE_SEND_TRANSACTION, and TYPE_READREC_TRANSACTION.
private static final String
PUSH_DATA
Key of the push-data. Used when TRANSACTION_TYPE is TYPE_PUSH_TRANSACTION.
private static final String
MMSC_URL
Key of the MMSC server URL.
private static final String
PROXY_ADDRESS
Key of the HTTP Proxy address.
private static final String
PROXY_PORT
Key of the HTTP Proxy port.
public static final String
URI
Key of the URI. Indicates the URL of the M-Retrieve.conf in TYPE_RETRIEVE_TRANSACTION, or the Uri of the M-Send.req/M-Read-Rec.ind in TYPE_SEND_TRANSACTION and TYPE_READREC_TRANSACTION, respectively.
private final android.os.Bundle
mBundle
This is the real Bundle to be sent to the TransactionService upon calling startService.
Constructors Summary
private TransactionBundle(int transactionType)
Private constructor.

param
transactionType


             
       
        mBundle = new Bundle();
        mBundle.putInt(TRANSACTION_TYPE, transactionType);
    
public TransactionBundle(int transactionType, String uri)
Constructor of a bundle used for TransactionBundle instances of type TYPE_RETRIEVE_TRANSACTION, TYPE_SEND_TRANSACTION, and TYPE_READREC_TRANSACTION.

param
transactionType
param
uri The relevant URI for this transaction. Indicates the URL of the M-Retrieve.conf in TYPE_RETRIEVE_TRANSACTION, or the Uri of the M-Send.req/M-Read-Rec.ind in TYPE_SEND_TRANSACTION and TYPE_READREC_TRANSACTION, respectively.

        this(transactionType);
        mBundle.putString(URI, uri);
    
public TransactionBundle(int transactionType, byte[] pushData)
Constructor of a bundle used for TransactionBundle instances of type TYPE_PUSH_TRANSACTION.

param
transactionType must be TYPE_PUSH_TRANSACTION
param
pushData contains the body of the push-data

        this(transactionType);
        mBundle.putByteArray(PUSH_DATA, pushData);
    
public TransactionBundle(android.os.Bundle bundle)
Constructor of a transaction bundle used for incoming bundle instances.

param
bundle The incoming bundle

        mBundle = bundle;
    
Methods Summary
public android.os.BundlegetBundle()

        return mBundle;
    
public java.lang.StringgetMmscUrl()

        return mBundle.getString(MMSC_URL);
    
public java.lang.StringgetProxyAddress()

        return mBundle.getString(PROXY_ADDRESS);
    
public intgetProxyPort()

        return mBundle.getInt(PROXY_PORT);
    
public byte[]getPushData()

        return mBundle.getByteArray(PUSH_DATA);
    
public intgetTransactionType()

        return mBundle.getInt(TRANSACTION_TYPE);
    
public java.lang.StringgetUri()

        return mBundle.getString(URI);
    
public voidsetConnectionSettings(java.lang.String mmscUrl, java.lang.String proxyAddress, int proxyPort)

        mBundle.putString(MMSC_URL, mmscUrl);
        mBundle.putString(PROXY_ADDRESS, proxyAddress);
        mBundle.putInt(PROXY_PORT, proxyPort);
    
public voidsetConnectionSettings(TransactionSettings settings)

        setConnectionSettings(
                settings.getMmscUrl(),
                settings.getProxyAddress(),
                settings.getProxyPort());