Get user names as String from set of sessions.<p>

@param ids to gain usernames from
@param andLocalized String
@return user names as string
546575
protected static String getUserNames(Set<String> ids, String andLocalized) {

        List<String> userNames = new ArrayList<String>();

        for (String id : ids) {
            CmsSessionInfo session = OpenCms.getSessionManager().getSessionInfo(new CmsUUID(id));
            try {
                String name = A_CmsUI.getCmsObject().readUser(session.getUserId()).getName();
                if (!userNames.contains(name)) {
                    userNames.add(name);
                }
            } catch (CmsException e) {
                LOG.error("Unable to read user information", e);
            }
        }

        Iterator<String> iterator = userNames.iterator();

        String res = "";

        while (iterator.hasNext()) {
            res += iterator.next();
            if (iterator.hasNext()) {
                res += ", ";
            }
        }
        int lastPosSeperation = res.lastIndexOf(", ");

        return lastPosSeperation == -1
        ? res
        : res.substring(0, lastPosSeperation)
            + " "
            + andLocalized
            + " "
            + res.substring(lastPosSeperation + 2, res.length());
    }
353478
void getSingletonNames(Set<String> singletons) {
        for (Map.Entry<String, ConfigurationList<SimpleElement>> entry : configurationMap.entrySet()) {
            ConfigurationList<SimpleElement> list = entry.getValue();
            if (!list.isEmpty() && !list.hasId()) {
                singletons.add(entry.getKey());
            }
        }
    }
840817
public HashIntMap<User> loadUsersFromId (int[] userIds)
        throws PersistenceException
    {
        HashIntMap<User> data = new HashIntMap<User>();
        if (userIds.length > 0) {
            String query = "where userId in (" + genIdString(userIds) + ")";
            for (User user : loadAll(_utable, query)) {
                user.setDirtyMask(_utable.getFieldMask());
                data.put(user.userId, user);
            }
        }
        return data;
    }
1029318
public User getUser(String id) {
        return db.query("SELECT * FROM Users WHERE id = ?",
                new ResultSetExtractor<User>() {
                    public User extractData(ResultSet rs)
                            throws SQLException {
                        if (rs.next()) {
                            return getUser(rs);
                        } else {
                            return null;
                        }
                    }
                },
                Integer.parseInt(id));
    }
823270
public String getUserID(String globusID) {
        String [] ids = getUserIDs(globusID);
        if (ids != null && ids.length > 0) {
            return ids[0];
        } else {
            return null;
        }
    }
765196
public void setUsernames(java.util.Collection<String> usernames) {
        if (usernames == null) {
            this.usernames = null;
            return;
        }

        this.usernames = new java.util.ArrayList<String>(usernames);
    }
1038168
public String[] lookupString(int[] ids) {
		String[] vals = new String[ids.length];
		for(int i = 0; i < ids.length; i++)	{
			vals[i] = index.get(ids[i]);
		}
		return vals;
	}
1303709
public List<UserDto> selectByIds(DbSession session, Collection<Integer> ids) {
    return executeLargeInputs(ids, mapper(session)::selectByIds);
  }
846116
public Collection<String> getNames() {
		Collection<String> names = new HashSet<String>();
		for (InitParam initParam : initParams) {
			names.add(initParam.getName());
		}
		return names;
	}
1094709
public String getSessionUserName(HttpServletRequest request, HttpServletResponse response)
    {
        HttpSession session = null;

        SessionAffinityContext sac = getSessionAffinityContext(request);

        if (!sac.isFirstSessionIdValid() && !sac.isAllSessionIdsSetViaSet()) { //PM89885
            @SuppressWarnings("rawtypes")
            List allSessionIds = _sam.getAllCookieValues(request);
            sac.setAllSessionIds(allSessionIds);
            _sam.setNextId(sac); // we got rid of the first one in setAllSessionIds, get the next one so that we have an id to work with
        }

        String id = _sam.getInUseSessionID(request, sac);

        if (id != null) {
            session = (HttpSession) _coreHttpSessionManager.getSession(request, response, sac, false); // don't create here
        }
        if( session != null ){
            SessionData sd = (SessionData) session;
            return sd.getUserName();            
        } else{
            return null;
        }
    }
1220476
public void sessionUserNameSet(ISession session, String oldUserName, String newUserName) {
        // ArrayList sessionStateObservers = null;

        /*
         * Check to see if there is a non-empty list of sessionStateObservers.
         */
        if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
            return;
        }

        // synchronized(_sessionStateObservers) {
        // sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
        // }

        ISessionStateObserver sessionStateObserver = null;
        for (int i = 0; i < _sessionStateObservers.size(); i++) {
            sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i);
            sessionStateObserver.sessionUserNameSet(session, oldUserName, newUserName);
        }
    }
1148886
public static UserInfoList userInfoBatchget(String access_token,String lang,List<String> openids){
		return userInfoBatchget(access_token, lang, openids,0);
	}
395864
protected String getToNames() {

        List<String> users = new ArrayList<String>();
        Iterator<String> itIds = idsList().iterator();
        while (itIds.hasNext()) {
            String id = itIds.next();
            CmsSessionInfo session = OpenCms.getSessionManager().getSessionInfo(id);
            if (session != null) {
                try {
                    String userName = getCms().readUser(session.getUserId()).getFullName();
                    if (!users.contains(userName)) {
                        users.add(userName);
                    }
                } catch (Exception e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
        StringBuffer result = new StringBuffer(256);
        Iterator<String> itUsers = users.iterator();
        while (itUsers.hasNext()) {
            result.append(itUsers.next());
            if (itUsers.hasNext()) {
                result.append("; ");
            }
        }
        return result.toString();
    }
899641
@Override
    public String getUserPrincipals() {
        if (userPrincipals == null) {
            return null;
        }

        JSONObject jsonObj = new JSONObject(userPrincipals);

        return jsonObj.toString();
    }
1259270
public static String translateIdToUsername(final String id) throws FrameworkException {

		if (Principal.SUPERUSER_ID.equals(id)) {
			return Settings.SuperUserName.getValue();
		}

		final Principal principal = StructrApp.getInstance().get(Principal.class, id);
		if (principal != null) {

			return principal.getName();
		}

		return Principal.ANONYMOUS;
	}
450780
public String getAppNameAndID() {
        StringBuffer sb = new StringBuffer(" AppName=");
        sb.append(_appName);
        sb.append("; Id=").append(_sessionId);
        return sb.toString();
    }
106537
@Override
	public SortedSet<String> getDomainNames(String name) {
		if ( name.length() < 4)
			throw new IllegalArgumentException("Can't interpret IDs that are shorter than 4 residues!");

		String url = String.format("%srepresentativeDomains?cluster=%s&structureId=%s",
				base, cutoff, name);
		return requestRepresentativeDomains(url);
	}