boolean connected = connection.isConnected(); boolean systemAuthenticated = connection.isAuthenticated();
/** * {@inheritDoc} */ public boolean isConnected() { return ( ldapConnection != null && ldapConnection.isConnected() ); }
/** * {@inheritDoc} */ @Override public boolean isAuthenticated() { return isConnected() && authenticated.get(); }
/** * {@inheritDoc} */ @Override public boolean isAuthenticated() { return isConnected() && authenticated.get(); }
/** * {@inheritDoc} */ @Override public boolean isAuthenticated() { return isConnected() && authenticated.get(); }
/** * Tells if the connection is using a secured channel * * @return <tt>true</tt> if the session is using a secured channel */ public boolean isSecured() { return isConnected() && ldapSession.isSecured(); }
/** * Tells if the connection is using a secured channel * * @return <tt>true</tt> if the session is using a secured channel */ public boolean isSecured() { return isConnected() && ldapSession.isSecured(); }
/** * Tells if the connection is using a secured channel * * @return <tt>true</tt> if the session is using a secured channel */ public boolean isSecured() { return isConnected() && ldapSession.isSecured(); }
@Override public void close(final RequestControl[] controls) throws LdapException { if (controls != null) { throw new UnsupportedOperationException("Provider does not support unbind with controls"); } if (connection != null) { try { if (connection.isConnected()) { connection.unBind(); } } catch (org.apache.directory.api.ldap.model.exception.LdapException e) { logger.error("Error unbinding from LDAP", e); } try { connection.close(); } catch (IOException e) { throw new LdapException(e); } finally { connection = null; } } }
if ( ( connection != null ) && connection.isConnected() )
boolean connected = connection.isConnected(); boolean systemAuthenticated = connection.isAuthenticated();