Class ExecuteSystemCommandRequest


  • public class ExecuteSystemCommandRequest
    extends JsonrpcRequest
    Represents a JSON-RPC Request to execute a system command on OpenEMS Edge.
     {
       "jsonrpc": "2.0",
       "id": "UUID",
       "method": "executeSystemCommand",
       "params": {
            "command": string,
            "runInBackground"?: boolean = false, // run the command in background (true) or in foreground (false)
            "timeoutSeconds"?: number = 5, // interrupt the command after ... seconds
            "username"?: string,
            "password"?: string,
       }
     }
     
    • Constructor Detail

      • ExecuteSystemCommandRequest

        public ExecuteSystemCommandRequest​(java.lang.String command,
                                           boolean runInBackground,
                                           int timeoutSeconds,
                                           java.util.Optional<java.lang.String> username,
                                           java.util.Optional<java.lang.String> password)
      • ExecuteSystemCommandRequest

        public ExecuteSystemCommandRequest​(java.util.UUID id,
                                           java.lang.String command,
                                           boolean runInBackground,
                                           int timeoutSeconds,
                                           java.util.Optional<java.lang.String> username,
                                           java.util.Optional<java.lang.String> password)
    • Method Detail

      • runInBackgroundWithoutAuthentication

        public static ExecuteSystemCommandRequest runInBackgroundWithoutAuthentication​(java.lang.String command)
        Factory without Username + Password; run in background without timeout.
        Parameters:
        command - the command
        Returns:
        the ExecuteSystemCommandRequest
      • withoutAuthentication

        public static ExecuteSystemCommandRequest withoutAuthentication​(java.lang.String command,
                                                                        boolean runInBackground,
                                                                        int timeoutSeconds)
        Factory without Username + Password.
        Parameters:
        command - the command
        runInBackground - run the command in background (true) or in foreground (false)
        timeoutSeconds - interrupt the command after ... seconds
        Returns:
        the ExecuteSystemCommandRequest
      • getCommand

        public java.lang.String getCommand()
        Gets the request command.
        Returns:
        the command
      • isRunInBackground

        public boolean isRunInBackground()
        Gets the request isRunInBackground option.
        Returns:
        the isRunInBackground option
      • getTimeoutSeconds

        public int getTimeoutSeconds()
        Gets the request timeout.
        Returns:
        the timeout in seconds
      • getUsername

        public java.util.Optional<java.lang.String> getUsername()
        Gets the request username.
        Returns:
        the username
      • getPassword

        public java.util.Optional<java.lang.String> getPassword()
        Gets the request password.
        Returns:
        the password