[ 
https://issues.apache.org/jira/browse/SSHD-1089?focusedWorklogId=492512&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-492512
 ]

ASF GitHub Bot logged work on SSHD-1089:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Sep/20 15:41
            Start Date: 29/Sep/20 15:41
    Worklog Time Spent: 10m 
      Work Description: lgoldstein closed pull request #171:
URL: https://github.com/apache/mina-sshd/pull/171


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 492512)
    Time Spent: 20m  (was: 10m)

> Provide Closeable wrapper for sub-interfaces that use a one-time session
> ------------------------------------------------------------------------
>
>                 Key: SSHD-1089
>                 URL: https://issues.apache.org/jira/browse/SSHD-1089
>             Project: MINA SSHD
>          Issue Type: Improvement
>    Affects Versions: 2.5.1
>            Reporter: Lyor Goldstein
>            Assignee: Lyor Goldstein
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The current code requires closing the session separately from any 
> "sub-interface" that use it - e.g.:
> {code:java}
> try (ClientSession session = ...obtain a session...;
>       SftpClient sftp = ...obtain client(session)...) {
>    ... use SFTP client ...
> }
> {code}
> In some cases we may want to expose only the "sub-interface" and have it 
> automatically close the underlying session when the "sub-interface" is 
> closed. E.g.;
> {code:java}
> // The session is also closed when SFTP client is closed
> try (SftpClient sftp = createSftpClient(...)) {
>    ... use SFTP client ...
> }
> SftpClient createSftpClient(....) {
>    ClientSession session = ...obtain a session...;
>    SftpClient sftp = ...obtain client(session)...;
>    return wrapAsCloseable(sftp, session);
> }
> {code}



--
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