class CachedConnection implements Connection {

    @Override
    public void close() {
        closed = true;

        for (final Channel channel : channels) {
            if (!channel.isClosed()) {
                channel.disconnect();
            }
        }

        channels.clear();

        librarian.checkIn(this);
    }

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

}