Class CustomJsonFraming

java.lang.Object
com.here.platform.data.client.json.CustomJsonFraming

public class CustomJsonFraming extends Object
Provides JSON framing Pekko operator that can separate valid JSON objects from incoming ByteString objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 of ByteString chunks return one ByteStrings for each complete JSON object in the first array property named "propertyName".

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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,org.apache.pekko.NotUsed> objectScanner(String propertyName, int maximumObjectLength)
      Framing scanner that given any number of ByteString chunks return one ByteStrings 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 for
      maximumObjectLength - The maximum length of allowed frames while decoding. If the maximum length is exceeded this Flow will fail the stream.