Class ThriftProtocolFactories
java.lang.Object
com.linecorp.armeria.common.thrift.ThriftProtocolFactories
Provides a set of well-known
TProtocolFactory
s.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TProtocolFactory
Deprecated.static final TProtocolFactory
Deprecated.Usecompact(int, int)
.static final TProtocolFactory
Deprecated.Usejson()
.static final TProtocolFactory
Deprecated.Usetext()
.static final TProtocolFactory
Deprecated.UsetextNamedEnum()
. -
Method Summary
Modifier and TypeMethodDescriptionstatic TProtocolFactory
binary
(int maxStringLength, int maxContainerLength) Returns aTProtocolFactory
for Thrift TBinary protocol.static TProtocolFactory
compact
(int maxStringLength, int maxContainerLength) Returns aTProtocolFactory
for Thrift TCompact protocol.static TProtocolFactory
get
(SerializationFormat serializationFormat) Deprecated.static TProtocolFactory
json()
Returns aTProtocolFactory
for the Thrift TJSON protocol.static TProtocolFactory
text()
Returns aTProtocolFactory
for the Thrift TText protocol.static TProtocolFactory
Returns aTProtocolFactory
for the Thrift TText protocol with named enums.static SerializationFormat
toSerializationFormat
(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.- Parameters:
serializationFormat
- a known serialization format- Returns:
- the protocol factory linked to the input serializationFormat
-
binary
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
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
Returns aTProtocolFactory
for the Thrift TJSON protocol. -
text
Returns aTProtocolFactory
for the Thrift TText protocol. -
textNamedEnum
Returns aTProtocolFactory
for the Thrift TText protocol with named enums. -
toSerializationFormat
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.