Java Code Examples for org.apache.directory.ldap.client.api.LdapConnection#delete()

The following examples show how to use org.apache.directory.ldap.client.api.LdapConnection#delete() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LdapConnectionTemplate.java    From directory-ldap-api with Apache License 2.0 6 votes vote down vote up
/**
 * {@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 );
    }
}
 
Example 2
Source File: LdapDataProvider.java    From directory-fortress-core with Apache License 2.0 5 votes vote down vote up
/**
 * Delete exiting ldap entry from the directory.  Add audit context.  This method will call modify prior to
 * delete which will
 * force corresponding audit record to be written to slapd access log.
 *
 * @param connection handle to ldap connection.
 * @param dn         contains distinguished node of entry targeted for removal..
 * @param entity     contains audit context.
 * @throws LdapException in the event system error occurs.
 */
protected void delete( LdapConnection connection, String dn, FortEntity entity ) throws LdapException
{
    COUNTERS.incrementDelete();
    List<Modification> mods = new ArrayList<Modification>();
    audit( mods, entity );

    if ( mods.size() > 0 )
    {
        modify( connection, dn, mods );
    }

    connection.delete( dn );
}
 
Example 3
Source File: LdapDataProvider.java    From directory-fortress-core with Apache License 2.0 5 votes vote down vote up
/**
 * Delete exiting ldap entry from the directory.  Add audit context.  This method will call modify prior to
 * delete which will
 * force corresponding audit record to be written to slapd access log.
 *
 * @param connection handle to ldap connection.
 * @param dn         contains distinguished node of entry targeted for removal..
 * @param entity     contains audit context.
 * @throws LdapException in the event system error occurs.
 */
protected void delete( LdapConnection connection, Dn dn, FortEntity entity ) throws LdapException
{
    COUNTERS.incrementDelete();
    List<Modification> mods = new ArrayList<Modification>();
    audit( mods, entity );

    if ( mods.size() > 0 )
    {
        modify( connection, dn, mods );
    }

    connection.delete( dn );
}
 
Example 4
Source File: LdapDataProvider.java    From directory-fortress-core with Apache License 2.0 2 votes vote down vote up
/**
 * Delete exiting ldap entry from the directory.  Do not add audit context.
 *
 * @param connection handle to ldap connection.
 * @param dn         contains distinguished node of entry targeted for removal..
 * @throws LdapException in the event system error occurs.
 */
protected void delete( LdapConnection connection, String dn ) throws LdapException
{
    COUNTERS.incrementDelete();
    connection.delete( dn );
}