Class SshConnectionManager

java.lang.Object
org.qubership.atp.mia.repo.impl.SshConnectionManager

public class SshConnectionManager extends Object
  • Constructor Details

    • SshConnectionManager

      public SshConnectionManager(SshSession session, String extPrefix, MiaContext miaContext)
      Creates instance of SshConnectionManager. It's recommended to use
       
       ConnectionPool#getConnection(Server, String, FlowData)
       
      instead of a manual creation.
  • Method Details

    • runCommand

      public String runCommand(@Nonnull String command)
      Executes SSH command with external environment specific.
      Parameters:
      command - command to execute
      Returns:
      output of command execution
    • uploadFileOnServer

      public void uploadFileOnServer(File file, String pathToUpLoad, String workingDirectory)
      Uploads a file.
    • transferFileOnServer

      public void transferFileOnServer(String pathToFile, String pathToUpLoad)
      Transfer a file.
    • getFileFromServer

      public File getFileFromServer(String path, String workingDirectory)
      Get file from ssh server.
    • putFileFromServer

      public void putFileFromServer(Path pathToFile, String pathToUpLoad)
      Put file from ssh server.
    • removeFileFromServer

      public void removeFileFromServer(String pathToFile)
      Remove file from ssh server.
    • getExecutedCommand

      public String getExecutedCommand()
      Gets executed command.
      Returns:
      executed command
    • connectionInfo

      public Map<String,String> connectionInfo()
      Gets connectionInfo.
      Returns:
      MAP with information about host and user.