|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sshd.common.session.AbstractSession
org.apache.sshd.client.session.ClientSessionImpl
public class ClientSessionImpl
TODO Add javadoc
| Nested Class Summary | |
|---|---|
static class |
ClientSessionImpl.State
|
| Nested classes/interfaces inherited from interface org.apache.sshd.common.Session |
|---|
Session.AttributeKey<T> |
| Field Summary |
|---|
| 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, requestLock, requestResult, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, uncompressBuffer, username |
| Fields inherited from interface org.apache.sshd.ClientSession |
|---|
AUTHED, CLOSED, TIMEOUT, WAIT_AUTH |
| Constructor Summary | |
|---|---|
ClientSessionImpl(FactoryManager client,
org.apache.mina.core.session.IoSession session)
|
|
| Method Summary | |
|---|---|
AuthFuture |
authAgent(java.lang.String username)
Authenticate the session with the given username using an ssh agent. |
AuthFuture |
authPassword(java.lang.String username,
java.lang.String password)
Authenticate the session with the given username and password. |
AuthFuture |
authPublicKey(java.lang.String username,
java.security.KeyPair key)
Authenticate the session with the gien username and public key. |
CloseFuture |
close(boolean immediately)
Close this session. |
ClientChannel |
createChannel(java.lang.String type)
Create a channel of the given type. |
ClientChannel |
createChannel(java.lang.String type,
java.lang.String subType)
Create a channel of the given type and subtype. |
ChannelDirectTcpip |
createDirectTcpipChannel(SshdSocketAddress local,
SshdSocketAddress remote)
Create a direct tcp-ip channel which can be used to stream data to a remote port from the server. |
ChannelExec |
createExecChannel(java.lang.String command)
Create a channel to execute a command. |
ChannelShell |
createShellChannel()
Create a channel to start a shell. |
ChannelSubsystem |
createSubsystemChannel(java.lang.String subsystem)
Create a subsystem channel. |
protected void |
doHandleMessage(Buffer buffer)
|
ClientFactoryManager |
getClientFactoryManager()
|
KeyExchange |
getKex()
|
java.util.Map<java.lang.Object,java.lang.Object> |
getMetadataMap()
Access to the metadata. |
protected void |
handleMessage(Buffer buffer)
Abstract method for processing incoming decoded packets. |
protected boolean |
readIdentification(Buffer buffer)
Read the other side identification. |
protected void |
sendHeartBeat()
|
void |
setState(ClientSessionImpl.State newState)
|
protected void |
startHeartBeat()
|
void |
startLocalPortForwarding(SshdSocketAddress local,
SshdSocketAddress remote)
Start forwarding the given local address on the client to the given address on the server. |
void |
startRemotePortForwarding(SshdSocketAddress remote,
SshdSocketAddress local)
Start forwarding tcpip from the given address on the server to the given address on the client. |
void |
stopLocalPortForwarding(SshdSocketAddress local)
Stop forwarding the given local address. |
void |
stopRemotePortForwarding(SshdSocketAddress remote)
Stop forwarding of the given remote address. |
int |
waitFor(int mask,
long timeout)
Wait for a specific state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClientSessionImpl(FactoryManager client,
org.apache.mina.core.session.IoSession session)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public ClientFactoryManager getClientFactoryManager()
public KeyExchange getKex()
public AuthFuture authAgent(java.lang.String username)
throws java.io.IOException
ClientSession
authAgent in interface ClientSessionjava.io.IOException
public AuthFuture authPassword(java.lang.String username,
java.lang.String password)
throws java.io.IOException
ClientSession
authPassword in interface ClientSessionjava.io.IOException
public AuthFuture authPublicKey(java.lang.String username,
java.security.KeyPair key)
throws java.io.IOException
ClientSession
authPublicKey in interface ClientSessionjava.io.IOException
public ClientChannel createChannel(java.lang.String type)
throws java.lang.Exception
ClientSessioncreateChannel(type, null).
createChannel in interface ClientSessionjava.lang.Exception
public ClientChannel createChannel(java.lang.String type,
java.lang.String subType)
throws java.lang.Exception
ClientSession
createChannel in interface ClientSessionjava.lang.Exception
public ChannelShell createShellChannel()
throws java.lang.Exception
ClientSession
createShellChannel in interface ClientSessionjava.lang.Exception
public ChannelExec createExecChannel(java.lang.String command)
throws java.lang.Exception
ClientSession
createExecChannel in interface ClientSessionjava.lang.Exception
public ChannelSubsystem createSubsystemChannel(java.lang.String subsystem)
throws java.lang.Exception
ClientSession
createSubsystemChannel in interface ClientSessionjava.lang.Exception
public ChannelDirectTcpip createDirectTcpipChannel(SshdSocketAddress local,
SshdSocketAddress remote)
throws java.lang.Exception
ClientSession
createDirectTcpipChannel in interface ClientSessionjava.lang.Exception
public void startLocalPortForwarding(SshdSocketAddress local,
SshdSocketAddress remote)
throws java.lang.Exception
ClientSession
startLocalPortForwarding in interface ClientSessionjava.lang.Exception
public void stopLocalPortForwarding(SshdSocketAddress local)
throws java.lang.Exception
ClientSession
stopLocalPortForwarding in interface ClientSessionjava.lang.Exception
public void startRemotePortForwarding(SshdSocketAddress remote,
SshdSocketAddress local)
throws java.lang.Exception
ClientSession
startRemotePortForwarding in interface ClientSessionjava.lang.Exception
public void stopRemotePortForwarding(SshdSocketAddress remote)
throws java.lang.Exception
ClientSession
stopRemotePortForwarding in interface ClientSessionjava.lang.Exceptionpublic CloseFuture close(boolean immediately)
AbstractSession
close in interface ClientSessionclose in class AbstractSession
protected void handleMessage(Buffer buffer)
throws java.lang.Exception
AbstractSession
handleMessage in class AbstractSessionbuffer - the buffer containing the packet
java.lang.Exception - if an exeption occurs while handling this packet.
protected void doHandleMessage(Buffer buffer)
throws java.lang.Exception
java.lang.Exception
public int waitFor(int mask,
long timeout)
ClientSession
waitFor in interface ClientSessionpublic void setState(ClientSessionImpl.State newState)
protected void startHeartBeat()
protected void sendHeartBeat()
protected boolean readIdentification(Buffer buffer)
throws java.io.IOException
AbstractSessionAbstractSession.doReadIdentification(org.apache.sshd.common.util.Buffer) and
store the result in the needed property.
readIdentification in class AbstractSessionbuffer - the buffer containing the remote identification
true if the identification has been fully read or
false if more data is needed
java.io.IOException - if an error occurs such as a bad protocol versionpublic java.util.Map<java.lang.Object,java.lang.Object> getMetadataMap()
ClientSession
getMetadataMap in interface ClientSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||