If you extend SshServer, you can do something like:

        List<AbstractSession> sessions = new ArrayList<AbstractSession>();
        for (IoSession ioSession : acceptor.getManagedSessions().values()) {
            AbstractSession session =
AbstractSession.getSession(ioSession, true);
            if (session != null) {
                sessions.add(session);
            }
        }

You can also customize the SessionFactory with your own derived class and use it
   sshd.setSessionFactory(xxx)
which should allow you to customize sessions at creation time, but
does not really solve the original problem.

If you raise a JIRA issue, we can easily add a getActiveSessions()
which would do the first snippet of code.

On Mon, Jun 4, 2012 at 9:38 PM, Wright, Omari <[email protected]> wrote:
> How do I retrieve a list of active sessions using Apache SSHD?



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com

Reply via email to