class CachedConnection implements Connection {

    @Override
    public ChannelShell getShell() {
        if (isClosed()) {
            throw new IllegalStateException("Connection is closed.");
        }

        try {
            final ChannelShell shell = (ChannelShell) session.openChannel("shell");
            channels.add(shell);
            return shell;
        } catch (final JSchException e) {
            throw new RuntimeException("Failed to open shell channel.", e);
        }
    }

    public  CachedConnection(final String username, final String password, final URI serverAddress,
            final ConnectionLibrarian<CachedConnection> librarian);
    public  CachedConnection(final String username, final String salt, final URI privateKeyLocation,
            final URI serverAddress, final ConnectionLibrarian<CachedConnection> librarian);

}