Class ThriftProtocolFactories
java.lang.Object
com.linecorp.armeria.common.thrift.ThriftProtocolFactories
Provides a set of well-known
TProtocolFactorys.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.thrift.protocol.TProtocolFactoryDeprecated.static final org.apache.thrift.protocol.TProtocolFactoryDeprecated.Usecompact(int, int).static final org.apache.thrift.protocol.TProtocolFactoryDeprecated.Usejson().static final org.apache.thrift.protocol.TProtocolFactoryDeprecated.Usetext().static final org.apache.thrift.protocol.TProtocolFactoryDeprecated.UsetextNamedEnum(). -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.thrift.protocol.TProtocolFactorybinary(int maxStringLength, int maxContainerLength) Returns aTProtocolFactoryfor Thrift TBinary protocol.static org.apache.thrift.protocol.TProtocolFactorycompact(int maxStringLength, int maxContainerLength) Returns aTProtocolFactoryfor Thrift TCompact protocol.static org.apache.thrift.protocol.TProtocolFactoryget(com.linecorp.armeria.common.SerializationFormat serializationFormat) Deprecated.static org.apache.thrift.protocol.TProtocolFactoryjson()Returns aTProtocolFactoryfor the Thrift TJSON protocol.static org.apache.thrift.protocol.TProtocolFactorytext()Returns aTProtocolFactoryfor the Thrift TText protocol.static org.apache.thrift.protocol.TProtocolFactoryReturns aTProtocolFactoryfor the Thrift TText protocol with named enums.static com.linecorp.armeria.common.SerializationFormattoSerializationFormat(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.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 public static org.apache.thrift.protocol.TProtocolFactory get(com.linecorp.armeria.common.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 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
public static org.apache.thrift.protocol.TProtocolFactory compact(int maxStringLength, int maxContainerLength) 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
public static org.apache.thrift.protocol.TProtocolFactory json()Returns aTProtocolFactoryfor the Thrift TJSON protocol. -
text
public static org.apache.thrift.protocol.TProtocolFactory text()Returns aTProtocolFactoryfor the Thrift TText protocol. -
textNamedEnum
public static org.apache.thrift.protocol.TProtocolFactory textNamedEnum()Returns aTProtocolFactoryfor the Thrift TText protocol with named enums. -
toSerializationFormat
@Deprecated public static com.linecorp.armeria.common.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 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.