code: public String getUniqueId(boolean setAttr) throws Exception {
          String uniqueName = null;
          String uniqueId = null;
          if (entity.getIdentifier().isSet(uniqueIdProp)) {
              uniqueId = (String) entity.getIdentifier().get(uniqueIdProp);
              return uniqueId;
          }
          uniqueName = (String) entity.getIdentifier().get(securityNameProp);
  
          if ((uniqueId == null) && (uniqueName == null)) {
              throw new WIMApplicationException(WIMMessageKey.REQUIRED_IDENTIFIERS_MISSING, Tr.formatMessage(tc, WIMMessageKey.REQUIRED_IDENTIFIERS_MISSING));
          }
  
          // Get the attribute value. If it's part of the DN we must strip it out.
          // ZZZZ uniqueName = stripRDN(uniqueName);
          uniqueId = getUniqueIdForEntity(uniqueName);
  
          if (setAttr) {
              // Set the attribute in the WIM entity.
              entity.getIdentifier().set(uniqueIdProp, uniqueId);
          }
  
          return uniqueId;
      }
docs: Returns the uniqueId of a user or a group.
  
  @param setAttr a boolean indicating whether to actually set the attribute
  in the entity or just perform a lookup.
  @return the user or group's uniqueId.
  @throws Exception identifier values are missing or the underlying
  registry threw an error.