docs: public List<String> getReposForExternalName(String externalName, String realmName) throws WIMException {
          externalName = UniqueNameHelper.getValidUniqueName(externalName);
          if (externalName == null || externalName.trim().equals(""))
              return Collections.emptyList();
  
          int uLength = externalName.length();
  
          // Get the list of configured baseEntries for the realm
          String[] realmBaseEntries = null;
  
          if (getConfigManager() != null && getConfigManager().getRealmConfig(realmName) != null)
              realmBaseEntries = getConfigManager().getRealmConfig(realmName).getParticipatingBaseEntries();
  
          // Iterate over the repositories.
          // RepositoryManager reposMgr = reposMgrRef.getService();
          List<String> reposIds = repositoryManager.getRepoIds();
  
          if (reposIds == null || realmBaseEntries == null)
              return Collections.emptyList();
  
          List<String> potentialRepos = new ArrayList<String>(); // keep a list of all the potential repository ids where user can exist
          List<String> realmBases = Arrays.asList(realmBaseEntries);
          String repo = null;
          int bestMatch = -1;
          for (String repoId : reposIds) {
              // read the list of base entries for a given repository which are defined in realm
              Map<String, String> baseEntryies = repositoryManager.getRepositoryBaseEntries(repoId);
  
              for (Map.Entry<String, String> entry : baseEntryies.entrySet()) {
                  // check if the repository base entry is present in  realm
                  if (realmBases.contains(entry.getKey())) {
                      String baseDN = entry.getValue();
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "baseDN = " + baseDN);
                      if (baseDN != null) {
                          String reposNodeName = baseDN;
  
                          if (reposNodeName.trim().equals("")) {
                              potentialRepos.add(repoId);
                          }
                          reposNodeName = UniqueNameHelper.getValidUniqueName(reposNodeName);
                          //handling the case of empty string "" returned from repository.
                          if (reposNodeName != null && reposNodeName.length() > 0) {
                              int nodeLength = reposNodeName.length();
                              if ((uLength == nodeLength) && externalName.equalsIgnoreCase(reposNodeName)) {
                                  repo = repoId;
                                  break;
                              }
                              if ((uLength > nodeLength)
                                  && (com.ibm.ws.security.wim.util.StringUtil.endsWithIgnoreCase(externalName, "," + reposNodeName))) {
                                  if (nodeLength > bestMatch) {
                                      repo = repoId;
                                      bestMatch = nodeLength;
                                  }
                              }
                          }
                      }
                  }
              }
              if (repo != null) {
                  potentialRepos.add(0, repo);
              }
  
          }
          return potentialRepos;
      }