You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/09/26 10:15:00 UTC

[jira] [Work logged] (SSHD-1089) Provide Closeable wrapper for sub-interfaces that use a one-time session

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

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

                Author: ASF GitHub Bot
            Created on: 26/Sep/20 10:14
            Start Date: 26/Sep/20 10:14
    Worklog Time Spent: 10m 
      Work Description: lgoldstein opened a new 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:
users@infra.apache.org


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

            Worklog Id:     (was: 491562)
    Remaining Estimate: 0h
            Time Spent: 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: 10m
>  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: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org