Class AbstractPasswordPolicyResponder

java.lang.Object
org.apache.directory.ldap.client.template.AbstractPasswordPolicyResponder
All Implemented Interfaces:
PasswordPolicyResponder

public abstract class AbstractPasswordPolicyResponder extends Object implements PasswordPolicyResponder
A base, abstract, implementation of PasswordPolicyResponder. Extend this class and override success(PasswordPolicy), fail(ResultResponse, PasswordPolicy, ResultCodeEnum), or exception(LdapException). If that does not offer enough flexibility, you must implement PasswordPolicyResponder yourself.
Author:
Apache Directory Project
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractPasswordPolicyResponder(org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService)
    Creates a AbstractPasswordPolicyResponder instance
  • Method Summary

    Modifier and Type
    Method
    Description
    exception(org.apache.directory.api.ldap.model.exception.LdapException e)
    Translates an LdapException to a PasswordException to be thrown when process(PasswordPolicyOperation) fails.
    fail(org.apache.directory.api.ldap.model.message.ResultResponse resultResponse, org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse passwordPolicyResponse, org.apache.directory.api.ldap.model.message.ResultCodeEnum resultCode)
    Returns an exception to be thrown in the case of a non SUCCESS resultCode.
    Execute the operation and translate the outcome as follows: SUCCESS: return null WARNING: return PasswordWarning FAILURE: throw PasswordException
    protected PasswordWarning
    success(org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse passwordPolicyResponse)
    Returns a PasswordWarning, or null if no warnings were present in the supplied passwordPolicy.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractPasswordPolicyResponder

      protected AbstractPasswordPolicyResponder(org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService)
      Creates a AbstractPasswordPolicyResponder instance
      Parameters:
      ldapApiService - The LdapApiServoce to use
  • Method Details

    • exception

      protected PasswordException exception(org.apache.directory.api.ldap.model.exception.LdapException e)
      Translates an LdapException to a PasswordException to be thrown when process(PasswordPolicyOperation) fails.
      Parameters:
      e - The exception to set
      Returns:
      The created PasswordException
    • fail

      protected PasswordException fail(org.apache.directory.api.ldap.model.message.ResultResponse resultResponse, org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse passwordPolicyResponse, org.apache.directory.api.ldap.model.message.ResultCodeEnum resultCode)
      Returns an exception to be thrown in the case of a non SUCCESS resultCode.
      Parameters:
      resultResponse - The result response
      passwordPolicyResponse - The password policy in use
      resultCode - The result
      Returns:
      The created PasswordException
    • process

      public final PasswordWarning process(PasswordPolicyOperation operation) throws PasswordException
      Execute the operation and translate the outcome as follows:
      Specified by:
      process in interface PasswordPolicyResponder
      Parameters:
      operation - An operation whose outcome implies password policy information
      Returns:
      A PasswordWarning if warnings are present, or null if completely successful.
      Throws:
      PasswordException - If the operation was a failure.
    • success

      protected PasswordWarning success(org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse passwordPolicyResponse)
      Returns a PasswordWarning, or null if no warnings were present in the supplied passwordPolicy.
      Parameters:
      passwordPolicyResponse - The PasswordPolicyReponse in use
      Returns:
      The created PasswordWarning