Class ThriftProtocolFactories
java.lang.Object
com.linecorp.armeria.common.thrift.ThriftProtocolFactories
Provides a set of well-known
TProtocolFactory
s.-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.thrift.protocol.TProtocolFactory
Deprecated.static final org.apache.thrift.protocol.TProtocolFactory
Deprecated.Usecompact(int, int)
.static final org.apache.thrift.protocol.TProtocolFactory
Deprecated.Usejson()
.static final org.apache.thrift.protocol.TProtocolFactory
Deprecated.Usetext()
.static final org.apache.thrift.protocol.TProtocolFactory
Deprecated.UsetextNamedEnum()
. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.thrift.protocol.TProtocolFactory
binary
(int maxStringLength, int maxContainerLength) Returns aTProtocolFactory
for Thrift TBinary protocol.static org.apache.thrift.protocol.TProtocolFactory
compact
(int maxStringLength, int maxContainerLength) Returns aTProtocolFactory
for Thrift TCompact protocol.static org.apache.thrift.protocol.TProtocolFactory
get
(SerializationFormat serializationFormat) Deprecated.static org.apache.thrift.protocol.TProtocolFactory
json()
Returns aTProtocolFactory
for the Thrift TJSON protocol.static org.apache.thrift.protocol.TProtocolFactory
text()
Returns aTProtocolFactory
for the Thrift TText protocol.static org.apache.thrift.protocol.TProtocolFactory
Returns aTProtocolFactory
for the Thrift TText protocol with named enums.static SerializationFormat
toSerializationFormat
(org.apache.thrift.protocol.TProtocolFactory protoFactory) Deprecated.This method has been deprecated without a replacement since it cannot reliably work with custom protocol factories.
-
Field Details
-
BINARY
Deprecated.Usebinary(int, int)
instead.TProtocolFactory
for Thrift TBinary protocol.Note that this Thrift TBinary protocol does not limit the maximum number of bytes to read from the transport. Therefore, it is recommended NOT to use this factory in a public network. If an attacker sends a header with a large message size, an `OutOfMemoryError` may occur. Related: Add string/collection length limit checks (from C++) to java protocol readers
-
COMPACT
Deprecated.Usecompact(int, int)
.TProtocolFactory
for Thrift TCompact protocol.Note that this Thrift TCompact protocol does not limit the maximum number of bytes to read from the transport. Therefore, it is recommended to NOT use this factory in a public network. If an attacker sends a header with a large message size, an `OutOfMemoryError` may occur. Related: Add string/collection length limit checks (from C++) to java protocol readers
-
JSON
Deprecated.Usejson()
.TProtocolFactory
for the Thrift TJSON protocol. -
TEXT
Deprecated.Usetext()
.TProtocolFactory
for the Thrift TText protocol. -
TEXT_NAMED_ENUM
Deprecated.UsetextNamedEnum()
.TProtocolFactory
for the Thrift TText protocol with named enums.
-
-
Method Details
-
get
@Deprecated public static org.apache.thrift.protocol.TProtocolFactory get(SerializationFormat serializationFormat) Deprecated.- Parameters:
serializationFormat
- a known serialization format- Returns:
- the protocol factory linked to the input serializationFormat
-
binary
public static org.apache.thrift.protocol.TProtocolFactory binary(int maxStringLength, int maxContainerLength) Returns aTProtocolFactory
for Thrift TBinary protocol.- Parameters:
maxStringLength
- the maximum allowed number of bytes to read from the transport for variable-length fields (such as strings or binary).0
means unlimited.maxContainerLength
- the maximum allowed number of containers to read from the transport for maps, sets and lists.0
means unlimited.
-
compact
public static org.apache.thrift.protocol.TProtocolFactory compact(int maxStringLength, int maxContainerLength) Returns aTProtocolFactory
for Thrift TCompact protocol.- Parameters:
maxStringLength
- the maximum allowed number of bytes to read from the transport for variable-length fields (such as strings or binary).0
means unlimited.maxContainerLength
- the maximum allowed number of containers to read from the transport for maps, sets and lists.0
means unlimited.
-
json
public static org.apache.thrift.protocol.TProtocolFactory json()Returns aTProtocolFactory
for the Thrift TJSON protocol. -
text
public static org.apache.thrift.protocol.TProtocolFactory text()Returns aTProtocolFactory
for the Thrift TText protocol. -
textNamedEnum
public static org.apache.thrift.protocol.TProtocolFactory textNamedEnum()Returns aTProtocolFactory
for the Thrift TText protocol with named enums. -
toSerializationFormat
@Deprecated public static SerializationFormat toSerializationFormat(org.apache.thrift.protocol.TProtocolFactory protoFactory) Deprecated.This method has been deprecated without a replacement since it cannot reliably work with custom protocol factories.Returns theSerializationFormat
for the specifiedTProtocolFactory
, as if it were registered byDefaultThriftProtocolFactoryProvider
. Consider having your ownTProtocolFactory
toSerializationFormat
mapping if necessary.- Throws:
IllegalArgumentException
- if the specifiedTProtocolFactory
did not match anything
-
binary(int, int)
instead.