Class ConsoleSession
- java.lang.Object
-
- org.apache.jackrabbit.oak.console.ConsoleSession
-
public class ConsoleSession extends java.lang.ObjectLight weight session to a NodeStore, holding context information.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcheckpoint(long lifetimeSeconds)Creates and returns a checkpoint with the given lifetime in seconds.static ConsoleSessioncreate(org.apache.jackrabbit.oak.spi.state.NodeStore store, org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard)org.apache.jackrabbit.oak.spi.state.NodeStategetRoot()Returns the currently set root node.org.apache.jackrabbit.oak.spi.state.NodeStoregetStore()org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardgetWhiteboard()@NotNull org.apache.jackrabbit.oak.spi.state.NodeStategetWorkingNode()The node state for the current working path.java.lang.StringgetWorkingPath()Returns the current working path.booleanisAutoRefresh()voidrefresh()Performs a manual refresh of the root node state.voidretrieve(java.lang.String checkpoint)Retrieves the root node from a previously created checkpoint.voidsetAutoRefresh(boolean enable)Enables or disables auto-refresh of the root node state ongetRoot().java.lang.StringsetWorkingPath(java.lang.String path)Sets a new working path and returns the previously set.
-
-
-
Method Detail
-
create
public static ConsoleSession create(org.apache.jackrabbit.oak.spi.state.NodeStore store, org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard)
-
getWorkingPath
public java.lang.String getWorkingPath()
Returns the current working path. This method will return the path of the root node if none is set explicity.- Returns:
- the current working path.
-
setWorkingPath
public java.lang.String setWorkingPath(java.lang.String path)
Sets a new working path and returns the previously set.- Parameters:
path- the new working path.- Returns:
- the previously set working path.
-
checkpoint
public java.lang.String checkpoint(long lifetimeSeconds)
Creates and returns a checkpoint with the given lifetime in seconds.- Parameters:
lifetimeSeconds- the lifetime of the checkpoint in seconds.- Returns:
- the checkpoint reference.
-
retrieve
public void retrieve(java.lang.String checkpoint)
Retrieves the root node from a previously created checkpoint. The root node is available withgetRoot().- Parameters:
checkpoint- the checkpoint reference.
-
getRoot
public org.apache.jackrabbit.oak.spi.state.NodeState getRoot()
Returns the currently set root node. IfisAutoRefresh()is set, a fresh root node is retrieved from the store.- Returns:
- the current root node.
-
getStore
public org.apache.jackrabbit.oak.spi.state.NodeStore getStore()
- Returns:
- the underlying node store.
-
getWhiteboard
public org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard getWhiteboard()
-
getWorkingNode
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getWorkingNode()
The node state for the current working path. Possibly non-existent.- Returns:
- the working node state.
-
setAutoRefresh
public void setAutoRefresh(boolean enable)
Enables or disables auto-refresh of the root node state ongetRoot().- Parameters:
enable- enables or disables auto-refresh.
-
isAutoRefresh
public boolean isAutoRefresh()
- Returns:
trueif auto-refresh is enabled;falseotherwise.
-
refresh
public void refresh()
Performs a manual refresh of the root node state.
-
-