Search in sources :

Example 61 with Session

use of ch.ethz.ssh2.Session in project Payara by payara.

the class SSHLauncher method runCommandAsIs.

private int runCommandAsIs(String command, OutputStream os, List<String> stdinLines) throws IOException, InterruptedException {
    if (logger.isLoggable(Level.FINER)) {
        logger.finer("Running command " + command + " on host: " + this.host);
    }
    openConnection();
    final Session sess = connection.openSession();
    int status = exec(sess, command, os, listInputStream(stdinLines));
    // XXX: Should we close connection after each command or cache it
    // and re-use it?
    SSHUtil.unregister(connection);
    connection = null;
    return status;
}
Also used : Session(com.trilead.ssh2.Session)

Aggregations

Session (com.trilead.ssh2.Session)37 Connection (com.trilead.ssh2.Connection)31 IOException (java.io.IOException)25 InputStream (java.io.InputStream)24 Session (org.neo4j.driver.v1.Session)16 Test (org.junit.Test)15 Driver (org.neo4j.driver.v1.Driver)14 CoreClusterMember (org.neo4j.causalclustering.discovery.CoreClusterMember)9 RoutingNetworkSession (org.neo4j.driver.internal.RoutingNetworkSession)9 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)8 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)8 HttpException (org.apache.commons.httpclient.HttpException)8 Session (ch.ethz.ssh2.Session)6 SCPClient (com.trilead.ssh2.SCPClient)6 StreamGobbler (com.trilead.ssh2.StreamGobbler)5 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 Transaction (org.neo4j.driver.v1.Transaction)5 Record (org.neo4j.driver.v1.Record)4 StreamGobbler (ch.ethz.ssh2.StreamGobbler)3 BufferedReader (java.io.BufferedReader)3