]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/javame/src/org/apache/thrift/protocol/TProtocol.java
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / thrift / lib / javame / src / org / apache / thrift / protocol / TProtocol.java
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 package org.apache.thrift.protocol;
21
22 import org.apache.thrift.TException;
23 import org.apache.thrift.transport.TTransport;
24
25 /**
26 * Protocol interface definition.
27 *
28 */
29 public abstract class TProtocol {
30
31 /**
32 * Prevent direct instantiation
33 */
34 private TProtocol() {}
35
36 /**
37 * Transport
38 */
39 protected TTransport trans_;
40
41 /**
42 * Constructor
43 */
44 protected TProtocol(TTransport trans) {
45 trans_ = trans;
46 }
47
48 /**
49 * Transport accessor
50 */
51 public TTransport getTransport() {
52 return trans_;
53 }
54
55 /**
56 * Writing methods.
57 */
58
59 public abstract void writeMessageBegin(TMessage message) throws TException;
60
61 public abstract void writeMessageEnd() throws TException;
62
63 public abstract void writeStructBegin(TStruct struct) throws TException;
64
65 public abstract void writeStructEnd() throws TException;
66
67 public abstract void writeFieldBegin(TField field) throws TException;
68
69 public abstract void writeFieldEnd() throws TException;
70
71 public abstract void writeFieldStop() throws TException;
72
73 public abstract void writeMapBegin(TMap map) throws TException;
74
75 public abstract void writeMapEnd() throws TException;
76
77 public abstract void writeListBegin(TList list) throws TException;
78
79 public abstract void writeListEnd() throws TException;
80
81 public abstract void writeSetBegin(TSet set) throws TException;
82
83 public abstract void writeSetEnd() throws TException;
84
85 public abstract void writeBool(boolean b) throws TException;
86
87 public void writeBool(Boolean b) throws TException {
88 writeBool(b.booleanValue());
89 }
90
91 public abstract void writeByte(byte b) throws TException;
92
93 public void writeByte(Byte b) throws TException {
94 writeByte(b.byteValue());
95 }
96
97 public abstract void writeI16(short i16) throws TException;
98
99 public void writeI16(Short i16) throws TException {
100 writeI16(i16.shortValue());
101 }
102
103 public abstract void writeI32(int i32) throws TException;
104
105 public void writeI32(Integer i32) throws TException {
106 writeI32(i32.intValue());
107 }
108
109 public abstract void writeI64(long i64) throws TException;
110
111 public void writeI64(Long i64) throws TException {
112 writeI64(i64.longValue());
113 }
114
115 public abstract void writeDouble(double dub) throws TException;
116
117 public void writeDouble(Double d) throws TException {
118 writeDouble(d.doubleValue());
119 }
120
121 public abstract void writeString(String str) throws TException;
122
123 public abstract void writeBinary(byte[] bin) throws TException;
124
125 /**
126 * Reading methods.
127 */
128
129 public abstract TMessage readMessageBegin() throws TException;
130
131 public abstract void readMessageEnd() throws TException;
132
133 public abstract TStruct readStructBegin() throws TException;
134
135 public abstract void readStructEnd() throws TException;
136
137 public abstract TField readFieldBegin() throws TException;
138
139 public abstract void readFieldEnd() throws TException;
140
141 public abstract TMap readMapBegin() throws TException;
142
143 public abstract void readMapEnd() throws TException;
144
145 public abstract TList readListBegin() throws TException;
146
147 public abstract void readListEnd() throws TException;
148
149 public abstract TSet readSetBegin() throws TException;
150
151 public abstract void readSetEnd() throws TException;
152
153 public abstract boolean readBool() throws TException;
154
155 public abstract byte readByte() throws TException;
156
157 public abstract short readI16() throws TException;
158
159 public abstract int readI32() throws TException;
160
161 public abstract long readI64() throws TException;
162
163 public abstract double readDouble() throws TException;
164
165 public abstract String readString() throws TException;
166
167 public abstract byte[] readBinary() throws TException;
168
169 }