Package com.illumon.iris.console.events
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 TypeMethodDescriptionvoid
Add a command to the history.com.illumon.iris.console.events.IHistoryEntry
Adds a command to the history, with specified attributes.void
close()
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.getAll()
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 expressionint
Gets the outstanding entries waiting to be written.getPrefixMatching
(String prefix) Gets all commands matching a prefix.int
size()
-
Method Details
-
add
Add a command to the history. -
add
Adds a command to the history, with specified attributes.- Parameters:
command
- the command stringattributes
- the attributes for this command- Returns:
- an identifier for the command so that it's attributes can be updated (unique across this workspace)
-
get
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
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
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
-