org.apache.jackrabbit.mk.store
Interface RevisionStore

All Superinterfaces:
NodeStore, RevisionProvider
All Known Implementing Classes:
DefaultRevisionStore

public interface RevisionStore
extends RevisionProvider

Write operations.


Nested Class Summary
static class RevisionStore.PutToken
          Token that must be created first before invoking any put operation.
 
Method Summary
 RevisionStore.PutToken createPutToken()
          Create a put token.
 void lockHead()
          Lock the head.
 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.
 
Methods inherited from interface org.apache.jackrabbit.mk.store.RevisionProvider
getCNEMap, getCommit, getHeadCommit, getHeadCommitId, getId, getNode, getNodeState, getRootNode
 
Methods inherited from interface org.apache.jackrabbit.mk.model.NodeStore
compare, getRoot
 

Method Detail

createPutToken

RevisionStore.PutToken createPutToken()
Create a put token.

Returns:
put token

putNode

Id putNode(RevisionStore.PutToken token,
           MutableNode node)
           throws Exception
Throws:
Exception

putCNEMap

Id putCNEMap(RevisionStore.PutToken token,
             ChildNodeEntriesMap map)
             throws Exception
Throws:
Exception

lockHead

void lockHead()
Lock the head. Must be called prior to putting a new head commit.

See Also:
#putHeadCommit(MutableCommit), unlockHead()

putHeadCommit

Id putHeadCommit(RevisionStore.PutToken token,
                 MutableCommit commit,
                 Id branchRootId)
                 throws Exception
Put a new head commit. Must be called while holding a lock on the head.

Parameters:
token - put token
commit - commit
branchRootId - former branch root id, if this is a merge; otherwise null
Returns:
head commit id
Throws:
Exception - if an error occurs
See Also:
lockHead()

unlockHead

void unlockHead()
Unlock the head.

See Also:
lockHead()

putCommit

Id putCommit(RevisionStore.PutToken token,
             MutableCommit commit)
             throws Exception
Store a new commit.

Unlike putHeadCommit(MutableCommit), this method does not affect the current head commit and therefore doesn't require a lock on the head.

Parameters:
token - put token
commit - commit
Returns:
new commit id
Throws:
Exception - if an error occurs


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