Class ConsoleSession


  • public class ConsoleSession
    extends java.lang.Object
    Light 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.String checkpoint​(long lifetimeSeconds)
      Creates and returns a checkpoint with the given lifetime in seconds.
      static ConsoleSession create​(org.apache.jackrabbit.oak.spi.state.NodeStore store, org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard)  
      org.apache.jackrabbit.oak.spi.state.NodeState getRoot()
      Returns the currently set root node.
      org.apache.jackrabbit.oak.spi.state.NodeStore getStore()  
      org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard getWhiteboard()  
      @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getWorkingNode()
      The node state for the current working path.
      java.lang.String getWorkingPath()
      Returns the current working path.
      boolean isAutoRefresh()  
      void refresh()
      Performs a manual refresh of the root node state.
      void retrieve​(java.lang.String checkpoint)
      Retrieves the root node from a previously created checkpoint.
      void setAutoRefresh​(boolean enable)
      Enables or disables auto-refresh of the root node state on getRoot().
      java.lang.String setWorkingPath​(java.lang.String path)
      Sets a new working path and returns the previously set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 with getRoot().
        Parameters:
        checkpoint - the checkpoint reference.
      • getRoot

        public org.apache.jackrabbit.oak.spi.state.NodeState getRoot()
        Returns the currently set root node. If isAutoRefresh() 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 on getRoot().
        Parameters:
        enable - enables or disables auto-refresh.
      • isAutoRefresh

        public boolean isAutoRefresh()
        Returns:
        true if auto-refresh is enabled; false otherwise.
      • refresh

        public void refresh()
        Performs a manual refresh of the root node state.