[ 
https://issues.apache.org/jira/browse/SSHD-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein resolved SSHD-1122.
----------------------------------
    Resolution: Information Provided

The {{SessionContext}} represents the SSH session whereas SCP/SFTP occur over 
+channels+.  In other words, a single session can carry +multiple+ ongoing 
SCP/SFTP "sessions". You could register a {{ChannelListener}} and be advised 
whenever a channel is established / torn down, and then using some 
introspection figure out if it is used for SCP/SFTP - though this is not an 
easy task since the channel itself does not really indicate its purpose but 
rather the way it is used.

Another approach would be to register the {{Scp/SftpEventListener}}-s and use 
session context attributes to track ongoing SCP/SFTP interactions. Again, 
though it requires some non-trivial programming - especially SFTP since it 
depends if you are dealing with the client or the server side of the connection.

So to summarize - no, there is no easy straightforward way to tell if there is 
an ongoing SCP/SFTP session given a {{SessionContext}}.

> SessionContext to deduce the protocol SCP/SFTP
> ----------------------------------------------
>
>                 Key: SSHD-1122
>                 URL: https://issues.apache.org/jira/browse/SSHD-1122
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Susmit Sarkar
>            Priority: Major
>
>  
> {code:java}
> // code placeholder
> @Override
> public FileSystem createFileSystem(SessionContext session) throws IOException 
> {
>  VfsFileSystem fileSystem = session.getAttribute(fileSysKey);
>  if (fileSystem == null) { 
>      VfsFileSystemProvider fileSystemProvider = 
> createFileSystemProvider(session);        fileSystem = new 
> VfsFileSystem(fileSystemProvider); 
>      session.setAttribute(fileSysKey, fileSystem); 
>  }
>  return fileSystem; 
> }
> {code}
> Is it possible to fetch the information like protocol details whether it's 
> SFTP/SCP from *SessionContext*?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to