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.Stateorg.apache.sshd.client.session.ClientSession.ClientSessionEventsendImmediateClientIdentification, sendImmediateKexInitchannelListenerProxy, 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, unmodServerProposalauthNanoStart, idleNanoStart, sessionLockcloseFuture, futureLock, stateREMOTE_COMMAND_WAIT_EVENTSDEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTHDEFAULT_CONNECTION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_TYPECLOSE_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, waitForaddPasswordIdentity, 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, switchToNoneCipheraddChannelListener, 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, writePacketattributeKeys, 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, writePacketgetCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactoriesdoCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateDynamicPortForwardingTracker, createExecChannel, createLocalPortForwardingTracker, createRemotePortForwardingTracker, createShellChannel, executeRemoteCommand, executeRemoteCommand, executeRemoteCommand, passwordIteratorOf, providerOfcreateBuffer, createBuffer, disconnect, getAuthTimeout, getAuthTimeoutStart, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKex, getLocalAddress, getRemoteAddress, getService, getTimeoutStatus, prepareBuffer, reExchangeKeys, request, resetAuthTimeout, resetIdleTimeout, resolveAttribute, resolveAttribute, sendDebugMessage, sendIgnoreMessage, setAuthenticated, writePacketgetCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isDataIntegrityTransport, isSecureSessionTransport, isServerSession, isValidVersionPrefixdisableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeatgetBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getProperties, getString, getStringPropertyclearAttributes, computeAttributeIfAbsent, removeAttribute, setAttributeattributeKeys, getAttributesCount, ofAttributesMap, ofKeyValuePairaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenergetCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNamesgetSignatureFactories, getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNamesgetKexExtensionHandler, setKexExtensionHandleraddSessionListener, getSessionListenerProxy, removeSessionListenergetReservedSessionMessagesHandler, setReservedSessionMessagesHandlergetSessionDisconnectHandler, setSessionDisconnectHandleraddChannelListener, getChannelListenerProxy, removeChannelListenergetChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolveraddPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListenergetUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandlercalculatePadLength, writePacketsetUserAuthFactoriesNamesgetUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNamesgetBoundLocalPortForward, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPortpublic org.apache.sshd.client.future.AuthFuture auth()
throws IOException
auth in interface org.apache.sshd.client.session.ClientSessionauth in class org.apache.sshd.client.session.ClientSessionImplIOExceptionprotected void signalAuthFailure(org.apache.sshd.client.future.AuthFuture future,
Throwable t)
signalAuthFailure in class org.apache.sshd.client.session.ClientSessionImplpublic void exceptionCaught(Throwable t)
exceptionCaught in interface org.apache.sshd.common.session.SessionexceptionCaught in class org.apache.sshd.client.session.ClientSessionImplprotected void preClose()
preClose in class org.apache.sshd.client.session.ClientSessionImplprotected 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.ClientSessionImplExceptionprotected <C extends Collection<org.apache.sshd.client.session.ClientSession.ClientSessionEvent>> C updateCurrentSessionState(C newState)
updateCurrentSessionState in class org.apache.sshd.client.session.ClientSessionImplpublic 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 HostConfigEntrypublic 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.SessionHelperIOExceptionprotected byte[] sendKexInit()
throws IOException,
GeneralSecurityException
sendKexInit in class org.apache.sshd.common.session.helpers.AbstractSessionIOExceptionGeneralSecurityExceptionpublic void messageReceived(org.apache.sshd.common.util.Readable buffer)
throws Exception
StatefulProxyConnector.messageReceived in class org.apache.sshd.common.session.helpers.AbstractSessionExceptionprotected void checkKeys()
throws org.apache.sshd.common.SshException
checkKeys in class org.apache.sshd.client.session.AbstractClientSessionorg.apache.sshd.common.SshExceptionprotected String resolveAvailableSignaturesProposal(org.apache.sshd.common.FactoryManager manager)
resolveAvailableSignaturesProposal in class org.apache.sshd.client.session.AbstractClientSessionprotected List<String> doReadIdentification(org.apache.sshd.common.util.buffer.Buffer buffer, boolean server) throws StreamCorruptedException
doReadIdentification in class org.apache.sshd.common.session.helpers.SessionHelperbuffer - 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.AttributeRepositorygetAttribute in class org.apache.sshd.common.session.helpers.SessionHelperpublic org.apache.sshd.common.PropertyResolver getParentPropertyResolver()
getParentPropertyResolver in interface org.apache.sshd.common.PropertyResolvergetParentPropertyResolver in class org.apache.sshd.common.session.helpers.SessionHelperCopyright © 2020 Eclipse JGit Project. All rights reserved.