Class SystemRoot
- All Implemented Interfaces:
Root
,PermissionAware
MutableRoot
to be used
when an usage of the system internal subject is needed.-
Field Summary
Fields inherited from interface org.apache.jackrabbit.oak.api.Root
COMMIT_PATH
-
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
Atomically persists all changes made to the tree attached to this root.void
Atomically persists all changes made to the tree attached to this root.static SystemRoot
create
(@NotNull NodeStore store, @NotNull CommitHook hook, @NotNull String workspaceName, @NotNull SecurityProvider securityProvider, @NotNull QueryIndexProvider indexProvider) static SystemRoot
create
(@NotNull NodeStore store, @NotNull CommitHook hook, @NotNull String workspaceName, @NotNull SecurityProvider securityProvider, @Nullable QueryEngineSettings queryEngineSettings, @NotNull QueryIndexProvider indexProvider) @NotNull Blob
createBlob
(@NotNull InputStream inputStream) Reads (and closes) the given stream and returns aBlob
that contains that binary.Get a blob by its reference.@NotNull ContentSession
Get theContentSession
from which this root was acquired@NotNull PermissionProvider
@NotNull QueryEngine
Get the query engine.@NotNull org.apache.jackrabbit.oak.core.MutableTree
Retrieve the possible non existingTree
at the given absolutepath
.boolean
Determine whether there are changes on this treeboolean
Move the child located atsourcePath
to a child atdestPath
.void
rebase()
Rebase this root instance to the latest revision.final void
refresh()
Reverts all changes made to this root and refreshed to the latest trunk.
-
Method Details
-
create
public static SystemRoot create(@NotNull @NotNull NodeStore store, @NotNull @NotNull CommitHook hook, @NotNull @NotNull String workspaceName, @NotNull @NotNull SecurityProvider securityProvider, @NotNull @NotNull QueryIndexProvider indexProvider) -
create
public static SystemRoot create(@NotNull @NotNull NodeStore store, @NotNull @NotNull CommitHook hook, @NotNull @NotNull String workspaceName, @NotNull @NotNull SecurityProvider securityProvider, @Nullable @Nullable QueryEngineSettings queryEngineSettings, @NotNull @NotNull QueryIndexProvider indexProvider) -
getContentSession
Description copied from interface:Root
Get theContentSession
from which this root was acquired- Specified by:
getContentSession
in interfaceRoot
- Returns:
- the associated ContentSession
-
move
Description copied from interface:Root
Move the child located atsourcePath
to a child atdestPath
. Both paths must be absolute and resolve to a child located beneath this root.
This method does nothing and returnsfalse
if- the tree at
sourcePath
does not exist or is not accessible, - the parent of the tree at
destinationPath
does not exist or is not accessible, - a tree already exists at
destinationPath
.
destinationPath
exists but is not accessible to the editing content session this method succeeds but a subsequentRoot.commit()
will detect the violation and fail. - the tree at
-
getTree
@NotNull public @NotNull org.apache.jackrabbit.oak.core.MutableTree getTree(@NotNull @NotNull String path) Description copied from interface:Root
Retrieve the possible non existingTree
at the given absolutepath
. The path must resolve to a tree in this root. -
rebase
public void rebase()Description copied from interface:Root
Rebase this root instance to the latest revision. After a call to this method, trees obtained throughRoot.getTree(String)
may become non existing. -
refresh
public final void refresh()Description copied from interface:Root
Reverts all changes made to this root and refreshed to the latest trunk. After a call to this method, trees obtained throughRoot.getTree(String)
may become non existing. -
commit
Description copied from interface:Root
Atomically persists all changes made to the tree attached to this root.If
info
contains a mapping forRoot.COMMIT_PATH
and the associated value is a string, implementations may throw aCommitFailedException
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 apath
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 throughRoot.getTree(String)
may become non existing.- Specified by:
commit
in interfaceRoot
- Parameters:
info
- commit information- Throws:
CommitFailedException
- if the commit failed
-
commit
Description copied from interface:Root
Atomically persists all changes made to the tree attached to this root. Calling this method is equivalent to calling theRoot.commit(Map info)
method with an empty info map.- Specified by:
commit
in interfaceRoot
- Throws:
CommitFailedException
- if the commit failed
-
hasPendingChanges
public boolean hasPendingChanges()Description copied from interface:Root
Determine whether there are changes on this tree- Specified by:
hasPendingChanges
in interfaceRoot
- Returns:
true
iff this tree was modified
-
getQueryEngine
Description copied from interface:Root
Get the query engine.- Specified by:
getQueryEngine
in interfaceRoot
- Returns:
- the query engine
-
createBlob
@NotNull public @NotNull Blob createBlob(@NotNull @NotNull InputStream inputStream) throws IOException Description copied from interface:Root
Reads (and closes) the given stream and returns aBlob
that contains that binary. The returned blob will remain valid at least until theContentSession
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.- Specified by:
createBlob
in interfaceRoot
- Parameters:
inputStream
- the stream for reading the binary- Returns:
- the blob that was created
- Throws:
IOException
- if the stream could not be read
-
getBlob
Description copied from interface:Root
Get a blob by its reference. -
getPermissionProvider
- Specified by:
getPermissionProvider
in interfacePermissionAware
- Returns:
- the
PermissionProvider
associated with the object implementing this interface.
-