Package org.apache.directory.api.ldap.model.exception

Examples of org.apache.directory.api.ldap.model.exception.LdapOperationException


                    }
                }
            }
            catch ( Exception e )
            {
                throw new LdapOperationException( e.getMessage(), e );
            }
            finally
            {
                try
                {
View Full Code Here


                results.close();
            }
            catch ( Exception e )
            {
                LOG.error( "Exception while initializing the groupCache:  {}", e.getCause() );
                LdapOperationException le = new LdapOperationException( e.getMessage(), e );
                throw le;
            }
        }

        if ( IS_DEBUG )
View Full Code Here

            results.close();
        }
        catch ( Exception e )
        {
            throw new LdapOperationException( e.getMessage(), e );
        }
    }
View Full Code Here

            results.close();
        }
        catch ( Exception e )
        {
            throw new LdapOperationException( e.getMessage(), e );
        }
    }
View Full Code Here

                }
            }
        }
        catch ( Exception e )
        {
            throw new LdapOperationException( e.getMessage(), e );
        }
        finally
        {
            try
            {
                cursor.close();
            }
            catch ( Exception e )
            {
                throw new LdapOperationException( e.getMessage(), e );
            }
        }

        return changeLog.getCurrentRevision();
    }
View Full Code Here

                cursor.close();
            }
            catch ( Exception e )
            {
                throw new LdapOperationException( e.getMessage(), e );
            }
        }
    }
View Full Code Here

                results.close();
            }
            catch ( Exception e )
            {
                throw new LdapOperationException( e.getMessage(), e );
            }
        }
    }
View Full Code Here

                        PasswordPolicyErrorEnum.get( e.getErrorCode() ) );
                    addContext.addResponseControl( responseControl );
                }

                // throw exception if userPassword quality checks fail
                throw new LdapOperationException( ResultCodeEnum.CONSTRAINT_VIOLATION, e.getMessage(), e );
            }

            String pwdChangedTime = DateUtils.getGeneralizedTime();

            if ( ( policyConfig.getPwdMinAge() > 0 ) || ( policyConfig.getPwdMaxAge() > 0 ) )
View Full Code Here

                        responseControl.getResponse().setPasswordPolicyError(
                            PasswordPolicyErrorEnum.PASSWORD_TOO_YOUNG );
                        modifyContext.addResponseControl( responseControl );
                    }

                    throw new LdapOperationException( ResultCodeEnum.CONSTRAINT_VIOLATION,
                        "password is too young to update" );
                }

                byte[] newPassword = pwdModDetails.getNewPwd();

                try
                {
                    check( modifyContext, entry, newPassword, policyConfig );
                }
                catch ( PasswordPolicyException e )
                {
                    if ( isPPolicyReqCtrlPresent )
                    {
                        PasswordPolicyDecorator responseControl =
                            new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
                        responseControl.getResponse().setPasswordPolicyError(
                            PasswordPolicyErrorEnum.get( e.getErrorCode() ) );
                        modifyContext.addResponseControl( responseControl );
                    }

                    // throw exception if userPassword quality checks fail
                    throw new LdapOperationException( ResultCodeEnum.CONSTRAINT_VIOLATION, e.getMessage(), e );
                }

                int histSize = policyConfig.getPwdInHistory();
                Modification pwdRemHistMod = null;
                Modification pwdAddHistMod = null;
                String pwdChangedTime = DateUtils.getGeneralizedTime();

                if ( histSize > 0 )
                {
                    Attribute pwdHistoryAt = entry.get( AT_PWD_HISTORY );

                    if ( pwdHistoryAt == null )
                    {
                        pwdHistoryAt = new DefaultAttribute( AT_PWD_HISTORY );
                    }

                    List<PasswordHistory> pwdHistLst = new ArrayList<PasswordHistory>();

                    for ( Value<?> value : pwdHistoryAt )
                    {
                        PasswordHistory pwdh = new PasswordHistory( Strings.utf8ToString( value.getBytes() ) );

                        boolean matched = Arrays.equals( newPassword, pwdh.getPassword() );

                        if ( matched )
                        {
                            if ( isPPolicyReqCtrlPresent )
                            {
                                PasswordPolicyDecorator responseControl =
                                    new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
                                responseControl.getResponse().setPasswordPolicyError(
                                    PasswordPolicyErrorEnum.PASSWORD_IN_HISTORY );
                                modifyContext.addResponseControl( responseControl );
                            }

                            throw new LdapOperationException( ResultCodeEnum.CONSTRAINT_VIOLATION,
                                "invalid reuse of password present in password history" );
                        }

                        pwdHistLst.add( pwdh );
                    }
View Full Code Here

            {
                addSslFilter();
            }
            else
            {
                throw new LdapOperationException( result.getResultCode(), result.getDiagnosticMessage() );
            }
        }
        catch ( LdapException e )
        {
            throw e;
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.exception.LdapOperationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.