public class SegmentNodeStore extends Object implements NodeStore, Observable
The root node of the JCR content tree is actually stored in the node "/root", and checkpoints are stored under "/checkpoints".
Modifier and Type | Field and Description |
---|---|
static String |
CHECKPOINTS |
Constructor and Description |
---|
SegmentNodeStore() |
SegmentNodeStore(SegmentStore store) |
Modifier and Type | Method and Description |
---|---|
Closeable |
addObserver(Observer observer)
Register a new
Observer . |
String |
checkpoint(long lifetime)
Creates a new checkpoint of the latest root of the tree.
|
String |
checkpoint(long lifetime,
Map<String,String> properties)
Creates a new checkpoint of the latest root of the tree.
|
Map<String,String> |
checkpointInfo(String checkpoint)
Retrieve the properties associated with a checkpoint.
|
Blob |
createBlob(InputStream stream)
Create a
Blob from the given input stream. |
Blob |
getBlob(String reference)
Get a blob by its reference.
|
NodeState |
getRoot()
Returns the latest state of the tree.
|
NodeState |
merge(NodeBuilder builder,
CommitHook commitHook,
CommitInfo info)
|
NodeState |
rebase(NodeBuilder builder)
|
boolean |
release(String checkpoint)
Releases the provided checkpoint.
|
NodeState |
reset(NodeBuilder builder)
Reset the passed
builder by throwing away all its changes and
setting its base state to the current root state. |
NodeState |
retrieve(String checkpoint)
Retrieves the root node from a previously created repository checkpoint.
|
public static final String CHECKPOINTS
public SegmentNodeStore(SegmentStore store)
public SegmentNodeStore()
public Closeable addObserver(Observer observer)
Observable
Observer
. Clients need to call Closeable.close()
to stop getting notifications on the registered observer and to free up any resources
associated with the registration.addObserver
in interface Observable
Closeable
instance.public NodeState getRoot()
NodeStore
public NodeState merge(NodeBuilder builder, CommitHook commitHook, CommitInfo info) throws CommitFailedException
NodeStore
merge
in interface NodeStore
builder
- the builder whose changes to applycommitHook
- the commit hook to apply while merging changesinfo
- commit info associated with this merge operationCommitFailedException
- if the merge failedpublic NodeState rebase(NodeBuilder builder)
NodeStore
public NodeState reset(NodeBuilder builder)
NodeStore
builder
by throwing away all its changes and
setting its base state to the current root state.public Blob createBlob(InputStream stream) throws IOException
NodeStore
Blob
from the given input stream. The input stream
is closed after this method returns.createBlob
in interface NodeStore
stream
- The input stream for the Blob
Blob
representing inputStream
IOException
- If an error occurs while reading from the streampublic Blob getBlob(String reference)
NodeStore
getBlob
in interface NodeStore
reference
- reference to the blobnull
if the reference does not resolve to a blob.Blob.getReference()
public String checkpoint(long lifetime, Map<String,String> properties)
NodeStore
The properties
passed to this methods are associated with the
checkpoint and can be retrieved through the NodeStore.checkpointInfo(String)
method. Its semantics is entirely application specific.
checkpoint
in interface NodeStore
lifetime
- time (in milliseconds, > 0) that the checkpoint
should remain availableproperties
- properties to associate with the checkpointpublic String checkpoint(long lifetime)
NodeStore
This method is a shortcut for NodeStore.checkpoint(long, Map)
passing
an empty map for its 2nd argument.
checkpoint
in interface NodeStore
lifetime
- time (in milliseconds, > 0) that the checkpoint
should remain availablepublic Map<String,String> checkpointInfo(String checkpoint)
NodeStore
checkpointInfo
in interface NodeStore
checkpoint
- string reference of a checkpointcheckpoint
or an empty map when there is no such
checkpoint.public NodeState retrieve(String checkpoint)
NodeStore
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"