org.apache.jackrabbit.mk.store
Class IdFactory

java.lang.Object
  extended by org.apache.jackrabbit.mk.store.IdFactory

public abstract class IdFactory
extends Object

Create new internal content object ids based on serialized data.


Constructor Summary
IdFactory()
           
 
Method Summary
 byte[] createContentId(byte[] serialized)
          Creates a new id based on the specified serialized data.
protected  byte[] digest(byte[] data)
          Return a digest for some data.
static IdFactory getDigestFactory()
          Return the default factory that will create node and revision ids based on their content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdFactory

public IdFactory()
Method Detail

createContentId

public byte[] createContentId(byte[] serialized)
                       throws Exception
Creates a new id based on the specified serialized data.

The general contract of createContentId is:

createId(data1).equals(createId(data2)) == Arrays.equals(data1, data2)

Parameters:
serialized - serialized data
Returns:
raw node id as byte array
Throws:
Exception - if an error occurs

digest

protected byte[] digest(byte[] data)
                 throws Exception
Return a digest for some data.

Parameters:
data - data
Returns:
digest
Throws:
Exception

getDigestFactory

public static IdFactory getDigestFactory()
Return the default factory that will create node and revision ids based on their content.

Returns:
factory


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.