code: @FFDCIgnore(InvalidNameException.class)
      @SuppressWarnings("unchecked")
      public static String getValidDN(String dn) {
          Map<String, Map<String, String>> dnCache = null;
          if (dn == null) {
              return null;
          }
  
          if (softDnCache.get() == null) {
              softDnCache = new SoftReference<Map<?, ?>>(new ConcurrentHashMap<String, Map<String, String>>());
          }
  
          dnCache = (Map<String, Map<String, String>>) softDnCache.get();
  
          //Get the current domain name
          // TODO:: Domain name is 'default'
          // String sDomainName = DomainManagerUtils.getDomainName();
          String sDomainName = "default";
  
          //Get the dnCache for the current domain
          if (dnCache != null && dnCache.get(sDomainName) == null) {
              dnCache.put(sDomainName, new ConcurrentHashMap<String, String>(256));
          }
          String result = null;
          if (dnCache != null)
              result = dnCache.get(sDomainName).get(dn);
  
          if (result == null) {
              try {
                  result = new LdapName(dn).toString();
                  dnCache.get(sDomainName).put(dn, result);
              } catch (InvalidNameException e) {
                  result = null;
              }
          }
          return result;
      }
docs: Validates and returns the valid and formatted LDAP Distinguished Name (DN) from the given DN.
  Extra spaces will be removed from the DN during formatting.
  If the specified DN does not satisfy the LDAP DN syntax rule, null will be returned.
  
  @param dn The DN to be formatted.
  
  @return The formatted DN. null will be returned if the specified DN is invalid.