Class BundleBinding


  • public class BundleBinding
    extends Object
    This Class implements efficient serialization methods for item states.
    • Field Detail

      • nsIndex

        protected final StringIndex nsIndex
        the namespace index
      • nameIndex

        protected final StringIndex nameIndex
        the name index
      • blobStore

        protected final BLOBStore blobStore
        the blob store
      • minBlobSize

        protected long minBlobSize
        minimum size of binaries to store in blob store
      • errorHandling

        protected final ErrorHandling errorHandling
        the error handling
      • dataStore

        protected final DataStore dataStore
        Data store for binary properties.
    • Constructor Detail

      • BundleBinding

        public BundleBinding​(ErrorHandling errorHandling,
                             BLOBStore blobStore,
                             StringIndex nsIndex,
                             StringIndex nameIndex,
                             DataStore dataStore)
        Creates a new bundle binding
        Parameters:
        errorHandling - the error handling
        blobStore - the blobstore for retrieving blobs
        nsIndex - the namespace index
        nameIndex - the name index
        dataStore - the data store
    • Method Detail

      • getMinBlobSize

        public long getMinBlobSize()
        Returns the minimum blob size
        Returns:
        the minimum blob size
        See Also:
        for details.
      • setMinBlobSize

        public void setMinBlobSize​(long minBlobSize)
        Sets the minimum blob size. Binary values that are shorted than this given size will be inlined in the serialization stream, binary value that are longer, will be stored in the blob store. default is 4k.
        Parameters:
        minBlobSize - the minimum blob size.
      • getBlobStore

        public BLOBStore getBlobStore()
        Returns the blob store that is associated with this binding.
        Returns:
        the blob store
      • readBundle

        public NodePropBundle readBundle​(InputStream in,
                                         NodeId id)
                                  throws IOException
        Deserializes a NodePropBundle from a data input stream.
        Parameters:
        in - the input stream
        id - the node id for the new bundle
        Returns:
        the bundle
        Throws:
        IOException - if an I/O error occurs.
      • writeBundle

        public void writeBundle​(OutputStream out,
                                NodePropBundle bundle)
                         throws IOException
        Serializes a NodePropBundle to a data output stream
        Parameters:
        out - the output stream
        bundle - the bundle to serialize
        Throws:
        IOException - if an I/O error occurs.