public interface NodeStore
This is a low-level interface that doesn't cover functionality like merging concurrent changes or rejecting new tree states based on some higher-level consistency constraints.
Modifier and Type | Method and Description |
---|---|
@NotNull java.lang.String |
checkpoint(long lifetime)
Creates a new checkpoint of the latest root of the tree.
|
@NotNull java.lang.String |
checkpoint(long lifetime,
@NotNull java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new checkpoint of the latest root of the tree.
|
@NotNull java.util.Map<java.lang.String,java.lang.String> |
checkpointInfo(@NotNull java.lang.String checkpoint)
Retrieve the properties associated with a checkpoint.
|
@NotNull java.lang.Iterable<java.lang.String> |
checkpoints()
Returns all valid checkpoints.
|
@NotNull Blob |
createBlob(java.io.InputStream inputStream)
Create a
Blob from the given input stream. |
@Nullable Blob |
getBlob(@NotNull java.lang.String reference)
Get a blob by its reference.
|
@NotNull NodeState |
getRoot()
Returns the latest state of the tree.
|
@NotNull NodeState |
merge(@NotNull NodeBuilder builder,
@NotNull CommitHook commitHook,
@NotNull CommitInfo info)
|
@NotNull NodeState |
rebase(@NotNull NodeBuilder builder)
|
boolean |
release(@NotNull java.lang.String checkpoint)
Releases the provided checkpoint.
|
NodeState |
reset(@NotNull NodeBuilder builder)
Reset the passed
builder by throwing away all its changes and
setting its base state to the current root state. |
@Nullable NodeState |
retrieve(@NotNull java.lang.String checkpoint)
Retrieves the root node from a previously created repository checkpoint.
|
@NotNull @NotNull NodeState getRoot()
@NotNull @NotNull NodeState merge(@NotNull @NotNull NodeBuilder builder, @NotNull @NotNull CommitHook commitHook, @NotNull @NotNull CommitInfo info) throws CommitFailedException
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 failedjava.lang.IllegalArgumentException
- if the builder is not acquired
from a root state of this store@NotNull @NotNull NodeState rebase(@NotNull @NotNull NodeBuilder builder)
base
and
head
states
of the given builder on top of the current root state.
The base state of the given builder becomes the latest
root
state of the repository, and the
head state will contain the rebased changes.builder
- the builder to rebasejava.lang.IllegalArgumentException
- if the builder is not acquired
from a root state of this storeNodeState reset(@NotNull @NotNull NodeBuilder builder)
builder
by throwing away all its changes and
setting its base state to the current root state.builder
- the builder to resetjava.lang.IllegalArgumentException
- if the builder is not acquired
from a root state of this store@NotNull @NotNull Blob createBlob(java.io.InputStream inputStream) throws java.io.IOException
Blob
from the given input stream. The input stream
is closed after this method returns.inputStream
- The input stream for the Blob
Blob
representing inputStream
java.io.IOException
- If an error occurs while reading from the stream@Nullable @Nullable Blob getBlob(@NotNull @NotNull java.lang.String reference)
reference
- reference to the blobnull
if the reference does not resolve to a blob.Blob.getReference()
@NotNull @NotNull java.lang.String checkpoint(long lifetime, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> properties)
The properties
passed to this methods are associated with the
checkpoint and can be retrieved through the checkpointInfo(String)
method. Its semantics is entirely application specific.
lifetime
- time (in milliseconds, > 0) that the checkpoint
should remain availableproperties
- properties to associate with the checkpoint@NotNull @NotNull java.lang.String checkpoint(long lifetime)
This method is a shortcut for checkpoint(long, Map)
passing
an empty map for its 2nd argument.
lifetime
- time (in milliseconds, > 0) that the checkpoint
should remain available@NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> checkpointInfo(@NotNull @NotNull java.lang.String checkpoint)
checkpoint
- string reference of a checkpointcheckpoint
or an empty map when there is no such
checkpoint.@NotNull @NotNull java.lang.Iterable<java.lang.String> checkpoints()
Iterable
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 checkpoint(long, Map)
for a definition of a valid
checkpoint.
@Nullable @Nullable NodeState retrieve(@NotNull @NotNull java.lang.String checkpoint)
checkpoint
- string reference of a checkpointnull
if the checkpoint is no longer availableboolean release(@NotNull @NotNull java.lang.String checkpoint)
true
.checkpoint
- string reference of a checkpointtrue
if the checkpoint was successfully removed, or if it doesn't existCopyright © 2010 - 2020 Adobe. All Rights Reserved