public class SystemRoot
extends java.lang.Object
MutableRoot
to be used
when an usage of the system internal subject is needed.COMMIT_PATH
Modifier and Type | Method and Description |
---|---|
void |
commit()
Atomically persists all changes made to the tree attached to this root.
|
void |
commit(@NotNull java.util.Map<java.lang.String,java.lang.Object> info)
Atomically persists all changes made to the tree attached to this root.
|
static SystemRoot |
create(@NotNull NodeStore store,
@NotNull CommitHook hook,
@NotNull java.lang.String workspaceName,
@NotNull SecurityProvider securityProvider,
@Nullable QueryEngineSettings queryEngineSettings,
@NotNull QueryIndexProvider indexProvider) |
static SystemRoot |
create(@NotNull NodeStore store,
@NotNull CommitHook hook,
@NotNull java.lang.String workspaceName,
@NotNull SecurityProvider securityProvider,
@NotNull QueryIndexProvider indexProvider) |
@NotNull Blob |
createBlob(@NotNull java.io.InputStream inputStream)
Reads (and closes) the given stream and returns a
Blob that
contains that binary. |
Blob |
getBlob(@NotNull java.lang.String reference)
Get a blob by its reference.
|
@NotNull ContentSession |
getContentSession()
Get the
ContentSession from which this root was acquired |
@NotNull PermissionProvider |
getPermissionProvider() |
@NotNull QueryEngine |
getQueryEngine()
Get the query engine.
|
@NotNull org.apache.jackrabbit.oak.core.MutableTree |
getTree(@NotNull java.lang.String path)
Retrieve the possible non existing
Tree at the given absolute path . |
boolean |
hasPendingChanges()
Determine whether there are changes on this tree
|
boolean |
move(java.lang.String sourcePath,
java.lang.String destPath)
Move the child located at
sourcePath to a child at destPath . |
void |
rebase()
Rebase this root instance to the latest revision.
|
void |
refresh()
Reverts all changes made to this root and refreshed to the latest trunk.
|
public static SystemRoot create(@NotNull @NotNull NodeStore store, @NotNull @NotNull CommitHook hook, @NotNull @NotNull java.lang.String workspaceName, @NotNull @NotNull SecurityProvider securityProvider, @NotNull @NotNull QueryIndexProvider indexProvider)
public static SystemRoot create(@NotNull @NotNull NodeStore store, @NotNull @NotNull CommitHook hook, @NotNull @NotNull java.lang.String workspaceName, @NotNull @NotNull SecurityProvider securityProvider, @Nullable @Nullable QueryEngineSettings queryEngineSettings, @NotNull @NotNull QueryIndexProvider indexProvider)
@NotNull public @NotNull ContentSession getContentSession()
Root
ContentSession
from which this root was acquiredgetContentSession
in interface Root
public boolean move(java.lang.String sourcePath, java.lang.String destPath)
Root
sourcePath
to a child at destPath
.
Both paths must be absolute and resolve to a child located beneath this
root.false
if
sourcePath
does not exist or is not accessible,destinationPath
does not exist or is not accessible,destinationPath
.destinationPath
exists but is not accessible to the
editing content session this method succeeds but a subsequent
Root.commit()
will detect the violation and fail.@NotNull public @NotNull org.apache.jackrabbit.oak.core.MutableTree getTree(@NotNull @NotNull java.lang.String path)
Root
Tree
at the given absolute path
.
The path must resolve to a tree in this root.public void rebase()
Root
Root.getTree(String)
may become non existing.public final void refresh()
Root
Root.getTree(String)
may become non existing.public void commit(@NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> info) throws CommitFailedException
Root
If info
contains a mapping for Root.COMMIT_PATH
and the
associated value is a string, implementations may throw a
CommitFailedException
if there are changes outside of the subtree
designated by that path and the implementation does not support
such partial commits. However all implementation must handler the
case where a path
designates a subtree that contains all
unpersisted changes.
The info
map is passed to the underlying storage
as a part of the internal commit information attached to this commit.
The commit information will be made available to local observers but
will not be visible to observers on other cluster nodes.
After a successful operation the root is automatically
refreshed
, such that trees previously obtained
through Root.getTree(String)
may become non existing.
commit
in interface Root
info
- commit informationCommitFailedException
- if the commit failedpublic void commit() throws CommitFailedException
Root
Root.commit(Map info)
method with an empty info map.commit
in interface Root
CommitFailedException
- if the commit failedpublic boolean hasPendingChanges()
Root
hasPendingChanges
in interface Root
true
iff this tree was modified@NotNull public @NotNull QueryEngine getQueryEngine()
Root
getQueryEngine
in interface Root
@NotNull public @NotNull Blob createBlob(@NotNull @NotNull java.io.InputStream inputStream) throws java.io.IOException
Root
Blob
that
contains that binary. The returned blob will remain valid at least
until the ContentSession
of this root is closed, or longer
if it has been committed as a part of a content update.
The implementation may decide to persist the blob at any point
during or between this method method call and a Root.commit()
that includes the blob, but the blob will become visible to other
sessions only after such a commit.
createBlob
in interface Root
inputStream
- the stream for reading the binaryjava.io.IOException
- if the stream could not be readpublic Blob getBlob(@NotNull @NotNull java.lang.String reference)
Root
getBlob
in interface Root
reference
- reference to the blobnull
if the reference does not resolve to a blob.Blob.getReference()
@NotNull public @NotNull PermissionProvider getPermissionProvider()
getPermissionProvider
in interface PermissionAware
PermissionProvider
associated with the object implementing this interface.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.