org.apache.jackrabbit.core.persistence.util
Class BundleBinding

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.util.BundleBinding

public class BundleBinding
extends Object

This Class implements efficient serialization methods for item states.


Field Summary
protected  BLOBStore blobStore
          the blob store
protected  DataStore dataStore
          Data store for binary properties.
protected  ErrorHandling errorHandling
          the error handling
protected  long minBlobSize
          minimum size of binaries to store in blob store
protected  StringIndex nameIndex
          the name index
protected  StringIndex nsIndex
          the namespace index
 
Constructor Summary
BundleBinding(ErrorHandling errorHandling, BLOBStore blobStore, StringIndex nsIndex, StringIndex nameIndex, DataStore dataStore)
          Creates a new bundle binding
 
Method Summary
 BLOBStore getBlobStore()
          Returns the blob store that is assosiated with this binding.
 long getMinBlobSize()
          Returns the minimum blob size
 NodePropBundle readBundle(InputStream in, NodeId id)
          Deserializes a NodePropBundle from a data input stream.
 void setMinBlobSize(long minBlobSize)
          Sets the minimum blob size.
 void writeBundle(OutputStream out, NodePropBundle bundle)
          Serializes a NodePropBundle to a data output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 assosiated 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.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.