public interface ClientSession
SshClient
.
Once the session has been created, the user has to authenticate
using either authPassword(String, String)
or
authPublicKey(String, java.security.KeyPair)
.
From this session, channels can be created using the
createChannel(String)
method. Multiple channels can
be created on a given session concurrently.
When using the client in an interactive mode, the
waitFor(int, long)
method can be used to listen to specific
events such as the session being established, authenticated or closed.
When a given session is no longer used, it must be closed using the
close(boolean)
method.Modifier and Type | Field and Description |
---|---|
static int |
AUTHED |
static int |
CLOSED |
static int |
TIMEOUT |
static int |
WAIT_AUTH |
Modifier and Type | Method and Description |
---|---|
AuthFuture |
authAgent(String username) |
AuthFuture |
authPassword(String username,
String password) |
AuthFuture |
authPublicKey(String username,
KeyPair key) |
CloseFuture |
close(boolean immediately) |
ClientChannel |
createChannel(String type) |
ClientChannel |
createChannel(String type,
String subType) |
ChannelExec |
createExecChannel(String command) |
ChannelShell |
createShellChannel() |
ChannelSubsystem |
createSubsystemChannel(String subsystem) |
Map<Object,Object> |
getMetadataMap() |
int |
waitFor(int mask,
long timeout) |
static final int TIMEOUT
static final int CLOSED
static final int WAIT_AUTH
static final int AUTHED
AuthFuture authAgent(String username) throws IOException
IOException
AuthFuture authPassword(String username, String password) throws IOException
IOException
AuthFuture authPublicKey(String username, KeyPair key) throws IOException
IOException
ClientChannel createChannel(String type) throws Exception
Exception
ClientChannel createChannel(String type, String subType) throws Exception
Exception
ChannelShell createShellChannel() throws Exception
Exception
ChannelExec createExecChannel(String command) throws Exception
Exception
ChannelSubsystem createSubsystemChannel(String subsystem) throws Exception
Exception
int waitFor(int mask, long timeout)
CloseFuture close(boolean immediately)
Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.