Class ConsoleSession


  • public class ConsoleSession
    extends java.lang.Object
    Light weight session to a NodeStore, holding context information.
    • Method Detail

      • 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 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 NodeStore getStore()
        Returns:
        the underlying node store.
      • getWhiteboard

        public Whiteboard getWhiteboard()
      • getWorkingNode

        @NotNull
        public @NotNull 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.