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 public class SendConf extends GenericPdu {
21     /**
22      * Empty constructor.
23      * Since the Pdu corresponding to this class is constructed
24      * by the Proxy-Relay server, this class is only instantiated
25      * by the Pdu Parser.
26      *
27      * @throws InvalidHeaderValueException if error occurs.
28      */
SendConf()29     public SendConf() throws InvalidHeaderValueException {
30         super();
31         setMessageType(PduHeaders.MESSAGE_TYPE_SEND_CONF);
32     }
33 
34     /**
35      * Constructor with given headers.
36      *
37      * @param headers Headers for this PDU.
38      */
SendConf(PduHeaders headers)39     SendConf(PduHeaders headers) {
40         super(headers);
41     }
42 
43     /**
44      * Get Message-ID value.
45      *
46      * @return the value
47      */
getMessageId()48     public byte[] getMessageId() {
49         return mPduHeaders.getTextString(PduHeaders.MESSAGE_ID);
50     }
51 
52     /**
53      * Set Message-ID value.
54      *
55      * @param value the value
56      * @throws NullPointerException if the value is null.
57      */
setMessageId(byte[] value)58     public void setMessageId(byte[] value) {
59         mPduHeaders.setTextString(value, PduHeaders.MESSAGE_ID);
60     }
61 
62     /**
63      * Get X-Mms-Response-Status.
64      *
65      * @return the value
66      */
getResponseStatus()67     public int getResponseStatus() {
68         return mPduHeaders.getOctet(PduHeaders.RESPONSE_STATUS);
69     }
70 
71     /**
72      * Set X-Mms-Response-Status.
73      *
74      * @param value the values
75      * @throws InvalidHeaderValueException if the value is invalid.
76      */
setResponseStatus(int value)77     public void setResponseStatus(int value) throws InvalidHeaderValueException {
78         mPduHeaders.setOctet(value, PduHeaders.RESPONSE_STATUS);
79     }
80 
81     /**
82      * Get X-Mms-Transaction-Id field value.
83      *
84      * @return the X-Mms-Report-Allowed value
85      */
getTransactionId()86     public byte[] getTransactionId() {
87         return mPduHeaders.getTextString(PduHeaders.TRANSACTION_ID);
88     }
89 
90     /**
91      * Set X-Mms-Transaction-Id field value.
92      *
93      * @param value the value
94      * @throws NullPointerException if the value is null.
95      */
setTransactionId(byte[] value)96     public void setTransactionId(byte[] value) {
97             mPduHeaders.setTextString(value, PduHeaders.TRANSACTION_ID);
98     }
99 
100     /*
101      * Optional, not supported header fields:
102      *
103      *    public byte[] getContentLocation() {return null;}
104      *    public void setContentLocation(byte[] value) {}
105      *
106      *    public EncodedStringValue getResponseText() {return null;}
107      *    public void setResponseText(EncodedStringValue value) {}
108      *
109      *    public byte getStoreStatus() {return 0x00;}
110      *    public void setStoreStatus(byte value) {}
111      *
112      *    public byte[] getStoreStatusText() {return null;}
113      *    public void setStoreStatusText(byte[] value) {}
114      */
115 }
116