Interface IHistorySession


public interface IHistorySession
Interface for history session, used by the console to interface with our XMLHistoryManager. The history manager will create an individualized session for each console instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String command)
    Add a command to the history.
    com.illumon.iris.console.events.IHistoryEntry
    add(String command, Map<String,String> attributes)
    Adds a command to the history, with specified attributes.
    void
    After a session is closed, no more commands can be added to or retrieved from it.
    get(int index)
    Get a command at a particular index in the history.
    Gets all of the history entries, order is not defined.
    Collection<com.illumon.iris.console.events.IHistoryEntry>
    Gets all of the history entries, order is not defined.
    getMatching(String patternString)
    Gets all commands matching a regular expression
    int
    Gets the outstanding entries waiting to be written.
    Gets all commands matching a prefix.
    int
     
  • Method Details

    • add

      void add(String command)
      Add a command to the history.
    • add

      com.illumon.iris.console.events.IHistoryEntry add(String command, Map<String,String> attributes)
      Adds a command to the history, with specified attributes.
      Parameters:
      command - the command string
      attributes - the attributes for this command
      Returns:
      an identifier for the command so that it's attributes can be updated (unique across this workspace)
    • get

      String get(int index)
      Get a command at a particular index in the history. The most recent command executed is at index 0.
      Returns:
      the command text for the given index.
    • size

      int size()
      Returns:
      the number of history entries
    • getAll

      Collection<String> getAll()
      Gets all of the history entries, order is not defined.
      Returns:
      a collection of all the commands available to this session
    • getAllEntries

      Collection<com.illumon.iris.console.events.IHistoryEntry> getAllEntries()
      Gets all of the history entries, order is not defined.
      Returns:
      a collection of all the history entries available to this session
    • getMatching

      List<String> getMatching(String patternString)
      Gets all commands matching a regular expression
      Parameters:
      patternString - a regular expression pattern to match against history entries
      Returns:
      a list of commands that match patternString
    • getPrefixMatching

      List<String> getPrefixMatching(String prefix)
      Gets all commands matching a prefix.
      Parameters:
      prefix - a prefix to match (command.startsWith())
      Returns:
      a list of commands that begin with prefix
    • close

      void close()
      After a session is closed, no more commands can be added to or retrieved from it. The implementation should persist the history for this session.
    • getOutstandingEntries

      int getOutstandingEntries()
      Gets the outstanding entries waiting to be written.
      Returns:
      the number of outstanding entries to be written