org.apache.sshd.client.session
Class ClientSessionImpl
java.lang.Object
org.apache.sshd.common.session.AbstractSession
org.apache.sshd.client.session.ClientSessionImpl
- All Implemented Interfaces:
- ClientSession, Session
public class ClientSessionImpl
- extends AbstractSession
- implements ClientSession
TODO Add javadoc
- Author:
- Apache MINA SSHD Project
| Fields inherited from class org.apache.sshd.common.session.AbstractSession |
attributes, authed, channels, clientProposal, clientVersion, closeFuture, closing, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, factoryManager, I_C, I_S, inCipher, inCipherSize, inCompression, inMac, inMacResult, ioSession, kex, listeners, lock, log, negociated, nextChannelId, outCipher, outCipherSize, outCompression, outMac, random, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, uncompressBuffer, username |
| Methods inherited from class org.apache.sshd.common.session.AbstractSession |
addListener, attachSession, channelClose, channelData, channelEof, channelExtendedData, channelFailure, channelOpenConfirmation, channelOpenFailure, channelRequest, channelWindowAdjust, createBuffer, createProposal, decode, disconnect, doReadIdentification, exceptionCaught, getAttribute, getChannel, getFactoryManager, getIntProperty, getIoSession, getNextChannelId, getSession, getSession, getUsername, messageReceived, negociate, notImplemented, receiveKexInit, receiveNewKeys, registerChannel, removeListener, sendIdentification, sendKexInit, sendNewKeys, setAttribute, unregisterChannel, writePacket |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClientSessionImpl
public ClientSessionImpl(FactoryManager client,
org.apache.mina.core.session.IoSession session)
throws java.lang.Exception
- Throws:
java.lang.Exception
getClientFactoryManager
public ClientFactoryManager getClientFactoryManager()
getKex
public KeyExchange getKex()
authAgent
public AuthFuture authAgent(java.lang.String username)
throws java.io.IOException
- Specified by:
authAgent in interface ClientSession
- Throws:
java.io.IOException
authPassword
public AuthFuture authPassword(java.lang.String username,
java.lang.String password)
throws java.io.IOException
- Specified by:
authPassword in interface ClientSession
- Throws:
java.io.IOException
authPublicKey
public AuthFuture authPublicKey(java.lang.String username,
java.security.KeyPair key)
throws java.io.IOException
- Specified by:
authPublicKey in interface ClientSession
- Throws:
java.io.IOException
createChannel
public ClientChannel createChannel(java.lang.String type)
throws java.lang.Exception
- Specified by:
createChannel in interface ClientSession
- Throws:
java.lang.Exception
createChannel
public ClientChannel createChannel(java.lang.String type,
java.lang.String subType)
throws java.lang.Exception
- Specified by:
createChannel in interface ClientSession
- Throws:
java.lang.Exception
createShellChannel
public ChannelShell createShellChannel()
throws java.lang.Exception
- Specified by:
createShellChannel in interface ClientSession
- Throws:
java.lang.Exception
createExecChannel
public ChannelExec createExecChannel(java.lang.String command)
throws java.lang.Exception
- Specified by:
createExecChannel in interface ClientSession
- Throws:
java.lang.Exception
createSubsystemChannel
public ChannelSubsystem createSubsystemChannel(java.lang.String subsystem)
throws java.lang.Exception
- Specified by:
createSubsystemChannel in interface ClientSession
- Throws:
java.lang.Exception
close
public CloseFuture close(boolean immediately)
- Description copied from class:
AbstractSession
- Close this session.
This method will close all channels, then close the underlying MINA session.
The call will not block until the mina session is actually closed.
- Specified by:
close in interface ClientSession- Overrides:
close in class AbstractSession
handleMessage
protected void handleMessage(Buffer buffer)
throws java.lang.Exception
- Description copied from class:
AbstractSession
- Abstract method for processing incoming decoded packets.
The given buffer will hold the decoded packet, starting from
the command byte at the read position.
Packets must be processed within this call or be copied because
the given buffer is meant to be changed and updated when this
method returns.
- Specified by:
handleMessage in class AbstractSession
- Parameters:
buffer - the buffer containing the packet
- Throws:
java.lang.Exception - if an exeption occurs while handling this packet.
doHandleMessage
protected void doHandleMessage(Buffer buffer)
throws java.lang.Exception
- Throws:
java.lang.Exception
waitFor
public int waitFor(int mask,
long timeout)
- Specified by:
waitFor in interface ClientSession
setState
public void setState(ClientSessionImpl.State newState)
readIdentification
protected boolean readIdentification(Buffer buffer)
throws java.io.IOException
- Description copied from class:
AbstractSession
- Read the other side identification.
This method is specific to the client or server side, but both should call
AbstractSession.doReadIdentification(org.apache.sshd.common.util.Buffer) and
store the result in the needed property.
- Specified by:
readIdentification in class AbstractSession
- Parameters:
buffer - the buffer containing the remote identification
- Returns:
true if the identification has been fully read or
false if more data is needed
- Throws:
java.io.IOException - if an error occurs such as a bad protocol version
getMetadataMap
public java.util.Map<java.lang.Object,java.lang.Object> getMetadataMap()
- Specified by:
getMetadataMap in interface ClientSession
Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.