throws PasswordException
{
try
{
ResultResponse response = operation.process();
PasswordPolicy passwordPolicy = getPasswordPolicy( response );
ResultCodeEnum resultCode = response.getLdapResult().getResultCode();
if ( resultCode == ResultCodeEnum.SUCCESS )
{
if ( passwordPolicy != null )
{
return PasswordWarningImpl.newWarning( passwordPolicy );
}
return null;
}
else
{
PasswordException exception = new PasswordException();
exception.setResultCode( resultCode );
if ( passwordPolicy != null
&& passwordPolicy.getResponse() != null
&& passwordPolicy.getResponse().getPasswordPolicyError() != null )
{
exception.setPasswordPolicyError( passwordPolicy.getResponse().getPasswordPolicyError() );
}
throw exception;
}
}
catch ( LdapException e )