public interface TerminalService
Modifier and Type | Field and Description |
---|---|
static double |
CHAR_WIDTH |
Modifier and Type | Method and Description |
---|---|
void |
closeTerminalSession(java.lang.String sessionId)
Closes the
TerminalSession identified by the given sessionId |
CommandResult |
convertListOfListsToCommandResult(java.lang.String headline,
java.util.List<java.util.List<java.lang.String>> lists) |
CommandResult |
convertResultSetToCommandResult(java.sql.ResultSet rs) |
CommandResult |
convertSimpleListToCommandResult(java.lang.String headline,
java.util.List<java.lang.String> list) |
RSTableModel |
convertSimpleListToTableModel(java.lang.String headline,
java.util.List<java.lang.String> list) |
CommandResult |
convertSimpleMapListToCommandResult(java.util.List<java.lang.String> headlines,
java.lang.String emptyTableMessage,
java.util.List<java.util.Map<java.lang.String,java.lang.String>> mapList,
java.util.List<java.lang.String> firstKeys,
java.util.Map<java.lang.String,java.lang.String> keyToText)
Creates a
CommandResult that contains a table created from the given
list of maps. |
RSTableModel |
convertSimpleMapListToTableModel(java.lang.String emptyTableMessage,
java.util.List<java.util.Map<java.lang.String,java.lang.String>> mapList,
java.util.List<java.lang.String> firstKeys,
java.util.Map<java.lang.String,java.lang.String> keyToText) |
CommandResult |
convertSimpleMapToCommandResult(java.util.List<java.lang.String> headlines,
java.util.Map<java.lang.String,java.lang.Object> map)
Creates a
CommandResult that contains a table created from the given
map. |
CommandResult |
convertSimpleMapToCommandResult(java.util.List<java.lang.String> headlines,
java.lang.String emptyTableMessage,
java.util.Map<java.lang.String,java.lang.Object> map)
Creates a
CommandResult that contains a table created from the given
map. |
RSTableModel |
convertSimpleMapToTableModel(java.util.Map<java.lang.String,java.lang.Object> map) |
java.lang.Object |
getObjectByQuery(java.lang.Class<? extends VirtualFileSystemManagerHook> vfs,
java.lang.String location) |
java.lang.Object |
getObjectByQuery(java.lang.Class<? extends VirtualFileSystemManagerHook> vfsManager,
java.lang.String location,
boolean checkRights) |
java.lang.Object |
getObjectByQuery(java.lang.String location)
Fetches a single object by an object resolver query.
|
java.lang.Object |
getObjectByQuery(java.lang.String location,
boolean checkRights)
Fetches a single object by an object resolver query.
|
java.util.Collection<java.lang.Object> |
getObjectsByQuery(java.lang.String location)
Fetch objects by an object resolver query.
|
java.util.Collection<java.lang.Object> |
getObjectsByQuery(java.lang.String location,
boolean checkRights)
Fetches objects by an object resolver query.
|
<T> T |
getSingleObjectOfTypeByQuery(java.lang.Class<T> type,
java.lang.String query,
TerminalSession session,
java.lang.Class<? extends Right>... rights) |
TerminalSession |
getTerminalSession(java.lang.String sessionId)
Returns the
TerminalSession identified by the given sessionId |
TerminalSession |
getUnscopedTerminalSession() |
int |
getWidthForText(java.lang.String text)
Gets the width of the given text in pixels if its rendered in the terminal
|
TerminalSession |
initTerminalSession()
Initializes a new
TerminalSession . |
java.lang.String |
join(java.util.List<java.lang.String> list,
boolean sort)
Joins the list with ", ".
|
static final double CHAR_WIDTH
TerminalSession initTerminalSession()
TerminalSession
.TerminalSession
TerminalSession getTerminalSession(java.lang.String sessionId) throws SessionNotFoundException
TerminalSession
identified by the given sessionIdsessionId
- The ID of the desired TerminalSession
TerminalSession
SessionNotFoundException
void closeTerminalSession(java.lang.String sessionId)
TerminalSession
identified by the given sessionIdsessionId
- The ID of the TerminalSession
java.lang.Object getObjectByQuery(java.lang.Class<? extends VirtualFileSystemManagerHook> vfs, java.lang.String location) throws VFSException
VFSException
java.lang.Object getObjectByQuery(java.lang.String location) throws ObjectResolverException
location
- the object resolver queryObjectResolverException
- if the query is not valid or something
happens during query executionjava.lang.Object getObjectByQuery(java.lang.String location, boolean checkRights) throws ObjectResolverException
location
- the object resolver querycheckRights
- if permissions should be checkedObjectResolverException
- if the query is not valid or something
happens during query executionjava.lang.Object getObjectByQuery(java.lang.Class<? extends VirtualFileSystemManagerHook> vfsManager, java.lang.String location, boolean checkRights) throws VFSException
VFSException
java.util.Collection<java.lang.Object> getObjectsByQuery(java.lang.String location, boolean checkRights) throws ObjectResolverException
location
- the object resolver querycheckRights
- if permissions should be checkedObjectResolverException
- if the query is not valid or something
happens during query executionjava.util.Collection<java.lang.Object> getObjectsByQuery(java.lang.String location) throws ObjectResolverException
location
- the object resolver queryObjectResolverException
- if the query is not valid or something
happens during query executionTerminalSession getUnscopedTerminalSession()
<T> T getSingleObjectOfTypeByQuery(java.lang.Class<T> type, java.lang.String query, TerminalSession session, java.lang.Class<? extends Right>... rights) throws ObjectResolverException
ObjectResolverException
CommandResult convertResultSetToCommandResult(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
CommandResult convertSimpleMapToCommandResult(java.util.List<java.lang.String> headlines, java.lang.String emptyTableMessage, java.util.Map<java.lang.String,java.lang.Object> map)
CommandResult
that contains a table created from the given
map. The table contains the map keys as the first table column and their
corresponding values as the second table column.headlines
- headlines of the CommandResult
. Each
headline is printed in a new row. Note that these
are NOT the table headers.emptyTableMessage
- message to show if the map is empty.map
- the map. Its keys map to the first table column of
the result, their corresponding values to its second
table column.CommandResult
containing the given map as a table.CommandResult convertSimpleMapToCommandResult(java.util.List<java.lang.String> headlines, java.util.Map<java.lang.String,java.lang.Object> map)
CommandResult
that contains a table created from the given
map. The table contains the map keys as the first table column and their
corresponding values as the second table column.headlines
- headlines of the CommandResult
. Each headline is
printed in a new row. Note that these are NOT the table
headers.map
- the map. Its keys map to the first table column of the
result, their corresponding values to its second table
column.CommandResult
containing the given map as a table.RSTableModel convertSimpleMapToTableModel(java.util.Map<java.lang.String,java.lang.Object> map)
int getWidthForText(java.lang.String text)
text
- The textRSTableModel convertSimpleListToTableModel(java.lang.String headline, java.util.List<java.lang.String> list)
CommandResult convertSimpleListToCommandResult(java.lang.String headline, java.util.List<java.lang.String> list)
CommandResult convertListOfListsToCommandResult(java.lang.String headline, java.util.List<java.util.List<java.lang.String>> lists)
CommandResult convertSimpleMapListToCommandResult(java.util.List<java.lang.String> headlines, java.lang.String emptyTableMessage, java.util.List<java.util.Map<java.lang.String,java.lang.String>> mapList, java.util.List<java.lang.String> firstKeys, java.util.Map<java.lang.String,java.lang.String> keyToText)
CommandResult
that contains a table created from the given
list of maps. The map keys map to the table headers, their corresponding
values map to the table values. All maps must have the same size. The order
of the headers is not defined. If the firstHeaders attribute is given, the
table headers contain the given firstHeaders in first place and their order
is preserved. All firstHeaders must be contained in all maps.headlines
- headlines of the CommandResult
. Each
headline is printed in a new row. Note that these
are NOT the table headers.emptyTableMessage
- message to shwo if the list of maps is empty.mapList
- the list of maps.firstKeys
- the ordered first map keys to appear in the tablekeyToDisplayText
- maps the map keys to a display textCommandResult
containing the given list of maps as a table.RSTableModel convertSimpleMapListToTableModel(java.lang.String emptyTableMessage, java.util.List<java.util.Map<java.lang.String,java.lang.String>> mapList, java.util.List<java.lang.String> firstKeys, java.util.Map<java.lang.String,java.lang.String> keyToText)
java.lang.String join(java.util.List<java.lang.String> list, boolean sort)
list
- the listsort
- if false, just joins without sorting