if (connection != null) { try { connection.close(); } catch (IOException e) { LOG.warn("Unable to close LDAP connection.", e);
@Override public void close() throws IOException { if (connection != null) { connection.close(); } } }
/** * Closes the {@link LdapNetworkConnection}. * * @param conn the connection to close * @throws LdapException the LDAP exception * @throws IOException Signals that an I/O exception has occurred. */ public static void closeConnection( LdapNetworkConnection conn ) throws LdapException, IOException { if ( conn != null ) { conn.unBind(); conn.close(); } }
public void cancelRequested( StudioProgressMonitor.CancelEvent event ) { if ( monitor.isCanceled() ) { if ( jobThread != null && jobThread.isAlive() ) { jobThread.interrupt(); } if ( ldapConnection != null ) { try { ldapConnection.close(); } catch ( Exception e ) { } isConnected = false; ldapConnection = null; } isConnected = false; } } };
ldapConnection.close();
ldapConnection.close();
@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; } } }
connection.close(); CONSUMER_LOG.info( "Connection closed for the server {}", config.getProducer() );
if (connection != null) { try { connection.close(); } catch (IOException e) { LOG.warn("Unable to close LDAP connection.", e);
connection.bind(ldapServerConf.getBindDN(), ldapServerConf.getBindPwd()); } catch (LdapException e) { connection.close(); throw new HasException("Failed to bind. " + e.getMessage()); new Dn(ldapServerConf.getBaseDN())); } catch (LdapInvalidDnException e) { connection.close(); throw new HasException(e.getMessage()); throw new HasException(e.getMessage()); } finally { connection.close();
connection.bind(ldapServerConf.getBindDN(), ldapServerConf.getBindPwd()); } catch (LdapException e) { connection.close(); throw new HasException("Failed to bind. " + e.getMessage()); new Dn(ldapServerConf.getBaseDN())); } catch (LdapInvalidDnException e) { connection.close(); throw new HasException(e.getMessage()); throw new HasException(e.getMessage()); } finally { connection.close();
ldapConnection.close();