/** * Write the new entry on disk. It does not exist, as this has been checked * by the ExceptionInterceptor. */ private void addEntry( Entry entry ) throws LdapException { // Remove the EntryDN entry.removeAttributes( entryDnAT ); try { FileWriter fw = new FileWriter( getFile( entry.getDn(), CREATE ) ); fw.write( LdifUtils.convertToLdif( entry ) ); fw.close(); } catch ( IOException ioe ) { throw new LdapOperationException( ioe.getMessage(), ioe ); } }
/** * Determines if the supplied ldap exception should result in an operation exception. * * @param e that was produced * * @throws LdapException wrapping the ldap exception */ protected void processLdapOperationException(final LdapOperationException e) throws LdapException { ProviderUtils.throwOperationException( config.getOperationExceptionResultCodes(), e, e.getResultCode() != null ? e.getResultCode().getResultCode() : null, e.getResolvedDn() != null ? e.getResolvedDn().getName() : null, null, null, true); }
LdapOperationException exception = new LdapOperationException( ldapResult.getResultCode(), ldapResult.getDiagnosticMessage() ); exception.setResolvedDn( ldapResult.getMatchedDn() );
return ( ( LdapOperationException ) t ).getResultCode();
LOG.warn( e.getMessage(), e ); LdapResult res = bindResp.getLdapResult(); res.setDiagnosticMessage( e.getMessage() ); res.setResultCode( e.getResultCode() );
LdapOperationException exception = new LdapOperationException( ldapResult.getResultCode(), ldapResult.getDiagnosticMessage() ); exception.setResolvedDn( ldapResult.getMatchedDn() );
return ( ( LdapOperationException ) t ).getResultCode();
errorCode = loe.getResultCode(); errorMessage = loe.getMessage();
throw new LdapOperationException( e.getMessage(), e ); throw new LdapOperationException( ioe.getMessage(), ioe );
LdapOperationException exception = new LdapOperationException( ldapResult.getResultCode(), ldapResult.getDiagnosticMessage() ); exception.setResolvedDn( ldapResult.getMatchedDn() );
code = ( ( LdapOperationException ) cause ).getResultCode(); || code == ResultCodeEnum.INVALID_DN_SYNTAX || code == ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM; if ( ( ne.getResolvedDn() != null ) && setMatchedDn ) result.setMatchedDn( ne.getResolvedDn() );
return ( ( LdapOperationException ) t ).getResultCode();
/** * {@inheritDoc} */ @Override public void modify( ModifyOperationContext modifyContext ) throws LdapException { PartitionTxn partitionTxn = modifyContext.getTransaction(); synchronized ( lock ) { try { Entry modifiedEntry = super.modify( partitionTxn, modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[] {} ) ); // Remove the EntryDN modifiedEntry.removeAttributes( entryDnAT ); modifyContext.setAlteredEntry( modifiedEntry ); } catch ( Exception e ) { throw new LdapOperationException( e.getMessage(), e ); } dirty = true; rewritePartitionData( partitionTxn ); } }
code = ( ( LdapOperationException ) e ).getResultCode(); result.setResultCode( code ); dn = ( ( LdapOperationException ) e ).getResolvedDn();
throw new ConnectionException(e, ResultCode.valueOf(e.getResultCode().getValue())); } catch (org.apache.directory.api.ldap.model.exception.LdapException e) { closeConn = true;
throw new LdapOperationException( ResultCodeEnum.CONSTRAINT_VIOLATION, "invalid reuse of password present in password history" );
code = ( ( LdapOperationException ) e ).getResultCode(); || code == ResultCodeEnum.INVALID_DN_SYNTAX || code == ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM; if ( ( ne.getResolvedDn() != null ) && setMatchedDn ) result.setMatchedDn( ne.getResolvedDn() );
code = ( ( LdapOperationException ) e ).getResultCode(); result.setResultCode( code );
throw new LdapOperationException( e.getMessage(), e );
throw new LdapOperationException( e.getMessage(), e );