Class TerminalService
java.lang.Object
io.github.eggy03.dmidecode.terminal.TerminalService
A service class that provides a way to launch a terminal session
for internal use
- Since:
- 0.1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) @NonNull TerminalResultLaunches a standalone Terminal session and executes commands and returns the result@NonNull TerminalResultexecuteCommand(@NonNull DMIType dmiType, long timeoutSeconds) Launches a standalone PowerShell session, executesDMIType.getCommand()and returns the result
-
Field Details
-
log
private static final org.slf4j.Logger log
-
-
Constructor Details
-
TerminalService
public TerminalService()
-
-
Method Details
-
executeCommand
Launches a standalone PowerShell session, executesDMIType.getCommand()and returns the result- Parameters:
dmiType- The non-null enum value containing the command which shall be executedtimeoutSeconds- The non-null, positive value of time in seconds after which the session will be force stopped.- Returns:
- The result of the query executed, wrapped in
TerminalResult - Since:
- 0.3.0
-
execute
Launches a standalone Terminal session and executes commands and returns the result- Parameters:
command- The command to be executed in the Terminal, must not be nulltimeoutSeconds- Time in seconds after which the session will be force stopped, must not be null.- Returns:
- The result of the command executed, wrapped in
TerminalResult - Throws:
IllegalArgumentException- if timeout is in negative.- Since:
- 0.1.0
-