class AmbariLdapDataPopulator {

  protected String getUniqueIdByMemberPattern(String memberAttributeValue, String pattern) {
    if (StringUtils.isNotEmpty(memberAttributeValue) && StringUtils.isNotEmpty(pattern)) {
      try {
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(memberAttributeValue);
        LOG.debug("Apply replace pattern '{}' on '{}' membership attribbute value.", memberAttributeValue, pattern);
        if (m.matches()) {
          memberAttributeValue = m.replaceAll(MEMBER_ATTRIBUTE_REPLACE_STRING);
          LOG.debug("Membership attribute value after replace pattern applied: '{}'", memberAttributeValue);
        } else {
          LOG.warn("Membership attribute value pattern is not matched ({}) on '{}'", pattern, memberAttributeValue);
        }
      } catch (Exception e) {
        LOG.error("Error during replace memberAttribute '{}' with pattern '{}'", memberAttributeValue, pattern);
      }
    }
    return memberAttributeValue;
  }

  @Inject public  AmbariLdapDataPopulator(Provider<AmbariLdapConfiguration> configurationProvider, Users users);

}