/** * {@inheritDoc} */ @Override public Dn getName() { return getDecorated().getName(); }
/** * {@inheritDoc} */ @Override public DeleteRequest setName( Dn name ) { getDecorated().setName( name ); return this; }
/** * deletes the entry with the given Dn, and all its children * * @param dn the target entry's Dn * @throws LdapException If the Dn is not valid or if the deletion failed */ public void deleteTree( Dn dn ) throws LdapException { String treeDeleteOid = "1.2.840.113556.1.4.805"; if ( isControlSupported( treeDeleteOid ) ) { DeleteRequest deleteRequest = new DeleteRequestImpl(); deleteRequest.setName( dn ); deleteRequest.addControl( new OpaqueControl( treeDeleteOid ) ); DeleteResponse deleteResponse = delete( deleteRequest ); processResponse( deleteResponse ); } else { String msg = I18n.err( I18n.ERR_04148_SUBTREE_CONTROL_NOT_SUPPORTED ); LOG.error( msg ); throw new LdapException( msg ); } }
if ( deleteRequest.getName() == null ) deleteRequest.setMessageId( newId );
public void run() { try { // Preparing the delete request DeleteRequest request = new DeleteRequestImpl(); request.setName( new Dn( dn ) ); request.addAllControls( convertControls( controls ) ); // Performing the delete operation DeleteResponse deleteResponse = ldapConnection.delete( request ); // Checking the response checkResponse( deleteResponse ); } catch ( Exception e ) { exception = e; } NamingException ne = null; if ( exception != null ) { ne = new NamingException( exception.getMessage() ); } for ( IJndiLogger logger : getJndiLoggers() ) { logger.logChangetypeDelete( connection, dn, controls, ne ); } } };
/** * Creates a new instance of DeleteOperationContext. * * @param session The session to use * @param deleteRequest The Delete operation to process */ public DeleteOperationContext( CoreSession session, DeleteRequest deleteRequest ) { super( session, deleteRequest.getName() ); if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE ) ); } requestControls = deleteRequest.getControls(); if ( requestControls.containsKey( ManageDsaIT.OID ) ) { ignoreReferral(); } else { throwReferral(); } }
internaldelRequest.setMessageId( container.getMessageId() ); DeleteRequestDecorator delRequest = new DeleteRequestDecorator( container.getLdapCodecService(), internaldelRequest );
abandon( deleteRequest.getMessageId() );
/** * {@inheritDoc} */ public void handle( LdapSession session, DeleteRequest req ) { LOG.debug( "Handling request: {}", req ); LdapResult result = req.getResultResponse().getLdapResult(); try { // Call the underlying layer to delete the entry CoreSession coreSession = session.getCoreSession(); coreSession.delete( req ); // If success, here now, otherwise, we would have an exception. result.setResultCode( ResultCodeEnum.SUCCESS ); // Write the DeleteResponse message session.getIoSession().write( req.getResultResponse() ); } catch ( Exception e ) { handleException( session, req, e ); } } }
/** * deletes the entry with the given Dn, and all its children * * @param dn the target entry's Dn * @throws LdapException If the Dn is not valid or if the deletion failed */ public void deleteTree( Dn dn ) throws LdapException { String treeDeleteOid = "1.2.840.113556.1.4.805"; if ( isControlSupported( treeDeleteOid ) ) { DeleteRequest deleteRequest = new DeleteRequestImpl(); deleteRequest.setName( dn ); deleteRequest.addControl( new OpaqueControl( treeDeleteOid ) ); DeleteResponse deleteResponse = delete( deleteRequest ); processResponse( deleteResponse ); } else { String msg = I18n.err( I18n.ERR_04148_SUBTREE_CONTROL_NOT_SUPPORTED ); LOG.error( msg ); throw new LdapException( msg ); } }
if ( deleteRequest.getName() == null ) deleteRequest.setMessageId( newId );
internaldelRequest.setMessageId( container.getMessageId() ); DeleteRequestDecorator delRequest = new DeleteRequestDecorator( container.getLdapCodecService(), internaldelRequest );
abandon( deleteRequest.getMessageId() );
/** * {@inheritDoc} */ @Override public void delete( DeleteRequest deleteRequest, LogChange log ) throws LdapException { DeleteOperationContext deleteContext = new DeleteOperationContext( this, deleteRequest ); deleteContext.setLogChange( log ); OperationManager operationManager = directoryService.getOperationManager(); try { operationManager.delete( deleteContext ); } catch ( LdapException e ) { deleteRequest.getResultResponse().addAllControls( deleteContext.getResponseControls() ); throw e; } deleteRequest.getResultResponse().addAllControls( deleteContext.getResponseControls() ); }
/** * deletes the entry with the given Dn, and all its children * * @param dn the target entry's Dn * @throws LdapException If the Dn is not valid or if the deletion failed */ public void deleteTree( Dn dn ) throws LdapException { String treeDeleteOid = "1.2.840.113556.1.4.805"; if ( isControlSupported( treeDeleteOid ) ) { DeleteRequest deleteRequest = new DeleteRequestImpl(); deleteRequest.setName( dn ); deleteRequest.addControl( new OpaqueControl( treeDeleteOid ) ); DeleteResponse deleteResponse = delete( deleteRequest ); processResponse( deleteResponse ); } else { String msg = I18n.err( I18n.ERR_04148_SUBTREE_CONTROL_NOT_SUPPORTED ); LOG.error( msg ); throw new LdapException( msg ); } }
/** * {@inheritDoc} */ @Override public DeleteRequest setName( Dn name ) { getDecorated().setName( name ); return this; }
/** * Get the entry to be deleted * * @return Returns the entry. */ public Dn getEntry() { return getDecorated().getName(); }
if ( deleteRequest.getName() == null ) deleteRequest.setMessageId( newId );
internaldelRequest.setMessageId( container.getMessageId() ); DeleteRequestDecorator delRequest = new DeleteRequestDecorator( container.getLdapCodecService(), internaldelRequest );
abandon( deleteRequest.getMessageId() );