AbstractSession class smaller
| Modifier and Type | Field and Description |
|---|---|
| private final Map | attributes
Session specific attributes |
| private volatile boolean | authed
Boolean indicating if this session has been authenticated or not |
| protected Instant | |
| private ChannelStreamWriterResolver | |
| protected Instant | |
| protected Map | initialKexProposal
Stores the initial KEX proposal after it has been run through the hooks allowing client code to modify it; see
|
| private final IoSession | ioSession
The underlying network session |
| private final Map | properties
The session specific properties |
| private ReservedSessionMessagesHandler | |
| private final boolean | serverSession
Client or server side |
| private SessionDisconnectHandler | |
| private final AtomicReference | |
| private UnknownChannelReferenceHandler | |
| private volatile String | username
The name of the authenticated user |
| Access | Constructor and Description |
|---|---|
| protected | SessionHelper(boolean
true if this is a server session, false if client onethe factory manager factoryManager, IoSession the underlying I/O session ioSession)Create a new session. |
| Modifier and Type | Method and Description |
|---|---|
| public Collection | |
| protected long | |
| protected TimeoutIndicator | Returns: ATimeoutIndicator specifying the timeout status and disconnect reason message if
timeout expired, null or NoTimeout if no timeout occurredThe current time in millis now, Duration The configured timeout - if non-positive then no timeout authTimeout)Checks if authentication timeout expired |
| protected TimeoutIndicator | Returns: An indication whether timeout has been detectedChecks whether the session has timed out (both authentication and idle timeouts are checked). |
| protected TimeoutIndicator | Returns: ATimeoutIndicator specifying the timeout status and disconnect reason message if
timeout expired, null or NoTimeout if no timeout occurredThe current time in millis now, Duration The configured timeout - if non-positive then no timeout idleTimeout)Checks if idle timeout expired |
| public void | clearAttributes()
Implements org. Removes all currently stored user-defined attributes |
| public <T> T | computeAttributeIfAbsent(AttributeRepository.
The key of the attribute; must not be key,null.The (never resolver)null) mapping function to use if value not already mapped. If returns
null then value is not mapped to the provided key.Overrides default org. If the specified key is not already associated with a value (or is mapped to |
| protected Map | Returns: The proposalMapThe comma-separated list of supported host key types hostKeyTypes)Create our proposal for SSH negotiation |
| public void | disconnect(int
the reason code for this disconnect reason, String the text message msg)Implements org. Send a disconnect packet with the given reason and message. |
| protected void | doInvokeDebugMessageHandler(Buffer
The input buffer)BufferInvoked by |
| protected void | doInvokeIgnoreMessageHandler(Buffer
The input buffer)BufferInvoked by |
| protected boolean | Returns: Result of invokinghandleUnimplementedMessageThe unimplemented command cmd, Buffer The input buffer)Buffer
|
| protected List | Returns: AList of all received remote identification lines until the version line was read or
null if more data is needed. The identification line is the last one in the listthe buffer containing the identification string buffer, boolean true if it is called by the server session, false if by the client sessionRead the remote identification from this buffer. |
| public void | exceptionCaught(Throwable
the exception to process t)Implements org. Handle any exceptions that occurred on this session. |
| public <T> T | getAttribute(AttributeRepository.
The key of the attribute; must not be keynull.Implements org. Returns the value of the user-defined attribute. |
| public int | |
| public Duration | |
| public Instant | |
| public List | getBoundLocalPortForwards(int
The port number port)Implements org.
|
| public SshdSocketAddress | getBoundRemotePortForward(int
The port number port)Implements org.
|
| public ChannelStreamWriterResolver | |
| protected abstract ConnectionService | |
| public FactoryManager | |
| protected Forwarder | |
| public Duration | |
| public Instant | |
| public IoSession | |
| protected Map | Returns: the proposalMapRetrieves this side's initial proposal for KEX negotiation. |
| public List | |
| public PropertyResolver | |
| public Map | getProperties()
Implements org. A map of properties that can be used to configure the SSH server or client. |
| public List | |
| public ReservedSessionMessagesHandler | |
| public SessionDisconnectHandler | |
| public List | |
| public NavigableSet | |
| public TimeoutIndicator | getTimeoutStatus()
Implements org. Check if timeout has occurred. |
| public UnknownChannelReferenceHandler | |
| public String | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public boolean | |
| public boolean | isLocalPortForwardingStartedForPort(int
The local port port)Overrides default org. Test if local port forwarding is started |
| public boolean | isRemotePortForwardingStartedForPort(int
The remote port port)Overrides default org. Test if remote port forwarding is started |
| public boolean | isServerSession()
Implements org. Quick indication if this is a server or client session (instead of having to ask |
| protected Map | |
| protected Buffer | Returns: The adjustedBufferNote users may use this method to totally alter the contents of the buffer being sent but it is highly discouraged as it may have unexpected results. The command stored in the buffer cmd, Buffer The original buffer)Buffer - assumed to be properly formatted and be of at least the
required minimum length.Invoked by the session before encoding the buffer in order to make sure that it is at least of size
|
| public <T> T | removeAttribute(AttributeRepository.
The key of the attribute; must not be keynull.Implements org. Removes the user-defined attribute |
| public Instant | resetAuthTimeout()
Implements org. Re-start the authentication timeout timer |
| public Instant | resetIdleTimeout()
Implements org. Re-start idle timeout timer |
| protected byte[] | Returns: the resized keythe key to resize e, int the cipher key-derivation-factor (in bytes) kdfSize, Digest the hash algorithm hash, byte[] the key exchange k parameter k, byte[] the key exchange h parameter h)Method used while putting new keys into use that will resize the key used to initialize the cipher to the needed length. |
| protected String | Returns: A comma-separated list of all the signature protocols to be included in the proposal -null/empty if no proposalComputes the list of available host key signature algorithms supported. |
| protected abstract String | Returns: A comma-separated list of all the signature protocols to be included in the proposal -null/empty if no proposalThe manager)FactoryManagerComputes the list of available host key signature algorithms supported. |
| public ChannelStreamWriterResolver | |
| protected String | Returns: The resolved identification valueThe property used to query the factory manager configPropName)Resolves the identification to send to the peer session by consulting the associated |
| protected SocketAddress | Returns: The external address if notnull otherwise, the IoSession peer addressAny externally set peer address - e.g., due to some proxy mechanism meta-data knownAddress)
|
| protected ReservedSessionMessagesHandler | |
| protected String | |
| public UnknownChannelReferenceHandler | resolveUnknownChannelReferenceHandler()
Implements org. Check if current manager has a specific handler set for it - if not, try and resolve one from the "parent" container (if any) |
| public IoWriteFuture | sendDebugMessage(boolean
true if OK to display the message at the peer as-isThe message object whose msg, String toString() value to be used - if null then the
"null" string is sentThe language - lang)null/empty if some pre-agreed default is usedImplements org. Sends an |
| protected IoWriteFuture | Returns: IoWriteFuture that can be used to wait for notification that identification has been
sendour identification to send version, List<String> Extra lines to send - used only by server sessions extraLines)Send our identification. |
| public IoWriteFuture | sendIgnoreMessage(byte...
The message data data)Implements org. Sends an |
| protected IoWriteFuture | Returns: AnIoWriteFuture that can be used to wait for packet write completionThe referenced sequence number seqNoValue)Sends a |
| public <T> T | setAttribute(AttributeRepository.
The key of the attribute; must not be key,null.The value of the attribute; must not be value)null.Implements org. Sets a user-defined attribute. |
| public void | |
| public void | |
| public void | setReservedSessionMessagesHandler(ReservedSessionMessagesHandler
The handler)ReservedSessionMessagesHandler to use - may be nullImplements org.
|
| public void | setSessionDisconnectHandler(SessionDisconnectHandler sessionDisconnectHandler)
Implements org.
|
| public void | setUnknownChannelReferenceHandler(UnknownChannelReferenceHandler
The unknownChannelReferenceHandler)UnknownChannelReferenceHandlerManager to use - if null then any reference to
unknown channel causes an SshChannelNotFoundExceptionImplements org.
|
| public void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | signalNegotiationEnd(Map<KexProposalOption, String> c2sOptions, Map<KexProposalOption, String> s2cOptions, Map<KexProposalOption, String> negotiatedGuess, Throwable reason)
|
| protected void | signalNegotiationEnd(SessionListener listener, Map<KexProposalOption, String> c2sOptions, Map<KexProposalOption, String> s2cOptions, Map<KexProposalOption, String> negotiatedGuess, Throwable reason)
|
| protected void | |
| protected void | |
| protected void | signalNegotiationStart(Map<KexProposalOption, String> c2sOptions, Map<KexProposalOption, String> s2cOptions)
|
| protected void | signalNegotiationStart(SessionListener listener, Map<KexProposalOption, String> c2sOptions, Map<KexProposalOption, String> s2cOptions)
|
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | signalSessionEvent(SessionListener.
The event to send eventSends a session event to all currently registered session listeners |
| protected void | |
| public String |