Interface UserNamePolicy

All Known Subinterfaces:
UserNameGenerationPolicy
All Known Implementing Classes:
AbstractUserNameGenerationPolicy

public interface UserNamePolicy
Author:
snsingh This is an interface that must be implemented by the policies used for username generation.

  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the description of the user name policy in the specified locale
    Generates a user name based on the user name generation policy using the user data available in the input Map
    boolean
    isUserNameValid(String userName, Map<String,String> reqData)
    Validates if the user name based on the user data specified in the input Map is valid as per the user name generation policy
  • Method Details

    • getUserNameFromPolicy

      String getUserNameFromPolicy(Map<String,String> reqData) throws UserNameGenerationException
      Generates a user name based on the user name generation policy using the user data available in the input Map
      Parameters:
      reqData - the Map containing the user data
      Returns:
      the generated user name
      Throws:
      UserNameGenerationException - if there is an exception while generating the user name
    • isUserNameValid

      boolean isUserNameValid(String userName, Map<String,String> reqData)
      Validates if the user name based on the user data specified in the input Map is valid as per the user name generation policy
      Parameters:
      userName - the user name to be validated against the policy
      reqData - the Map containing the user data
      Returns:
      True if the user name is valid as per the policy, false otherwise
    • getDescription

      String getDescription(Locale locale)
      Gets the description of the user name policy in the specified locale
      Parameters:
      locale - locale in which the policy description is to be specified
      Returns:
      description of the user name policy in the specified locale