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

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

public class BundleBinding
extends ItemStateBinding

This Class implements efficient serialization methods for item states.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.persistence.bundle.util.ItemStateBinding
blobStore, dataStore, errorHandling, minBlobSize, nameIndex, nsIndex, VERSION_1, VERSION_CURRENT
 
Constructor Summary
BundleBinding(ErrorHandling errorHandling, BLOBStore blobStore, StringIndex nsIndex, StringIndex nameIndex, DataStore dataStore)
          Creates a new bundle binding
 
Method Summary
 boolean checkBundle(DataInputStream in)
          Checks a NodePropBundle from a data input stream.
 boolean checkPropertyState(DataInputStream in)
          Checks a PropertyState from the data input stream.
 NodePropBundle readBundle(DataInputStream in, NodeId id)
          Deserializes a NodePropBundle from a data input stream.
 NodePropBundle.PropertyEntry readPropertyEntry(DataInputStream in, PropertyId id)
          Deserializes a PropertyState from the data input stream.
 void writeBundle(DataOutputStream out, NodePropBundle bundle)
          Serializes a NodePropBundle to a data output stream
 void writeState(DataOutputStream out, NodePropBundle.PropertyEntry state)
          Serializes a PropertyState to the data output stream
 
Methods inherited from class org.apache.jackrabbit.core.persistence.bundle.util.ItemStateBinding
getBlobStore, getMinBlobSize, readID, readIndexedQName, readModCount, readPropertyId, readQName, readState, readState, readUUID, setMinBlobSize, writeID, writeIndexedQName, writeModCount, writePropertyId, writeQName, writeState, writeState, writeUUID, writeUUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

readBundle

public NodePropBundle readBundle(DataInputStream in,
                                 NodeId id)
                          throws IOException
Deserializes a NodePropBundle from a data input stream.

Parameters:
in - the input stream
id - the nodeid for the new budle
Returns:
the bundle
Throws:
IOException - if an I/O error occurs.

checkBundle

public boolean checkBundle(DataInputStream in)
Checks a NodePropBundle from a data input stream.

Parameters:
in - the input stream
Returns:
true if the data is valid; false otherwise.

writeBundle

public void writeBundle(DataOutputStream 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.

readPropertyEntry

public NodePropBundle.PropertyEntry readPropertyEntry(DataInputStream in,
                                                      PropertyId id)
                                               throws IOException
Deserializes a PropertyState from the data input stream.

Parameters:
in - the input stream
id - the property id for the new propert entry
Returns:
the property entry
Throws:
IOException - if an I/O error occurs.

checkPropertyState

public boolean checkPropertyState(DataInputStream in)
Checks a PropertyState from the data input stream.

Parameters:
in - the input stream
Returns:
true if the data is valid; false otherwise.

writeState

public void writeState(DataOutputStream out,
                       NodePropBundle.PropertyEntry state)
                throws IOException
Serializes a PropertyState to the data output stream

Parameters:
out - the output stream
state - the property entry to store
Throws:
IOException - if an I/O error occurs.


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