Package io.fathom.cloud.ssh

Examples of io.fathom.cloud.ssh.SshConfig


        }

    }

    private void runSshCommand(String... args) throws Exception {
        SshConfig sshConfig = sshContext.buildConfig(new InetSocketAddress("127.0.0.1", 2222));

        StringBuilder cmd = new StringBuilder();
        for (String arg : args) {
            if (cmd.length() != 0) {
                cmd.append(' ');
            }

            // TODO: Check for spaces and quote??
            cmd.append(arg);
        }

        ByteArrayOutputStream stdout = new ByteArrayOutputStream();
        ByteArrayOutputStream stderr = new ByteArrayOutputStream();
        int exitCode = sshConfig.execute(cmd.toString(), stdout, stderr);

        if (exitCode != 0) {
            System.out.println("Command: " + cmd);
            System.out.println("STDOUT: " + new String(stdout.toByteArray(), Charsets.UTF_8));
            System.out.println("STDERR: " + new String(stderr.toByteArray(), Charsets.UTF_8));
View Full Code Here


            if (bestAddress == null) {
                throw new IllegalStateException("Unable to find suitable address to communicate with node: " + nodeData);
            }

            InetSocketAddress sshSocketAddress = new InetSocketAddress(bestAddress, 22);
            SshConfig sshConfig = sshContext.buildConfig(sshSocketAddress);

            SftpBlobStore.Factory blobStoreFactory;
            String store = nodeData.getStore();
            if (store.startsWith("sftp://")) {
                File path = new File(store.substring(7));
View Full Code Here

            IpRange ipRange = IpRange.parse(hostData.getCidr());

            InetAddress address = ipRange.getAddress();

            InetSocketAddress sshSocketAddress = new InetSocketAddress(address, 22);
            SshConfig sshConfig = sshContext.buildConfig(sshSocketAddress);

            SchedulerHost host = new GawkerHost(datacenter, hostData, sshConfig);

            synchronized (allHosts) {
                allHosts.put(hostData.getId(), host);
View Full Code Here

TOP

Related Classes of io.fathom.cloud.ssh.SshConfig

Copyright © 2018 www.massapicom. 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.