Class SshdSession

    • Method Detail

      • addCloseListener

        public void addCloseListener​(@NonNull
                                     SessionCloseListener listener)
        Adds a SessionCloseListener to this session. Has no effect if the given listener is already registered with this session.
        Parameters:
        listener - to add
      • removeCloseListener

        public void removeCloseListener​(@NonNull
                                        SessionCloseListener listener)
        Removes the given listener; has no effect if the listener is not currently registered with this session.
        Parameters:
        listener - to remove
      • exec

        public Process exec​(String commandName,
                            int timeout)
                     throws IOException
        Description copied from interface: RemoteSession
        Creates a new remote Process to execute the given command. The returned process's streams exist and are connected, and execution of the process is already started.
        Specified by:
        exec in interface RemoteSession
        Parameters:
        commandName - command to execute
        timeout - timeout value, in seconds, for creating the remote process
        Returns:
        a new remote process, already started
        Throws:
        IOException - may be thrown in several cases. For example, on problems opening input or output streams or on problems connecting or communicating with the remote host. For the latter two cases, a TransportException may be thrown (a subclass of java.io.IOException).
      • exec

        public Process exec​(String commandName,
                            Map<String,​String> environment,
                            int timeout)
                     throws IOException
        Description copied from interface: RemoteSession2
        Creates a new remote Process to execute the given command. The returned process's streams exist and are connected, and execution of the process is already started.
        Specified by:
        exec in interface RemoteSession2
        Parameters:
        commandName - command to execute
        environment - environment variables to pass on
        timeout - timeout value, in seconds, for creating the remote process
        Returns:
        a new remote process, already started
        Throws:
        IOException - may be thrown in several cases. For example, on problems opening input or output streams or on problems connecting or communicating with the remote host. For the latter two cases, a TransportException may be thrown (a subclass of java.io.IOException).