public class MemoryNodeStore extends Object implements NodeStore, Observable
| Constructor and Description |
|---|
MemoryNodeStore() |
MemoryNodeStore(NodeState state) |
| 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.
|
Iterable<String> |
checkpoints()
Returns all valid checkpoints.
|
ArrayBasedBlob |
createBlob(InputStream inputStream)
Create a
Blob from the given input stream. |
org.apache.jackrabbit.oak.api.Blob |
getBlob(String reference)
Get a blob by its reference.
|
NodeState |
getRoot()
Returns the latest state of the tree.
|
Set<String> |
listCheckpoints()
test purpose only!
|
NodeState |
merge(NodeBuilder builder,
CommitHook commitHook,
CommitInfo info)
This implementation is equal to first rebasing the builder and then applying it to a
new branch and immediately merging it back.
|
NodeState |
rebase(NodeBuilder builder)
This implementation is equal to applying the differences between the builders base state
and its head state to a fresh builder on the stores root state using
ConflictAnnotatingRebaseDiff for resolving
conflicts. |
boolean |
release(String checkpoint)
Releases the provided checkpoint.
|
NodeState |
reset(NodeBuilder builder)
This implementation is equal resetting the builder to the root of the store and returning
the resulting node state from the builder.
|
NodeState |
retrieve(String checkpoint)
Retrieves the root node from a previously created repository checkpoint.
|
String |
toString()
Returns a string representation the head state of this node store.
|
public MemoryNodeStore(NodeState state)
public MemoryNodeStore()
public String toString()
public Closeable addObserver(Observer observer)
ObservableObserver. 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 ObservableCloseable instance.public NodeState getRoot()
NodeStorepublic NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook, @Nonnull CommitInfo info) throws org.apache.jackrabbit.oak.api.CommitFailedException
merge in interface NodeStorebuilder - the builder whose changes to applycommitHook - the commit hook to apply while merging changesinfo - commit info associated with this merge operationorg.apache.jackrabbit.oak.api.CommitFailedExceptionIllegalArgumentException - if the builder is not acquired from a root state of
this storepublic NodeState rebase(@Nonnull NodeBuilder builder)
ConflictAnnotatingRebaseDiff for resolving
conflicts.rebase in interface NodeStorebuilder - the builder to rebaseIllegalArgumentException - if the builder is not acquired from a root state of
this storepublic NodeState reset(@Nonnull NodeBuilder builder)
reset in interface NodeStorebuilder - the builder to resetIllegalArgumentException - if the builder is not acquired from a root state of
this storepublic ArrayBasedBlob createBlob(InputStream inputStream) throws IOException
NodeStoreBlob from the given input stream. The input stream
is closed after this method returns.createBlob in interface NodeStoreinputStream - The input stream for the BlobArrayBasedBlob.IOException - If an error occurs while reading from the streampublic org.apache.jackrabbit.oak.api.Blob getBlob(@Nonnull String reference)
NodeStore@Nonnull public String checkpoint(long lifetime, @Nonnull 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 NodeStorelifetime - time (in milliseconds, > 0) that the checkpoint
should remain availableproperties - properties to associate with the checkpoint@Nonnull public 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 NodeStorelifetime - time (in milliseconds, > 0) that the checkpoint
should remain available@Nonnull public Map<String,String> checkpointInfo(@Nonnull String checkpoint)
NodeStorecheckpointInfo in interface NodeStorecheckpoint - string reference of a checkpointcheckpoint or an empty map when there is no such
checkpoint.@Nonnull public Iterable<String> checkpoints()
NodeStoreIterable provides a
snapshot of valid checkpoints at the time this method is called. That
is, the Iterable will not reflect checkpoints created after this
method was called.
See NodeStore.checkpoint(long, Map) for a definition of a valid
checkpoint.
checkpoints in interface NodeStore@CheckForNull public NodeState retrieve(@Nonnull String checkpoint)
NodeStorepublic boolean release(String checkpoint)
NodeStoretrue.Copyright © 2012–2017 The Apache Software Foundation. All rights reserved.