Esempio n. 1
0
  /*
   * Get email local part attr from attrs and form the email with the default domain
   */
  @Override
  public String dnToEmail(String dn, IAttributes attrs) throws ServiceException {
    String localPart = attrs.getAttrString(DEFAULT_NAMING_RDN_ATTR_USER);

    if (localPart != null) return localPart + "@" + defaultDomain();
    else throw ServiceException.FAILURE("unable to map dn [" + dn + "] to email", null);
  }
Esempio n. 2
0
  private String acctAndDLDNCreate(String baseDn, IAttributes attrs) throws ServiceException {
    String rdnAttr = NAMING_RDN_ATTR_USER;
    String rdnValue = attrs.getAttrString(rdnAttr);

    if (rdnValue == null) throw ServiceException.FAILURE("missing rdn attribute" + rdnAttr, null);

    validateMailBranchEntryDN(baseDn);

    return rdnAttr + "=" + LdapUtil.escapeRDNValue(rdnValue) + "," + baseDn;
  }