Package org.sentrysoftware.winrm
Interface WindowsRemoteExecutor
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
WinRMService
-
Method Summary
Modifier and TypeMethodDescriptionexecuteCommand
(String command, String workingDirectory, Charset charset, long timeout) Execute the command on the remoteexecuteWql
(String wqlQuery, long timeout) Execute a WQL query and process its result.Get the hostname.char[]
Get the password.Get the username.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
executeWql
List<Map<String,Object>> executeWql(String wqlQuery, long timeout) throws TimeoutException, WqlQuerySyntaxException, WindowsRemoteException Execute a WQL query and process its result.
- Parameters:
wqlQuery
- the WQL query (required)timeout
- Timeout in milliseconds (throws an IllegalArgumentException if negative or zero)- Returns:
- a list of result rows. A result row is a Map(LinkedHashMap to preserve the query order) of properties/values.
- Throws:
TimeoutException
- to notify userName of timeout.WqlQuerySyntaxException
- if WQL query syntax is invalidWindowsRemoteException
- For any problem encountered
-
executeCommand
WindowsRemoteCommandResult executeCommand(String command, String workingDirectory, Charset charset, long timeout) throws WindowsRemoteException, TimeoutException Execute the command on the remote- Parameters:
command
- The command to executeworkingDirectory
- Path of the directory for the spawned process on the remote system (can be null)charset
- The charsettimeout
- Timeout in milliseconds- Returns:
- The command result
- Throws:
WindowsRemoteException
- For any problem encounteredTimeoutException
- To notify userName of timeout.
-
getHostname
String getHostname()Get the hostname.- Returns:
-
getUsername
String getUsername()Get the username.- Returns:
-
getPassword
char[] getPassword()Get the password.- Returns:
-