]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/java/src/org/apache/thrift/protocol/TProtocol.java
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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
20 package org
.apache
.thrift
.protocol
;
22 import java
.nio
.ByteBuffer
;
24 import org
.apache
.thrift
.TException
;
25 import org
.apache
.thrift
.scheme
.IScheme
;
26 import org
.apache
.thrift
.scheme
.StandardScheme
;
27 import org
.apache
.thrift
.transport
.TTransport
;
30 * Protocol interface definition.
33 public abstract class TProtocol
{
36 * Prevent direct instantiation
38 @SuppressWarnings("unused")
39 private TProtocol() {}
44 protected TTransport trans_
;
49 protected TProtocol(TTransport trans
) {
56 public TTransport
getTransport() {
64 public abstract void writeMessageBegin(TMessage message
) throws TException
;
66 public abstract void writeMessageEnd() throws TException
;
68 public abstract void writeStructBegin(TStruct struct
) throws TException
;
70 public abstract void writeStructEnd() throws TException
;
72 public abstract void writeFieldBegin(TField field
) throws TException
;
74 public abstract void writeFieldEnd() throws TException
;
76 public abstract void writeFieldStop() throws TException
;
78 public abstract void writeMapBegin(TMap map
) throws TException
;
80 public abstract void writeMapEnd() throws TException
;
82 public abstract void writeListBegin(TList list
) throws TException
;
84 public abstract void writeListEnd() throws TException
;
86 public abstract void writeSetBegin(TSet set
) throws TException
;
88 public abstract void writeSetEnd() throws TException
;
90 public abstract void writeBool(boolean b
) throws TException
;
92 public abstract void writeByte(byte b
) throws TException
;
94 public abstract void writeI16(short i16
) throws TException
;
96 public abstract void writeI32(int i32
) throws TException
;
98 public abstract void writeI64(long i64
) throws TException
;
100 public abstract void writeDouble(double dub
) throws TException
;
102 public abstract void writeString(String str
) throws TException
;
104 public abstract void writeBinary(ByteBuffer buf
) throws TException
;
110 public abstract TMessage
readMessageBegin() throws TException
;
112 public abstract void readMessageEnd() throws TException
;
114 public abstract TStruct
readStructBegin() throws TException
;
116 public abstract void readStructEnd() throws TException
;
118 public abstract TField
readFieldBegin() throws TException
;
120 public abstract void readFieldEnd() throws TException
;
122 public abstract TMap
readMapBegin() throws TException
;
124 public abstract void readMapEnd() throws TException
;
126 public abstract TList
readListBegin() throws TException
;
128 public abstract void readListEnd() throws TException
;
130 public abstract TSet
readSetBegin() throws TException
;
132 public abstract void readSetEnd() throws TException
;
134 public abstract boolean readBool() throws TException
;
136 public abstract byte readByte() throws TException
;
138 public abstract short readI16() throws TException
;
140 public abstract int readI32() throws TException
;
142 public abstract long readI64() throws TException
;
144 public abstract double readDouble() throws TException
;
146 public abstract String
readString() throws TException
;
148 public abstract ByteBuffer
readBinary() throws TException
;
151 * Reset any internal state back to a blank slate. This method only needs to
152 * be implemented for stateful protocols.
154 public void reset() {}
159 public Class
<?
extends IScheme
> getScheme() {
160 return StandardScheme
.class;