|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.mk.store.DefaultRevisionStore
public class DefaultRevisionStore
Default revision store implementation, passing calls to a Persistence
and a BlobStore, respectively and providing caching.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.jackrabbit.mk.store.RevisionStore |
|---|
RevisionStore.PutToken |
| Field Summary | |
|---|---|
static String |
CACHE_SIZE
|
static int |
DEFAULT_CACHE_SIZE
|
protected GCPersistence |
gcpm
|
| Constructor Summary | |
|---|---|
DefaultRevisionStore(Persistence pm)
|
|
DefaultRevisionStore(Persistence pm,
GCPersistence gcpm)
Alternative constructor that allows disabling of garbage collection for an in-memory test repository. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
compare(NodeState before,
NodeState after,
NodeStateDiff diff)
Compares the given two node states. |
protected void |
compareChildNodes(NodeState before,
NodeState after,
NodeStateDiff diff)
Compares the child nodes of the given two node states. |
protected void |
compareProperties(NodeState before,
NodeState after,
NodeStateDiff diff)
Compares the properties of the given two node states. |
RevisionStore.PutToken |
createPutToken()
Create a put token. |
protected static int |
determineInitialCacheSize()
|
void |
gc()
Perform a garbage collection. |
ChildNodeEntriesMap |
getCNEMap(Id id)
|
StoredCommit |
getCommit(Id id)
|
StoredCommit |
getHeadCommit()
|
Id |
getHeadCommitId()
|
Id |
getId(NodeState node)
Adapts the given NodeState to the corresponding identifier. |
StoredNode |
getNode(Id id)
|
NodeState |
getNodeState(StoredNode node)
Adapts the given StoredNode to a corresponding
NodeState instance. |
NodeState |
getRoot()
Returns the latest state of the content tree. |
StoredNode |
getRootNode(Id commitId)
|
void |
initialize()
|
void |
lockHead()
Lock the head. |
protected void |
markCommit(StoredCommit commit)
Mark a commit. |
protected Id |
markCommits()
Mark all commits and nodes in a garbage collection cycle. |
Id |
putCNEMap(RevisionStore.PutToken token,
ChildNodeEntriesMap map)
|
Id |
putCommit(RevisionStore.PutToken token,
MutableCommit commit)
Store a new commit. |
Id |
putHeadCommit(RevisionStore.PutToken token,
MutableCommit commit,
Id branchRootId)
Put a new head commit. |
Id |
putNode(RevisionStore.PutToken token,
MutableNode node)
|
void |
unlockHead()
Unlock the head. |
protected void |
verifyInitialized()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CACHE_SIZE
public static final int DEFAULT_CACHE_SIZE
protected final GCPersistence gcpm
| Constructor Detail |
|---|
public DefaultRevisionStore(Persistence pm)
public DefaultRevisionStore(Persistence pm,
GCPersistence gcpm)
pm - persistence managergcpm - the same persistence manager, or null for no GC| Method Detail |
|---|
public void initialize()
throws Exception
Exceptionpublic void close()
close in interface Closeableprotected void verifyInitialized()
protected static int determineInitialCacheSize()
public RevisionStore.PutToken createPutToken()
RevisionStore
createPutToken in interface RevisionStore
public Id putNode(RevisionStore.PutToken token,
MutableNode node)
throws Exception
putNode in interface RevisionStoreException
public Id putCNEMap(RevisionStore.PutToken token,
ChildNodeEntriesMap map)
throws Exception
putCNEMap in interface RevisionStoreExceptionpublic void lockHead()
RevisionStore
lockHead in interface RevisionStoreRevisionStore.putHeadCommit(PutToken, MutableCommit, Id),
RevisionStore.unlockHead()
public Id putHeadCommit(RevisionStore.PutToken token,
MutableCommit commit,
Id branchRootId)
throws Exception
RevisionStore
putHeadCommit in interface RevisionStoretoken - put tokencommit - commitbranchRootId - former branch root id, if this is a merge; otherwise
null
Exception - if an error occursRevisionStore.lockHead()
public Id putCommit(RevisionStore.PutToken token,
MutableCommit commit)
throws Exception
RevisionStoreputHeadCommit(MutableCommit), this method
does not affect the current head commit and therefore doesn't
require a lock on the head.
putCommit in interface RevisionStoretoken - put tokencommit - commit
Exception - if an error occurspublic void unlockHead()
RevisionStore
unlockHead in interface RevisionStoreRevisionStore.lockHead()
public StoredNode getNode(Id id)
throws NotFoundException,
Exception
getNode in interface RevisionProviderNotFoundException
Exception
public ChildNodeEntriesMap getCNEMap(Id id)
throws NotFoundException,
Exception
getCNEMap in interface RevisionProviderNotFoundException
Exception
public StoredCommit getCommit(Id id)
throws NotFoundException,
Exception
getCommit in interface RevisionProviderNotFoundException
Exception
public StoredNode getRootNode(Id commitId)
throws NotFoundException,
Exception
getRootNode in interface RevisionProviderNotFoundException
Exception
public StoredCommit getHeadCommit()
throws Exception
getHeadCommit in interface RevisionProviderException
public Id getHeadCommitId()
throws Exception
getHeadCommitId in interface RevisionProviderException
public void compare(NodeState before,
NodeState after,
NodeStateDiff diff)
NodeStore
compare in interface NodeStorebefore - node state before changesafter - node state after changesdiff - handler of node state differencespublic void gc()
protected Id markCommits()
throws Exception
Exception - if an error occurs
protected void markCommit(StoredCommit commit)
throws Exception
commit - commit
Exception - if an error occurspublic NodeState getNodeState(StoredNode node)
RevisionProviderStoredNode to a corresponding
NodeState instance.
getNodeState in interface RevisionProvidernode - stored node instance
public Id getId(NodeState node)
RevisionProviderNodeState to the corresponding identifier.
getId in interface RevisionProvidernode - node state
public NodeState getRoot()
NodeStore
getRoot in interface NodeStore
protected void compareProperties(NodeState before,
NodeState after,
NodeStateDiff diff)
before - node state before changesafter - node state after changesdiff - handler of node state differences
protected void compareChildNodes(NodeState before,
NodeState after,
NodeStateDiff diff)
before - node state before changesafter - node state after changesdiff - handler of node state differences
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||