Package org.apache.qpid.protonj2.client
Class StreamDecodeOptions
java.lang.Object
org.apache.qpid.protonj2.client.StreamDecodeOptions
Configuration options that can be passed to the
StreamDelivery APIs for
reading messages and delivery annotations to give access to certain options
that can influence certain behaviors of the AMQP decoder that reads the bytes
associated with the incoming delivery.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamDecodeOptionsCreates a defaultStreamDecodeOptionsinstance configured with the client defied defaults for all values.intGets the currently configured decode depth limit that will be enforced when decoding AMQP types, if the encoding nests deeper than the configured limit an exception will be thrown.depthLimit(int depthLimit) Sets the configured maximum depth that nested types such as Lists, Maps and Arrays can have before aDecodeExceptionis thrown to allow the decoder to error in cases where the depth of encoding exceeds what the environment is thought to be able to support.intGets the configured maximum size of an encoded array this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.maxArraySize(int maximumSize) Sets the configured maximum size of an encoded array this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.intGets the configured maximum length of an encoded Binary this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.maxBinarySize(int maximumSize) Gets the configured maximum size of an encoded Binary this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.intGets the configured maximum indicated encoded size of a List this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.maxListSize(int maximumSize) Sets the configured maximum indicated encoded size of a List this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.intGets the configured maximum indicated encoded size of a List this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.maxMapSize(int maximumSize) Sets the configured maximum indicated encoded size of a Map this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.intGets the configured maximum size of an encoded string this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.maxStringSize(int maximumSize) Sets the configured maximum size of an encoded string this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.intGets the configured maximum size of an encoded Symbol this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.maxSymbolSize(int maximumSize) Gets the configured maximum length of an encoded Symbol this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.intGets the configured maximum number of elements that can be decoded from an array encoded with the zero width AMQP types (Null, UInt0.maxZeroWidthArrayElements(int maxElements) Sets the configured maximum number of elements that can be decoded from an array encoded with the zero width AMQP types (Null, UInt0.
-
Constructor Details
-
StreamDecodeOptions
public StreamDecodeOptions()
-
-
Method Details
-
defaultOptions
Creates a defaultStreamDecodeOptionsinstance configured with the client defied defaults for all values.- Returns:
- a new
StreamDecodeOptionsinstance configured with defaults.
-
depthLimit
public int depthLimit()Gets the currently configured decode depth limit that will be enforced when decoding AMQP types, if the encoding nests deeper than the configured limit an exception will be thrown.- Returns:
- the currently configured decode depth limit
-
depthLimit
Sets the configured maximum depth that nested types such as Lists, Maps and Arrays can have before aDecodeExceptionis thrown to allow the decoder to error in cases where the depth of encoding exceeds what the environment is thought to be able to support.- Parameters:
depthLimit- The configured limit on decoding types with nested element structures.- Throws:
DecodeException- if a set decoding depth limit is exceeded.
-
maxZeroWidthArrayElements
public int maxZeroWidthArrayElements()Gets the configured maximum number of elements that can be decoded from an array encoded with the zero width AMQP types (Null, UInt0. ULong0, List0, Boolean_False and Boolean_True). A return value of zero indicates that the decoder should throw if any array with zero width encodings is encountered.- Returns:
- the configured max number of zero width array encoding elements.
-
maxZeroWidthArrayElements
Sets the configured maximum number of elements that can be decoded from an array encoded with the zero width AMQP types (Null, UInt0. ULong0, List0, Boolean_False and Boolean_True). These are uncommon encodings and can lead to small encodings with large memory costs at decode which makes them discouraged for normal use.It is recommended that for implementations that implement this limit configuration the default be zero meaning zero width array encodings are disabled and will always throw a
DecodeException- Parameters:
maxElements- The configured max elements allowed in arrays encoded for zero width types.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-
maxStringSize
public int maxStringSize()Gets the configured maximum size of an encoded string this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Returns:
- the configured max encoded string size supported.
-
maxStringSize
Sets the configured maximum size of an encoded string this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Parameters:
maximumSize- The maximum allowed encoded size value to allow before an decoding exception is thrown.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-
maxArraySize
public int maxArraySize()Gets the configured maximum size of an encoded array this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Returns:
- the configured max encoded array size supported.
-
maxArraySize
Sets the configured maximum size of an encoded array this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Parameters:
maximumSize- The maximum allowed encoded size value to allow before an decoding exception is thrown.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-
maxListSize
public int maxListSize()Gets the configured maximum indicated encoded size of a List this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Returns:
- the configured max encoded list elements supported.
-
maxListSize
Sets the configured maximum indicated encoded size of a List this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Parameters:
maximumSize- The maximum allowed encoded size value to allow before an decoding exception is thrown.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-
maxMapSize
public int maxMapSize()Gets the configured maximum indicated encoded size of a List this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Returns:
- the configured max encoded list size supported.
-
maxMapSize
Sets the configured maximum indicated encoded size of a Map this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Parameters:
maximumSize- The maximum allowed encoded size value to allow before an decoding exception is thrown.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-
maxBinarySize
public int maxBinarySize()Gets the configured maximum length of an encoded Binary this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Returns:
- the configured max encoded binary length supported.
-
maxBinarySize
Gets the configured maximum size of an encoded Binary this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Parameters:
maximumSize- The maximum allowed encoded size value to allow before an decoding exception is thrown.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-
maxSymbolSize
public int maxSymbolSize()Gets the configured maximum size of an encoded Symbol this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Returns:
- the configured max encoded Symbol length supported.
-
maxSymbolSize
Gets the configured maximum length of an encoded Symbol this decoder will allow before it throws anDecodeExceptionto indicate that a rule violation has occurred.- Parameters:
maximumSize- The maximum allowed encoded size value to allow before an decoding exception is thrown.- Returns:
- this
StreamDecodeOptionsinstance for chaining.
-