Home | History | Annotate | Download | only in pdu
      1 /*
      2  * Copyright (C) 2007 Esmertec AG.
      3  * Copyright (C) 2007 The Android Open Source Project
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at
      8  *
      9  *      http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 package android.support.v7.mms.pdu;
     19 
     20 /**
     21  * M-Retrive.conf Pdu.
     22  */
     23 public class RetrieveConf extends MultimediaMessagePdu {
     24     /**
     25      * Empty constructor.
     26      * Since the Pdu corresponding to this class is constructed
     27      * by the Proxy-Relay server, this class is only instantiated
     28      * by the Pdu Parser.
     29      *
     30      * @throws InvalidHeaderValueException if error occurs.
     31      */
     32     public RetrieveConf() throws InvalidHeaderValueException {
     33         super();
     34         setMessageType(PduHeaders.MESSAGE_TYPE_RETRIEVE_CONF);
     35     }
     36 
     37     /**
     38      * Constructor with given headers.
     39      *
     40      * @param headers Headers for this PDU.
     41      */
     42     RetrieveConf(PduHeaders headers) {
     43         super(headers);
     44     }
     45 
     46     /**
     47      * Constructor with given headers and body
     48      *
     49      * @param headers Headers for this PDU.
     50      * @param body Body of this PDu.
     51      */
     52     RetrieveConf(PduHeaders headers, PduBody body) {
     53         super(headers, body);
     54     }
     55 
     56     /**
     57      * Get CC value.
     58      *
     59      * @return the value
     60      */
     61     public EncodedStringValue[] getCc() {
     62         return mPduHeaders.getEncodedStringValues(PduHeaders.CC);
     63     }
     64 
     65     /**
     66      * Add a "CC" value.
     67      *
     68      * @param value the value
     69      * @throws NullPointerException if the value is null.
     70      */
     71     public void addCc(EncodedStringValue value) {
     72         mPduHeaders.appendEncodedStringValue(value, PduHeaders.CC);
     73     }
     74 
     75     /**
     76      * Get Content-type value.
     77      *
     78      * @return the value
     79      */
     80     public byte[] getContentType() {
     81         return mPduHeaders.getTextString(PduHeaders.CONTENT_TYPE);
     82     }
     83 
     84     /**
     85      * Set Content-type value.
     86      *
     87      * @param value the value
     88      * @throws NullPointerException if the value is null.
     89      */
     90     public void setContentType(byte[] value) {
     91         mPduHeaders.setTextString(value, PduHeaders.CONTENT_TYPE);
     92     }
     93 
     94     /**
     95      * Get X-Mms-Delivery-Report value.
     96      *
     97      * @return the value
     98      */
     99     public int getDeliveryReport() {
    100         return mPduHeaders.getOctet(PduHeaders.DELIVERY_REPORT);
    101     }
    102 
    103     /**
    104      * Set X-Mms-Delivery-Report value.
    105      *
    106      * @param value the value
    107      * @throws InvalidHeaderValueException if the value is invalid.
    108      */
    109     public void setDeliveryReport(int value) throws InvalidHeaderValueException {
    110         mPduHeaders.setOctet(value, PduHeaders.DELIVERY_REPORT);
    111     }
    112 
    113     /**
    114      * Get From value.
    115      * From-value = Value-length
    116      *      (Address-present-token Encoded-string-value | Insert-address-token)
    117      *
    118      * @return the value
    119      */
    120     public EncodedStringValue getFrom() {
    121        return mPduHeaders.getEncodedStringValue(PduHeaders.FROM);
    122     }
    123 
    124     /**
    125      * Set From value.
    126      *
    127      * @param value the value
    128      * @throws NullPointerException if the value is null.
    129      */
    130     public void setFrom(EncodedStringValue value) {
    131         mPduHeaders.setEncodedStringValue(value, PduHeaders.FROM);
    132     }
    133 
    134     /**
    135      * Get X-Mms-Message-Class value.
    136      * Message-class-value = Class-identifier | Token-text
    137      * Class-identifier = Personal | Advertisement | Informational | Auto
    138      *
    139      * @return the value
    140      */
    141     public byte[] getMessageClass() {
    142         return mPduHeaders.getTextString(PduHeaders.MESSAGE_CLASS);
    143     }
    144 
    145     /**
    146      * Set X-Mms-Message-Class value.
    147      *
    148      * @param value the value
    149      * @throws NullPointerException if the value is null.
    150      */
    151     public void setMessageClass(byte[] value) {
    152         mPduHeaders.setTextString(value, PduHeaders.MESSAGE_CLASS);
    153     }
    154 
    155     /**
    156      * Get Message-ID value.
    157      *
    158      * @return the value
    159      */
    160     public byte[] getMessageId() {
    161         return mPduHeaders.getTextString(PduHeaders.MESSAGE_ID);
    162     }
    163 
    164     /**
    165      * Set Message-ID value.
    166      *
    167      * @param value the value
    168      * @throws NullPointerException if the value is null.
    169      */
    170     public void setMessageId(byte[] value) {
    171         mPduHeaders.setTextString(value, PduHeaders.MESSAGE_ID);
    172     }
    173 
    174     /**
    175      * Get X-Mms-Read-Report value.
    176      *
    177      * @return the value
    178      */
    179     public int getReadReport() {
    180         return mPduHeaders.getOctet(PduHeaders.READ_REPORT);
    181     }
    182 
    183     /**
    184      * Set X-Mms-Read-Report value.
    185      *
    186      * @param value the value
    187      * @throws InvalidHeaderValueException if the value is invalid.
    188      */
    189     public void setReadReport(int value) throws InvalidHeaderValueException {
    190         mPduHeaders.setOctet(value, PduHeaders.READ_REPORT);
    191     }
    192 
    193     /**
    194      * Get X-Mms-Retrieve-Status value.
    195      *
    196      * @return the value
    197      */
    198     public int getRetrieveStatus() {
    199         return mPduHeaders.getOctet(PduHeaders.RETRIEVE_STATUS);
    200     }
    201 
    202     /**
    203      * Set X-Mms-Retrieve-Status value.
    204      *
    205      * @param value the value
    206      * @throws InvalidHeaderValueException if the value is invalid.
    207      */
    208     public void setRetrieveStatus(int value) throws InvalidHeaderValueException {
    209         mPduHeaders.setOctet(value, PduHeaders.RETRIEVE_STATUS);
    210     }
    211 
    212     /**
    213      * Get X-Mms-Retrieve-Text value.
    214      *
    215      * @return the value
    216      */
    217     public EncodedStringValue getRetrieveText() {
    218         return mPduHeaders.getEncodedStringValue(PduHeaders.RETRIEVE_TEXT);
    219     }
    220 
    221     /**
    222      * Set X-Mms-Retrieve-Text value.
    223      *
    224      * @param value the value
    225      * @throws NullPointerException if the value is null.
    226      */
    227     public void setRetrieveText(EncodedStringValue value) {
    228         mPduHeaders.setEncodedStringValue(value, PduHeaders.RETRIEVE_TEXT);
    229     }
    230 
    231     /**
    232      * Get X-Mms-Transaction-Id.
    233      *
    234      * @return the value
    235      */
    236     public byte[] getTransactionId() {
    237         return mPduHeaders.getTextString(PduHeaders.TRANSACTION_ID);
    238     }
    239 
    240     /**
    241      * Set X-Mms-Transaction-Id.
    242      *
    243      * @param value the value
    244      * @throws NullPointerException if the value is null.
    245      */
    246     public void setTransactionId(byte[] value) {
    247         mPduHeaders.setTextString(value, PduHeaders.TRANSACTION_ID);
    248     }
    249 
    250     /*
    251      * Optional, not supported header fields:
    252      *
    253      *     public byte[] getApplicId() {return null;}
    254      *     public void setApplicId(byte[] value) {}
    255      *
    256      *     public byte[] getAuxApplicId() {return null;}
    257      *     public void getAuxApplicId(byte[] value) {}
    258      *
    259      *     public byte getContentClass() {return 0x00;}
    260      *     public void setApplicId(byte value) {}
    261      *
    262      *     public byte getDrmContent() {return 0x00;}
    263      *     public void setDrmContent(byte value) {}
    264      *
    265      *     public byte getDistributionIndicator() {return 0x00;}
    266      *     public void setDistributionIndicator(byte value) {}
    267      *
    268      *     public PreviouslySentByValue getPreviouslySentBy() {return null;}
    269      *     public void setPreviouslySentBy(PreviouslySentByValue value) {}
    270      *
    271      *     public PreviouslySentDateValue getPreviouslySentDate() {}
    272      *     public void setPreviouslySentDate(PreviouslySentDateValue value) {}
    273      *
    274      *     public MmFlagsValue getMmFlags() {return null;}
    275      *     public void setMmFlags(MmFlagsValue value) {}
    276      *
    277      *     public MmStateValue getMmState() {return null;}
    278      *     public void getMmState(MmStateValue value) {}
    279      *
    280      *     public byte[] getReplaceId() {return 0x00;}
    281      *     public void setReplaceId(byte[] value) {}
    282      *
    283      *     public byte[] getReplyApplicId() {return 0x00;}
    284      *     public void setReplyApplicId(byte[] value) {}
    285      *
    286      *     public byte getReplyCharging() {return 0x00;}
    287      *     public void setReplyCharging(byte value) {}
    288      *
    289      *     public byte getReplyChargingDeadline() {return 0x00;}
    290      *     public void setReplyChargingDeadline(byte value) {}
    291      *
    292      *     public byte[] getReplyChargingId() {return 0x00;}
    293      *     public void setReplyChargingId(byte[] value) {}
    294      *
    295      *     public long getReplyChargingSize() {return 0;}
    296      *     public void setReplyChargingSize(long value) {}
    297      */
    298 }
    299