Interface TerminalService
public interface TerminalService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseTerminalSession(String sessionId) Closes theTerminalSessionidentified by the given sessionIdconvertListOfListsToCommandResult(String headline, List<List<String>> lists) convertSimpleListToCommandResult(String headline, List<String> list) convertSimpleListToTableModel(String headline, List<String> list) convertSimpleMapListToCommandResult(List<String> headlines, String emptyTableMessage, List<Map<String, String>> mapList, List<String> firstKeys, Map<String, String> keyToText) Creates aCommandResultthat contains a table created from the given list of maps.convertSimpleMapListToTableModel(String emptyTableMessage, List<Map<String, String>> mapList, List<String> firstKeys, Map<String, String> keyToText) convertSimpleMapToCommandResult(List<String> headlines, String emptyTableMessage, Map<String, Object> map) Creates aCommandResultthat contains a table created from the given map.Creates aCommandResultthat contains a table created from the given map.getObjectByQuery(Class<? extends VirtualFileSystemManagerHook> vfs, String location) getObjectByQuery(Class<? extends VirtualFileSystemManagerHook> vfsManager, String location, boolean checkRights) getObjectByQuery(String location) Fetches a single object by an object resolver query.getObjectByQuery(String location, boolean checkRights) Fetches a single object by an object resolver query.getObjectsByQuery(String location) Fetch objects by an object resolver query.getObjectsByQuery(String location, boolean checkRights) Fetches objects by an object resolver query.<T> TgetSingleObjectOfTypeByQuery(Class<T> type, String query, TerminalSession session, Class<? extends Right>... rights) getTerminalSession(String sessionId) Returns theTerminalSessionidentified by the given sessionIdintgetWidthForText(String text) Gets the width of the given text in pixels if its rendered in the terminalInitializes a newTerminalSession.Joins the list with ", ".
-
Field Details
-
CHAR_WIDTH
static final double CHAR_WIDTH- See Also:
-
-
Method Details
-
initTerminalSession
TerminalSession initTerminalSession()Initializes a newTerminalSession.- Returns:
- The newly initialized
TerminalSession
-
getTerminalSession
Returns theTerminalSessionidentified by the given sessionId- Parameters:
sessionId- The ID of the desiredTerminalSession- Returns:
- The
TerminalSession - Throws:
SessionNotFoundException
-
closeTerminalSession
Closes theTerminalSessionidentified by the given sessionId- Parameters:
sessionId- The ID of theTerminalSession
-
getObjectByQuery
Object getObjectByQuery(Class<? extends VirtualFileSystemManagerHook> vfs, String location) throws VFSException - Throws:
VFSException
-
getObjectByQuery
Fetches a single object by an object resolver query. Permissions are checked.- Parameters:
location- the object resolver query- Returns:
- the object found
- Throws:
ObjectResolverException- if the query is not valid or something happens during query execution
-
getObjectByQuery
Fetches a single object by an object resolver query.- Parameters:
location- the object resolver querycheckRights- if permissions should be checked- Returns:
- the object found
- Throws:
ObjectResolverException- if the query is not valid or something happens during query execution
-
getObjectByQuery
Object getObjectByQuery(Class<? extends VirtualFileSystemManagerHook> vfsManager, String location, boolean checkRights) throws VFSException - Throws:
VFSException
-
getObjectsByQuery
Collection<Object> getObjectsByQuery(String location, boolean checkRights) throws ObjectResolverException Fetches objects by an object resolver query.- Parameters:
location- the object resolver querycheckRights- if permissions should be checked- Returns:
- the objects found
- Throws:
ObjectResolverException- if the query is not valid or something happens during query execution
-
getObjectsByQuery
Fetch objects by an object resolver query. Permissions are checked.- Parameters:
location- the object resolver query- Returns:
- the objects found
- Throws:
ObjectResolverException- if the query is not valid or something happens during query execution
-
getUnscopedTerminalSession
TerminalSession getUnscopedTerminalSession() -
getSingleObjectOfTypeByQuery
<T> T getSingleObjectOfTypeByQuery(Class<T> type, String query, TerminalSession session, Class<? extends Right>... rights) throws ObjectResolverException - Throws:
ObjectResolverException
-
convertResultSetToCommandResult
- Throws:
SQLException
-
convertSimpleMapToCommandResult
CommandResult convertSimpleMapToCommandResult(List<String> headlines, String emptyTableMessage, Map<String, Object> map) Creates aCommandResultthat 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.- Parameters:
headlines- headlines of theCommandResult. 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.- Returns:
- a
CommandResultcontaining the given map as a table.
-
convertSimpleMapToCommandResult
Creates aCommandResultthat 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.- Parameters:
headlines- headlines of theCommandResult. 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.- Returns:
- a
CommandResultcontaining the given map as a table.
-
convertSimpleMapToTableModel
-
getWidthForText
Gets the width of the given text in pixels if its rendered in the terminal- Parameters:
text- The text- Returns:
- the width in pixels.
-
convertSimpleListToTableModel
-
convertSimpleListToCommandResult
-
convertListOfListsToCommandResult
-
convertSimpleMapListToCommandResult
CommandResult convertSimpleMapListToCommandResult(List<String> headlines, String emptyTableMessage, List<Map<String, String>> mapList, List<String> firstKeys, Map<String, String> keyToText) Creates aCommandResultthat 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.- Parameters:
headlines- headlines of theCommandResult. 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 text- Returns:
- a
CommandResultcontaining the given list of maps as a table.
-
convertSimpleMapListToTableModel
-
join
Joins the list with ", ". If sort is true, sorts the given list alphabetically- Parameters:
list- the listsort- if false, just joins without sorting- Returns:
- the converted string
-