org.apache.sshd
Interface ClientSession

All Known Implementing Classes:
ClientSessionImpl

public interface ClientSession

An authenticated session to a given SSH server A client session is established using the 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.

Author:
Apache MINA SSHD Project

Field Summary
static int AUTHED
           
static int CLOSED
           
static int TIMEOUT
           
static int WAIT_AUTH
           
 
Method Summary
 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)
           
 

Field Detail

TIMEOUT

static final int TIMEOUT
See Also:
Constant Field Values

CLOSED

static final int CLOSED
See Also:
Constant Field Values

WAIT_AUTH

static final int WAIT_AUTH
See Also:
Constant Field Values

AUTHED

static final int AUTHED
See Also:
Constant Field Values
Method Detail

authAgent

AuthFuture authAgent(String username)
                     throws IOException
Throws:
IOException

authPassword

AuthFuture authPassword(String username,
                        String password)
                        throws IOException
Throws:
IOException

authPublicKey

AuthFuture authPublicKey(String username,
                         KeyPair key)
                         throws IOException
Throws:
IOException

createChannel

ClientChannel createChannel(String type)
                            throws Exception
Throws:
Exception

createChannel

ClientChannel createChannel(String type,
                            String subType)
                            throws Exception
Throws:
Exception

createShellChannel

ChannelShell createShellChannel()
                                throws Exception
Throws:
Exception

createExecChannel

ChannelExec createExecChannel(String command)
                              throws Exception
Throws:
Exception

createSubsystemChannel

ChannelSubsystem createSubsystemChannel(String subsystem)
                                        throws Exception
Throws:
Exception

waitFor

int waitFor(int mask,
            long timeout)

close

CloseFuture close(boolean immediately)

getMetadataMap

Map<Object,Object> getMetadataMap()


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.