Package com.jcraft.jsch

Examples of com.jcraft.jsch.Channel.disconnect()


        out.flush();
        if (checkAck(in) != 0) {
          throw new CoreException(SSH_FAILED_STATUS3);
        }
        out.close();
        channel.disconnect();

        // move the jar file to a temp directory
        String jarDir = "/tmp/hadoopjar"
            + new VMID().toString().replace(':', '_');
        command = "mkdir " + jarDir + ";mv " + remoteFile + " " + jarDir;
View Full Code Here


            + new VMID().toString().replace(':', '_');
        command = "mkdir " + jarDir + ";mv " + remoteFile + " " + jarDir;
        channel = session.openChannel("exec");
        ((ChannelExec) channel).setCommand(command);
        channel.connect();
        channel.disconnect();

        session.disconnect();

        // we create a new session with a zero timeout to prevent the
        // console stream
View Full Code Here

            String command =
                server.getInstallPath() + "/bin/hadoop job -kill " + jobId;
            Channel channel = session.openChannel("exec");
            ((ChannelExec) channel).setCommand(command);
            channel.connect();
            channel.disconnect();

            session.disconnect();
          } catch (JSchException e) {
            e.printStackTrace();
          }
View Full Code Here

        c.connect();
        OutputStream os = c.getOutputStream();
        os.write("this is my command".getBytes());
        os.flush();
        Thread.sleep(100);
        c.disconnect();
        s.disconnect();
    }


}
View Full Code Here

            sendAck(out);
            startRemoteCpProtocol(in, out, localFile);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
        log("done\n");
    }
View Full Code Here

            waitForAck(in);
            sendFileToRemote(localFile, in, out);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    private void doMultipleTransfer() throws IOException, JSchException {
View Full Code Here

                Directory current = (Directory) i.next();
                sendDirectory(current, in, out);
            }
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    private void sendDirectory(Directory current,
View Full Code Here

            sendAck(out);
            startRemoteCpProtocol(in, out, localFile);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
        log("done\n");
    }
View Full Code Here

          LOGGER.error("Failed to close SSH error stream reader", e);
        }
      }

      if (channel != null && channel.isConnected()) {
        channel.disconnect();
      }
    }
  }

  /**
 
View Full Code Here

            throw new IOException("Error while trying to write " + destFilename + " , " + getReason(in));
        }

        out.close();

        channel.disconnect();

        return true;
    }

    public static int checkAck(InputStream in) throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.