Class CustomJsonFraming
java.lang.Object
com.here.platform.data.client.json.CustomJsonFraming
Provides JSON framing Pekko operator that can separate valid JSON objects from
incoming
ByteString objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> objectScanner(String propertyName, int maximumObjectLength) Framing scanner that given any number ofByteStringchunks return oneByteStrings for each complete JSON object in the first array property named "propertyName".
-
Constructor Details
-
CustomJsonFraming
public CustomJsonFraming()
-
-
Method Details
-
objectScanner
public static org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString, objectScannerorg.apache.pekko.NotUsed> (String propertyName, int maximumObjectLength) Framing scanner that given any number ofByteStringchunks return oneByteStrings for each complete JSON object in the first array property named "propertyName". Whitespace leading, between, and trailing the elements will be trimmed.- Parameters:
propertyName- The name of the top-level array property to search formaximumObjectLength- The maximum length of allowed frames while decoding. If the maximum length is exceeded this Flow will fail the stream.
-