cf.await(); try (ClientSession session = cf.getSession()) { for (KeyPair pair : provider.getKeys()) { CLI.LOGGER.log(FINE, "Offering {0} private key", pair.getPrivate().getAlgorithm()); session.addPublicKeyIdentity(pair); session.auth().verify(10000L);
@Override public AuthFuture verify(long timeoutMillis) throws IOException { Boolean result = verifyResult(Boolean.class, timeoutMillis); if (!result) { throw formatExceptionMessage(SshException::new, "Authentication failed while waiting %d msec.", timeoutMillis); } return this; }
@Override public Throwable getException() { Object v = getValue(); if (v instanceof Throwable) { return (Throwable) v; } else { return null; } }
ClientSession session = client.connect("localhost", port).await().getSession(); session.authPassword("root", "");
@Override public void operationComplete(final OpenFuture future) { if(future.isOpened()) { handleSshChanelOpened(ctx); } else { handleSshSetupFailure(ctx, future.getException()); } } });
@Override public void operationComplete(final ConnectFuture future) { if (future.isConnected()) { handleSshSessionCreated(future, ctx); } else { handleSshSetupFailure(ctx, future.getException()); } } });
@Override public OpenFuture verify(long timeoutMillis) throws IOException { Boolean result = verifyResult(Boolean.class, timeoutMillis); if (!result) { throw formatExceptionMessage(SshException::new, "Channel opening failed while waiting %d msec.", timeoutMillis); } return this; }
@Override public Throwable getException() { Object v = getValue(); if (v instanceof Throwable) { return (Throwable) v; } else { return null; } }
@Override public Throwable getException() { Object v = getValue(); if (v instanceof Throwable) { return (Throwable) v; } else { return null; } }
@Override public void setOpened() { setValue(Boolean.TRUE); }
@Override public void operationComplete(final ConnectFuture future) { if (future.isConnected()) { handleSshSessionCreated(future, ctx); } else { handleSshSetupFailure(ctx, future.getException()); } } });
@Override public OpenFuture verify(long timeoutMillis) throws IOException { Boolean result = verifyResult(Boolean.class, timeoutMillis); if (!result) { throw formatExceptionMessage(SshException::new, "Channel opening failed while waiting %d msec.", timeoutMillis); } return this; }
@Override public boolean isFailure() { Object v = getValue(); if (v instanceof Boolean) { return !(Boolean) v; } else { return true; } }
@Override public boolean isConnected() { return getValue() instanceof ClientSession; }
@Override public boolean isOpened() { Object value = getValue(); return (value instanceof Boolean) && (Boolean) value; }
@Override public boolean isSuccess() { Object v = getValue(); return (v instanceof Boolean) && (Boolean) v; }
@Override public Throwable getException() { Object v = getValue(); if (v instanceof Throwable) { return (Throwable) v; } else { return null; } }
@Override public boolean isOpened() { Object value = getValue(); return (value instanceof Boolean) && (Boolean) value; }
@Override public boolean isSuccess() { Object v = getValue(); return (v instanceof Boolean) && (Boolean) v; }
@Override public boolean isFailure() { Object v = getValue(); if (v instanceof Boolean) { return !(Boolean) v; } else { return true; } }