/** * {@inheritDoc} */ @Override public <T> T execute( ConnectionCallback<T> connectionCallback ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connectionCallback.doWithConnection( connection ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public ModifyResponse modify( ModifyRequest modifyRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.modify( modifyRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public DeleteResponse delete( DeleteRequest deleteRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.delete( deleteRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public AddResponse add( AddRequest addRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.add( addRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public DeleteResponse delete( DeleteRequest deleteRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.delete( deleteRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public <T> T execute( ConnectionCallback<T> connectionCallback ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connectionCallback.doWithConnection( connection ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public DeleteResponse delete( DeleteRequest deleteRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.delete( deleteRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public ModifyResponse modify( ModifyRequest modifyRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.modify( modifyRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public PasswordWarning authenticate( Dn userDn, char[] password ) throws PasswordException { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return authenticateConnection( connection, userDn, password ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public ModifyResponse modify( ModifyRequest modifyRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.modify( modifyRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public AddResponse add( AddRequest addRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.add( addRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public PasswordWarning authenticate( Dn userDn, char[] password ) throws PasswordException { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return authenticateConnection( connection, userDn, password ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public AddResponse add( AddRequest addRequest ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connection.add( addRequest ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public PasswordWarning authenticate( Dn userDn, char[] password ) throws PasswordException { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return authenticateConnection( connection, userDn, password ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public <T> T execute( ConnectionCallback<T> connectionCallback ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); return connectionCallback.doWithConnection( connection ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public <T> List<T> search( SearchRequest searchRequest, EntryMapper<T> entryMapper ) { List<T> entries = new ArrayList<>(); LdapConnection connection = null; try { connection = connectionPool.getConnection(); for ( Entry entry : new EntryCursorImpl( connection.search( searchRequest ) ) ) { entries.add( entryMapper.map( entry ) ); } } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } return entries; }
/** * {@inheritDoc} */ @Override public void modifyPassword( Dn userDn, char[] oldPassword, char[] newPassword, boolean asAdmin ) throws PasswordException { LdapConnection connection = null; try { connection = connectionPool.getConnection(); if ( !asAdmin ) { authenticateConnection( connection, userDn, oldPassword ); } modifyPassword( connection, userDn, newPassword ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public void modifyPassword( Dn userDn, char[] oldPassword, char[] newPassword, boolean asAdmin ) throws PasswordException { LdapConnection connection = null; try { connection = connectionPool.getConnection(); if ( !asAdmin ) { authenticateConnection( connection, userDn, oldPassword ); } modifyPassword( connection, userDn, newPassword ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public <T> T lookup( Dn dn, String[] attributes, EntryMapper<T> entryMapper ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); Entry entry = attributes == null ? connection.lookup( dn ) : connection.lookup( dn, attributes ); return entry == null ? null : entryMapper.map( entry ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }
/** * {@inheritDoc} */ @Override public <T> T lookup( Dn dn, String[] attributes, EntryMapper<T> entryMapper ) { LdapConnection connection = null; try { connection = connectionPool.getConnection(); Entry entry = attributes == null ? connection.lookup( dn ) : connection.lookup( dn, attributes ); return entry == null ? null : entryMapper.map( entry ); } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } }