public class ClientSessionImpl extends AbstractSession implements ClientSession
Modifier and Type | Class and Description |
---|---|
static class |
ClientSessionImpl.State |
Session.AttributeKey<T>
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
AUTHED, CLOSED, TIMEOUT, WAIT_AUTH
Constructor and Description |
---|
ClientSessionImpl(FactoryManager client,
org.apache.mina.core.session.IoSession session) |
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)
Close this session.
|
ClientChannel |
createChannel(String type) |
ClientChannel |
createChannel(String type,
String subType) |
ChannelExec |
createExecChannel(String command) |
ChannelShell |
createShellChannel() |
ChannelSubsystem |
createSubsystemChannel(String subsystem) |
protected void |
doHandleMessage(Buffer buffer) |
ClientFactoryManager |
getClientFactoryManager() |
KeyExchange |
getKex() |
Map<Object,Object> |
getMetadataMap() |
protected void |
handleMessage(Buffer buffer)
Abstract method for processing incoming decoded packets.
|
protected boolean |
readIdentification(Buffer buffer)
Read the other side identification.
|
void |
setState(ClientSessionImpl.State newState) |
int |
waitFor(int mask,
long timeout) |
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
public ClientSessionImpl(FactoryManager client, org.apache.mina.core.session.IoSession session) throws Exception
Exception
public ClientFactoryManager getClientFactoryManager()
public KeyExchange getKex()
public AuthFuture authAgent(String username) throws IOException
authAgent
in interface ClientSession
IOException
public AuthFuture authPassword(String username, String password) throws IOException
authPassword
in interface ClientSession
IOException
public AuthFuture authPublicKey(String username, KeyPair key) throws IOException
authPublicKey
in interface ClientSession
IOException
public ClientChannel createChannel(String type) throws Exception
createChannel
in interface ClientSession
Exception
public ClientChannel createChannel(String type, String subType) throws Exception
createChannel
in interface ClientSession
Exception
public ChannelShell createShellChannel() throws Exception
createShellChannel
in interface ClientSession
Exception
public ChannelExec createExecChannel(String command) throws Exception
createExecChannel
in interface ClientSession
Exception
public ChannelSubsystem createSubsystemChannel(String subsystem) throws Exception
createSubsystemChannel
in interface ClientSession
Exception
public CloseFuture close(boolean immediately)
AbstractSession
close
in interface ClientSession
close
in class AbstractSession
protected void handleMessage(Buffer buffer) throws Exception
AbstractSession
handleMessage
in class AbstractSession
buffer
- the buffer containing the packetException
- if an exeption occurs while handling this packet.public int waitFor(int mask, long timeout)
waitFor
in interface ClientSession
public void setState(ClientSessionImpl.State newState)
protected boolean readIdentification(Buffer buffer) throws IOException
AbstractSession
AbstractSession.doReadIdentification(org.apache.sshd.common.util.Buffer)
and
store the result in the needed property.readIdentification
in class AbstractSession
buffer
- the buffer containing the remote identificationtrue
if the identification has been fully read or
false
if more data is neededIOException
- if an error occurs such as a bad protocol versionpublic Map<Object,Object> getMetadataMap()
getMetadataMap
in interface ClientSession
Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.