Class ThriftProtocolFactories
java.lang.Object
com.linecorp.armeria.common.thrift.ThriftProtocolFactories
Provides a set of well-known
TProtocolFactorys.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TProtocolFactoryDeprecated.static final TProtocolFactoryDeprecated.Usecompact(int, int).static final TProtocolFactoryDeprecated.Usejson().static final TProtocolFactoryDeprecated.Usetext().static final TProtocolFactoryDeprecated.UsetextNamedEnum(). -
Method Summary
Modifier and TypeMethodDescriptionstatic TProtocolFactorybinary(int maxStringLength, int maxContainerLength) Returns aTProtocolFactoryfor Thrift TBinary protocol.static TProtocolFactorycompact(int maxStringLength, int maxContainerLength) Returns aTProtocolFactoryfor Thrift TCompact protocol.static TProtocolFactoryget(SerializationFormat serializationFormat) Deprecated.static TProtocolFactoryjson()Returns aTProtocolFactoryfor the Thrift TJSON protocol.static TProtocolFactorytext()Returns aTProtocolFactoryfor the Thrift TText protocol.static TProtocolFactoryReturns aTProtocolFactoryfor the Thrift TText protocol with named enums.static SerializationFormattoSerializationFormat(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.TProtocolFactoryfor 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).TProtocolFactoryfor 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().TProtocolFactoryfor the Thrift TJSON protocol. -
TEXT
Deprecated.Usetext().TProtocolFactoryfor the Thrift TText protocol. -
TEXT_NAMED_ENUM
Deprecated.UsetextNamedEnum().TProtocolFactoryfor 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 aTProtocolFactoryfor 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).0means unlimited.maxContainerLength- the maximum allowed number of containers to read from the transport for maps, sets and lists.0means unlimited.
-
compact
Returns aTProtocolFactoryfor 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).0means unlimited.maxContainerLength- the maximum allowed number of containers to read from the transport for maps, sets and lists.0means unlimited.
-
json
Returns aTProtocolFactoryfor the Thrift TJSON protocol. -
text
Returns aTProtocolFactoryfor the Thrift TText protocol. -
textNamedEnum
Returns aTProtocolFactoryfor 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 theSerializationFormatfor the specifiedTProtocolFactory, as if it were registered byDefaultThriftProtocolFactoryProvider. Consider having your ownTProtocolFactorytoSerializationFormatmapping if necessary.- Throws:
IllegalArgumentException- if the specifiedTProtocolFactorydid not match anything
-
binary(int, int)instead.