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