public class KernelNodeStore extends Object implements NodeStore, Observable
NodeStore
implementations against MicroKernel
.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_CACHE_SIZE |
Constructor and Description |
---|
KernelNodeStore(MicroKernel kernel) |
KernelNodeStore(MicroKernel kernel,
long cacheSize) |
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.
|
KernelBlob |
createBlob(InputStream inputStream)
Create a
Blob from the given input stream. |
Blob |
getBlob(String reference)
Get a blob by its reference.
|
CacheStats |
getCacheStats() |
KernelNodeState |
getRoot()
Returns the latest state of the tree.
|
NodeState |
merge(NodeBuilder builder,
CommitHook commitHook,
CommitInfo info)
This implementation delegates to
KernelRootBuilder.merge(CommitHook, CommitInfo)
if builder is a KernelNodeBuilder instance. |
NodeState |
rebase(NodeBuilder builder)
This implementation delegates to
KernelRootBuilder.rebase() if builder
is a KernelNodeBuilder instance. |
void |
release(String checkpoint) |
NodeState |
reset(NodeBuilder builder)
This implementation delegates to
KernelRootBuilder.reset() if builder
is a KernelNodeBuilder instance. |
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 static final long DEFAULT_CACHE_SIZE
public KernelNodeStore(MicroKernel kernel, long cacheSize)
public KernelNodeStore(MicroKernel kernel)
public String toString()
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 KernelNodeState getRoot()
NodeStore
public NodeState merge(NodeBuilder builder, CommitHook commitHook, CommitInfo info) throws CommitFailedException
KernelRootBuilder.merge(CommitHook, CommitInfo)
if builder
is a KernelNodeBuilder
instance. Otherwise it throws
an IllegalArgumentException
.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)
KernelRootBuilder.rebase()
if builder
is a KernelNodeBuilder
instance. Otherwise Otherwise it throws an
IllegalArgumentException
.public NodeState reset(NodeBuilder builder)
KernelRootBuilder.reset()
if builder
is a KernelNodeBuilder
instance. Otherwise it throws an
IllegalArgumentException
.public KernelBlob createBlob(InputStream inputStream) throws IOException
NodeStore
Blob
from the given input stream. The input stream
is closed after this method returns.createBlob
in interface NodeStore
inputStream
- The input stream for the Blob
KernelBlob
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)
NodeStore
checkpoint
in interface NodeStore
lifetime
- time (in milliseconds, > 0) that the checkpoint
should remain availablepublic NodeState retrieve(String checkpoint)
NodeStore
public CacheStats getCacheStats()
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"