public class JGitClientSession
extends org.apache.sshd.client.session.ClientSessionImpl
ClientSession
that can
be associated with the HostConfigEntry
the session was created for.
The JGitSshClient
creates such sessions and sets this association.
Also provides for associating a JGit CredentialsProvider
with a
session.
Modifier and Type | Class and Description |
---|---|
static class |
JGitClientSession.ChainingAttributes
An
AttributeRepository that chains together two other attribute
sources in a hierarchy. |
static class |
JGitClientSession.SessionAttributes
A
JGitClientSession.ChainingAttributes repository that doubles as a
PropertyResolver . |
org.apache.sshd.common.util.closeable.AbstractCloseable.State
org.apache.sshd.client.session.ClientSession.ClientSessionEvent
sendImmediateClientIdentification, sendImmediateKexInit
channelListenerProxy, channelListeners, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, firstKexPacketFollows, ignorePacketDataLength, ignorePacketsCount, ignorePacketsFrequency, ignorePacketsVariance, inBlocksCount, inBytesCount, inCipher, inCipherSize, inCompression, inMac, inMacResult, inMacSize, inPacketsCount, kex, kexFutureHolder, kexState, lastKeyTimeValue, maxRekeyBlocks, maxRekeyBytes, maxRekeyInterval, maxRekyPackets, negotiationResult, outBlocksCount, outBytesCount, outCipher, outCipherSize, outCompression, outMac, outMacSize, outPacketsCount, pendingPackets, random, requestLock, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, sessionListenerProxy, sessionListeners, tunnelListenerProxy, tunnelListeners, uncompressBuffer, unmodClientProposal, unmodNegotiationResult, unmodServerProposal
authNanoStart, idleNanoStart, sessionLock
closeFuture, futureLock, state
REMOTE_COMMAND_WAIT_EVENTS
DEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTH
DEFAULT_CONNECTION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_TYPE
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Constructor and Description |
---|
JGitClientSession(org.apache.sshd.client.ClientFactoryManager manager,
org.apache.sshd.common.io.IoSession session) |
Modifier and Type | Method and Description |
---|---|
org.apache.sshd.client.future.AuthFuture |
auth() |
protected void |
checkKeys() |
protected List<String> |
doReadIdentification(org.apache.sshd.common.util.buffer.Buffer buffer,
boolean server)
Reads the RFC 4253, section 4.2 protocol version identification.
|
void |
exceptionCaught(Throwable t) |
<T> T |
getAttribute(org.apache.sshd.common.AttributeRepository.AttributeKey<T> key) |
CredentialsProvider |
getCredentialsProvider()
Retrieves the
CredentialsProvider set for this session. |
org.apache.sshd.client.config.hosts.HostConfigEntry |
getHostConfigEntry()
Retrieves the
HostConfigEntry this session was created for. |
org.apache.sshd.common.PropertyResolver |
getParentPropertyResolver() |
protected void |
handleDisconnect(int code,
String msg,
String lang,
org.apache.sshd.common.util.buffer.Buffer buffer) |
void |
messageReceived(org.apache.sshd.common.util.Readable buffer)
As long as we're still setting up the proxy connection, diverts messages
to the
StatefulProxyConnector . |
protected void |
preClose() |
protected String |
resolveAvailableSignaturesProposal(org.apache.sshd.common.FactoryManager manager) |
protected org.apache.sshd.common.io.IoWriteFuture |
sendIdentification(String ident) |
protected byte[] |
sendKexInit() |
void |
setCredentialsProvider(CredentialsProvider provider)
Sets the
CredentialsProvider for this session. |
void |
setHostConfigEntry(org.apache.sshd.client.config.hosts.HostConfigEntry hostConfig)
Sets the
HostConfigEntry this session was created for. |
void |
setProxyHandler(StatefulProxyConnector handler)
Sets a
StatefulProxyConnector to handle proxy connection
protocols. |
protected void |
signalAuthFailure(org.apache.sshd.client.future.AuthFuture future,
Throwable t) |
protected <C extends Collection<org.apache.sshd.client.session.ClientSession.ClientSessionEvent>> |
updateCurrentSessionState(C newState) |
getMetadataMap, getServices, getSessionState, nextServiceName, sendInitialServiceRequest, signalSessionEvent, switchToNextService, waitFor
addPasswordIdentity, addPublicKeyIdentity, createChannel, createChannel, createDirectTcpipChannel, createExecChannel, createShellChannel, createSubsystemChannel, getClientProxyConnector, getConnectAddress, getConnectionContext, getConnectionService, getFactoryManager, getForwardingFilter, getKeyIdentityProvider, getPasswordIdentityProvider, getRegisteredIdentities, getServerKeyVerifier, getUserAuthFactories, getUserAuthService, getUserInteraction, initializeKeyExchangePhase, initializeProxyConnector, readIdentification, receiveKexInit, receiveKexInit, removePasswordIdentity, removePublicKeyIdentity, sendClientIdentification, sendKexInit, setClientProxyConnector, setConnectAddress, setKexSeed, setKeyIdentityProvider, setPasswordIdentityProvider, setServerKeyVerifier, setUserAuthFactories, setUserInteraction, signalExtraServerVersionInfo, startDynamicPortForwarding, startLocalPortForwarding, startRemotePortForwarding, startService, stopDynamicPortForwarding, stopLocalPortForwarding, stopRemotePortForwarding, switchToNoneCipher
addChannelListener, addPortForwardingEventListener, addSessionListener, appendOutgoingMac, attachSession, checkRekey, comparePreferredKexProposalOption, createBuffer, decode, doHandleMessage, doKexNegotiation, doWritePacket, encode, encryptOutgoingBuffer, getChannelListenerProxy, getCipherInformation, getClientKexData, getClientKexProposals, getClientVersion, getCompressionInformation, getInnerCloseable, getKex, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getPortForwardingEventListenerProxy, getServerKexData, getServerKexProposals, getServerVersion, getService, getSession, getSession, getSessionId, getSessionListenerProxy, handleFirstKexPacketFollows, handleKexExtension, handleKexInit, handleKexMessage, handleMessage, handleNewCompression, handleNewKeys, handleServiceAccept, handleServiceAccept, handleServiceRequest, handleServiceRequest, isRekeyBlocksCountExceeded, isRekeyDataSizeExceeded, isRekeyPacketCountsExceeded, isRekeyRequired, isRekeyTimeIntervalExceeded, negotiate, notImplemented, prepareBuffer, receiveKexInit, receiveNewKeys, reExchangeKeys, refreshConfiguration, removeChannelListener, removePortForwardingEventListener, removeSessionListener, request, requestFailure, requestNewKeysExchange, requestSuccess, resolveAvailableSignaturesProposal, resolveIgnoreBufferDataLength, resolveOutputPacket, resolveSessionKexProposal, sendNewKeys, sendPendingPackets, setClientKexData, setNegotiationResult, setServerKexData, validateIncomingMac, validateKexState, validateTargetBuffer, writePacket
attributeKeys, calculateNextIgnorePacketCount, checkAuthenticationTimeout, checkForTimeouts, checkIdleTimeout, clearAttributes, computeAttributeIfAbsent, createProposal, disconnect, getAttributesCount, getAuthTimeout, getAuthTimeoutStart, getBoundLocalPortForward, getBoundRemotePortForward, getChannelStreamPacketWriterResolver, getIdleTimeout, getIdleTimeoutStart, getIoSession, getLocalForwardsBindings, getProperties, getRemoteForwardsBindings, getReservedSessionMessagesHandler, getSessionDisconnectHandler, getStartedLocalPortForwards, getStartedRemotePortForwards, getTimeoutStatus, getUnknownChannelReferenceHandler, getUsername, handleDebug, handleDisconnect, handleIgnore, handleUnimplemented, invokeSessionSignaller, isAuthenticated, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort, isServerSession, mergeProposals, removeAttribute, resetAuthTimeout, resetIdleTimeout, resizeKey, resolveChannelStreamPacketWriterResolver, resolveIdentificationString, resolvePeerAddress, resolveReservedSessionMessagesHandler, resolveUnknownChannelReferenceHandler, sendDebugMessage, sendIgnoreMessage, sendNotImplemented, setAttribute, setAuthenticated, setChannelStreamPacketWriterResolver, setReservedSessionMessagesHandler, setSessionDisconnectHandler, setUnknownChannelReferenceHandler, setUsername, signalDisconnect, signalDisconnect, signalExceptionCaught, signalExceptionCaught, signalNegotiationEnd, signalNegotiationEnd, signalNegotiationStart, signalNegotiationStart, signalPeerIdentificationReceived, signalPeerIdentificationReceived, signalSessionClosed, signalSessionClosed, signalSessionCreated, signalSessionCreated, signalSessionEstablished, signalSessionEstablished, signalSessionEvent, toString, writePacket
getCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactories
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createDynamicPortForwardingTracker, createExecChannel, createLocalPortForwardingTracker, createRemotePortForwardingTracker, createShellChannel, executeRemoteCommand, executeRemoteCommand, executeRemoteCommand, passwordIteratorOf, providerOf
createBuffer, createBuffer, disconnect, getAuthTimeout, getAuthTimeoutStart, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKex, getLocalAddress, getRemoteAddress, getService, getTimeoutStatus, prepareBuffer, reExchangeKeys, request, resetAuthTimeout, resetIdleTimeout, resolveAttribute, resolveAttribute, sendDebugMessage, sendIgnoreMessage, setAuthenticated, writePacket
getCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isDataIntegrityTransport, isSecureSessionTransport, isServerSession, isValidVersionPrefix
disableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getProperties, getString, getStringProperty
clearAttributes, computeAttributeIfAbsent, removeAttribute, setAttribute
attributeKeys, getAttributesCount, ofAttributesMap, ofKeyValuePair
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNames
getSignatureFactories, getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
getKexExtensionHandler, setKexExtensionHandler
addSessionListener, getSessionListenerProxy, removeSessionListener
getReservedSessionMessagesHandler, setReservedSessionMessagesHandler
getSessionDisconnectHandler, setSessionDisconnectHandler
addChannelListener, getChannelListenerProxy, removeChannelListener
getChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolver
addPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListener
getUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandler
calculatePadLength, writePacket
setUserAuthFactoriesNames
getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNames
getBoundLocalPortForward, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort
public org.apache.sshd.client.future.AuthFuture auth() throws IOException
auth
in interface org.apache.sshd.client.session.ClientSession
auth
in class org.apache.sshd.client.session.ClientSessionImpl
IOException
protected void signalAuthFailure(org.apache.sshd.client.future.AuthFuture future, Throwable t)
signalAuthFailure
in class org.apache.sshd.client.session.ClientSessionImpl
public void exceptionCaught(Throwable t)
exceptionCaught
in interface org.apache.sshd.common.session.Session
exceptionCaught
in class org.apache.sshd.client.session.ClientSessionImpl
protected void preClose()
preClose
in class org.apache.sshd.client.session.ClientSessionImpl
protected void handleDisconnect(int code, String msg, String lang, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
handleDisconnect
in class org.apache.sshd.client.session.ClientSessionImpl
Exception
protected <C extends Collection<org.apache.sshd.client.session.ClientSession.ClientSessionEvent>> C updateCurrentSessionState(C newState)
updateCurrentSessionState
in class org.apache.sshd.client.session.ClientSessionImpl
public org.apache.sshd.client.config.hosts.HostConfigEntry getHostConfigEntry()
HostConfigEntry
this session was created for.HostConfigEntry
, or null
if none setpublic void setHostConfigEntry(org.apache.sshd.client.config.hosts.HostConfigEntry hostConfig)
HostConfigEntry
this session was created for.hostConfig
- the HostConfigEntry
public void setCredentialsProvider(CredentialsProvider provider)
CredentialsProvider
for this session.provider
- to setpublic CredentialsProvider getCredentialsProvider()
CredentialsProvider
set for this session.null
if none is set.public void setProxyHandler(StatefulProxyConnector handler)
StatefulProxyConnector
to handle proxy connection
protocols.handler
- to setprotected org.apache.sshd.common.io.IoWriteFuture sendIdentification(String ident) throws IOException
sendIdentification
in class org.apache.sshd.common.session.helpers.SessionHelper
IOException
protected byte[] sendKexInit() throws IOException, GeneralSecurityException
sendKexInit
in class org.apache.sshd.common.session.helpers.AbstractSession
IOException
GeneralSecurityException
public void messageReceived(org.apache.sshd.common.util.Readable buffer) throws Exception
StatefulProxyConnector
.messageReceived
in class org.apache.sshd.common.session.helpers.AbstractSession
Exception
protected void checkKeys() throws org.apache.sshd.common.SshException
checkKeys
in class org.apache.sshd.client.session.AbstractClientSession
org.apache.sshd.common.SshException
protected String resolveAvailableSignaturesProposal(org.apache.sshd.common.FactoryManager manager)
resolveAvailableSignaturesProposal
in class org.apache.sshd.client.session.AbstractClientSession
protected List<String> doReadIdentification(org.apache.sshd.common.util.buffer.Buffer buffer, boolean server) throws StreamCorruptedException
doReadIdentification
in class org.apache.sshd.common.session.helpers.SessionHelper
buffer
- to read fromserver
- whether we're an SSH server (should always be false
)null
if no identification line was found and more bytes
are neededStreamCorruptedException
- if the identification is malformedpublic <T> T getAttribute(org.apache.sshd.common.AttributeRepository.AttributeKey<T> key)
getAttribute
in interface org.apache.sshd.common.AttributeRepository
getAttribute
in class org.apache.sshd.common.session.helpers.SessionHelper
public org.apache.sshd.common.PropertyResolver getParentPropertyResolver()
getParentPropertyResolver
in interface org.apache.sshd.common.PropertyResolver
getParentPropertyResolver
in class org.apache.sshd.common.session.helpers.SessionHelper
Copyright © 2020 Eclipse JGit Project. All rights reserved.