/** * {@inheritDoc} */ public boolean accept( SearchOperationContext operation, Entry result ) throws LdapException { if ( delayMillis != null ) { try { Thread.sleep( delayMillis ); } catch ( InterruptedException ie ) { throw new LdapOperationErrorException( ie.getMessage() ); } } return true; }
throw new LdapOperationErrorException( msg );
/** * {@inheritDoc} */ public void move( MoveOperationContext moveContext ) throws LdapException { PartitionTxn partitionTxn = moveContext.getTransaction(); Dn oldDn = moveContext.getDn(); String id = getEntryId( partitionTxn, oldDn ); super.move( moveContext ); // Get the modified entry Entry modifiedEntry = fetch( moveContext.getTransaction(), id, moveContext.getNewDn() ); try { entryMoved( partitionTxn, oldDn, modifiedEntry, id ); } catch ( Exception e ) { throw new LdapOperationErrorException( e.getMessage(), e ); } }
/** * Creates a new instance of ModifyOperationContext. * * @param session The session to use * @param modifyRequest The ModifyRequest to process * @throws LdapException If the modify failed */ public ModifyOperationContext( CoreSession session, ModifyRequest modifyRequest ) throws LdapException { super( session, modifyRequest.getName() ); if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MODIFY ) ); } else { throw new LdapOperationErrorException( "Cannot proceed the operation with no session" ); } modItems = ServerEntryUtils.toServerModification( modifyRequest.getModifications().toArray( new DefaultModification[0] ), session.getDirectoryService().getSchemaManager() ); requestControls = modifyRequest.getControls(); if ( requestControls.containsKey( ManageDsaIT.OID ) ) { ignoreReferral(); } else { throwReferral(); } }
/** * {@inheritDoc} */ @Override public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException { PartitionTxn partitionTxn = moveAndRenameContext.getTransaction(); Dn oldDn = moveAndRenameContext.getDn(); String id = getEntryId( partitionTxn, oldDn ); super.moveAndRename( moveAndRenameContext ); // Get the modified entry and store it in the context for post usage Entry modifiedEntry = fetch( moveAndRenameContext.getTransaction(), id, moveAndRenameContext.getNewDn() ); moveAndRenameContext.setModifiedEntry( modifiedEntry ); try { entryMoved( partitionTxn, oldDn, modifiedEntry, id ); } catch ( Exception e ) { throw new LdapOperationErrorException( e.getMessage(), e ); } }
throw new LdapOperationErrorException( e.getMessage(), e );
/** * {@inheritDoc} */ public void rename( RenameOperationContext renameContext ) throws LdapException { PartitionTxn partitionTxn = renameContext.getTransaction(); Dn oldDn = renameContext.getDn(); String entryId = getEntryId( partitionTxn, oldDn ); // Create the new entry super.rename( renameContext ); // Get the modified entry and store it in the context for post usage Dn newDn = oldDn.getParent().add( renameContext.getNewRdn() ); Entry modifiedEntry = fetch( renameContext.getTransaction(), entryId, newDn ); renameContext.setModifiedEntry( modifiedEntry ); // Now move the potential children for the old entry // and remove the old entry try { entryMoved( partitionTxn, oldDn, modifiedEntry, entryId ); } catch ( Exception e ) { throw new LdapOperationErrorException( e.getMessage(), e ); } }
throw new LdapOperationErrorException( error );
throw new LdapOperationErrorException( "No session to proceed the operation" );
throw new LdapOperationErrorException( e.getMessage(), e ); throw new LdapOperationErrorException( e.getMessage(), e );
LdapOperationErrorException ldapOperationErrorException = new LdapOperationErrorException( ldapResult.getDiagnosticMessage() ); ldapOperationErrorException.setResolvedDn( ldapResult.getMatchedDn() );
LdapOperationErrorException ldapOperationErrorException = new LdapOperationErrorException( ldapResult.getDiagnosticMessage() ); ldapOperationErrorException.setResolvedDn( ldapResult.getMatchedDn() );
LdapOperationErrorException ldapOperationErrorException = new LdapOperationErrorException( ldapResult.getDiagnosticMessage() ); ldapOperationErrorException.setResolvedDn( ldapResult.getMatchedDn() );