/* (non-Javadoc)
@see com.tvd12.ezyfox.core.command.FetchUserList#in(com.tvd12.ezyfox.core.entities.ApiRoom)
174237
@Override
    public <T extends ApiUser> List<T> in(ApiRoom room) {
        Room sfsRoom = CommandUtil.getSfsRoom(room, extension);
        validateRoom(sfsRoom, room);
        return CommandUtil.getApiUserList(sfsRoom.getUserList());
    }
459187
public ChatRoomMemberList getChatRoomMembers(long roomId, int start, int count)
            throws APIConnectionException, APIRequestException {
        Preconditions.checkArgument(roomId > 0, "room id is invalid");
        Preconditions.checkArgument(start >= 0 && count > 0, "Illegal argument");
        ResponseWrapper responseWrapper = _httpClient.sendGet(_baseUrl + mChatRoomPath + "/" + roomId + "/members"
                + "?start=" + start + "&count=" + count);
        return ChatRoomMemberList.fromResponse(responseWrapper, ChatRoomMemberList.class);
    }
169899
public UserListResult getUserList(int start, int count)
            throws APIConnectionException, APIRequestException {

        if (start < 0 || count <= 0 || count > 500) {
            throw new IllegalArgumentException("negative index or count must more than 0 and less than 501");
        }
        ResponseWrapper response = _httpClient.sendGet(_baseUrl + userPath + "?start=" + start + "&count=" + count);
        return UserListResult.fromResponse(response, UserListResult.class);

    }
369943
@SuppressWarnings("unchecked")
    @Override
    public <T> T by(int id) {
        Room sfsRoom = extension.getParentZone().getRoomById(id);
        if(sfsRoom == null) return null;
        return (T) sfsRoom.getProperty(APIKey.ROOM);
    }
504067
@Override
    @JsonIgnore
    public Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(final Map<String, List<Object>> query,
                                                                     final IPersonAttributeDaoFilter filter) {
        if (this.logger.isDebugEnabled()) {
            this.logger.debug("invoking getPeopleWithMultivaluedAttributes(" + query + ")");
        }

        final IUsernameAttributeProvider usernameAttributeProvider = super.getUsernameAttributeProvider();
        String uid = usernameAttributeProvider.getUsernameFromQuery(query);
        if (uid == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No username attribute found in query, returning null");
            }

            return null;
        }
        uid = usernameCaseCanonicalizationMode.canonicalize(uid, usernameCaseCanonicalizationLocale);

        String targetName = this.descriptors.getName();
        if (targetName == null) {
            if (this.currentUserProvider != null) {
                targetName = this.currentUserProvider.getCurrentUserName();
            }

            if (targetName == null) {
                this.logger.warn("AdditionalDescriptors has a null name and a null name was returned by the currentUserProvider, returning null. " + this.descriptors);
                return null;
            }
        }

        targetName = usernameCaseCanonicalizationMode.canonicalize(targetName, usernameCaseCanonicalizationLocale);
        if (uid.equals(targetName)) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Adding additional descriptors " + this.descriptors);
            }

            final IPersonAttributes personAttributes = new CaseInsensitiveNamedPersonImpl(targetName, this.descriptors.getAttributes());
            return Collections.singleton(personAttributes);
        }

        return null;
    }
549867
@SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public List<ApiBuddy> execute() {
        BuddyList buddyList = extension.getParentZone()
                .getBuddyListManager()
                .getBuddyList(user);
        return (List) buddyList.getBuddies();
    }
1146259
@Override
    public List<IPersonAttributes> searchForPeople(
            final IPerson searcher, final Map<String, Object> query) {

        // get the IAuthorizationPrincipal for the searching user
        final IAuthorizationPrincipal principal = getPrincipalForUser(searcher);

        // build a set of all possible user attributes the current user has
        // permission to view
        final Set<String> permittedAttributes = getPermittedAttributes(principal);

        // remove any query attributes that the user does not have permission
        // to view
        final Map<String, Object> inUseQuery = new HashMap<>();
        for (Map.Entry<String, Object> queryEntry : query.entrySet()) {
            final String attr = queryEntry.getKey();
            if (permittedAttributes.contains(attr)) {
                inUseQuery.put(attr, queryEntry.getValue());
            } else {
                this.logger.warn(
                        "User '"
                                + searcher.getName()
                                + "' attempted searching on attribute '"
                                + attr
                                + "' which is not allowed in the current configuration. The attribute will be ignored.");
            }
        }

        // ensure the query has at least one search attribute defined
        if (inUseQuery.keySet().size() == 0) {
            throw new IllegalArgumentException("Search query is empty");
        }

        // get the set of people matching the search query
        final Set<IPersonAttributes> people = this.personAttributeDao.getPeople(inUseQuery);
        if (people == null) {
            return Collections.emptyList();
        }

        // To improve efficiency and not do as many permission checks or person directory searches,
        // if we have too many results and all people in the returned set of personAttributes have
        // a displayName, pre-sort the set and limit it to maxResults. The typical use case is that
        // LDAP returns results that have the displayName populated.  Note that a disadvantage of
        // this
        // approach is that the smaller result set may have entries that permissions prevent the
        // current users from viewing the person and thus reduce the number of final results, but
        // that is rare (typical use case is users can't view administrative internal accounts or
        // the
        // system account, none of which tend to be in LDAP).  We could retain a few more than
        // maxResults
        // to offset that chance, but IMHO not worth the cost of extra external queries.

        List<IPersonAttributes> peopleList = new ArrayList<>(people);
        if (peopleList.size() > maxResults && allListItemsHaveDisplayName(peopleList)) {
            logger.debug(
                    "All items contained displayName; pre-sorting list of size {} and truncating to {}",
                    peopleList.size(),
                    maxResults);
            // sort the list by display name
            Collections.sort(peopleList, new DisplayNameComparator());
            peopleList = peopleList.subList(0, maxResults);
        }
        // Construct a new representation of the persons limited to attributes the searcher
        // has permissions to view.  Will change order of the list.
        List<IPersonAttributes> list =
                getVisiblePersons(principal, permittedAttributes, peopleList);

        // Sort the list by display name
        Collections.sort(list, new DisplayNameComparator());

        // limit the list to a maximum number of returned results
        if (list.size() > maxResults) {
            list = list.subList(0, maxResults);
        }

        return list;
    }
73605
def rooms
      response = self.class.get(@api.user_joined_rooms_config[:url],
                                :query => { :auth_token => @token }.merge(@api.user_joined_rooms_config[:query_params]),
                                :headers => @api.headers
      )
      ErrorHandler.response_code_to_exception_for :user, user_id, response
      User.new(@token, response.merge(:api_version => @api.version))
    end
989154
public UserListResult getAdminListByAppkey(int start, int count)
    		throws APIConnectionException, APIRequestException {
    	return _userClient.getAdminListByAppkey(start, count);
    }
682425
@SuppressWarnings("unchecked")
    @Override
	public <T> T by(int userId) {
	    User sfsUser = api.getUserById(userId);
	    if(sfsUser != null)
	        return (T)sfsUser.getProperty(APIKey.USER);
	    return null;
	}
500515
public UserListResult getUserList(int start, int count)
            throws APIConnectionException, APIRequestException {
        return _userClient.getUserList(start, count);
    }
541319
@Override
    public <T extends ApiUser> List<T> getPlayersList() {
        return CommandUtil.getApiUserList(room.getPlayersList());
    }
965786
@Override
    public final Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(final Map<String, List<Object>> query,
                                                                           final IPersonAttributeDaoFilter filter) {
        Validate.notNull(query, "query may not be null.");

        //Generate the query to pass to the subclass
        final QB queryBuilder = this.generateQuery(query);
        if (queryBuilder == null && (this.queryAttributeMapping != null || this.useAllQueryAttributes == true)) {
            this.logger.debug("No queryBuilder was generated for query " + query + ", null will be returned");

            return null;
        }

        //Get the username from the query, if specified
        final IUsernameAttributeProvider usernameAttributeProvider = this.getUsernameAttributeProvider();
        final String username = usernameAttributeProvider.getUsernameFromQuery(query);

        //Execute the query in the subclass
        final List<IPersonAttributes> unmappedPeople = this.getPeopleForQuery(queryBuilder, username);
        if (unmappedPeople == null) {
            return null;
        }

        //Map the attributes of the found people according to resultAttributeMapping if it is set
        final Set<IPersonAttributes> mappedPeople = new LinkedHashSet<>();
        for (final IPersonAttributes unmappedPerson : unmappedPeople) {
            final IPersonAttributes mappedPerson = this.mapPersonAttributes(unmappedPerson);
            mappedPeople.add(mappedPerson);
        }

        return Collections.unmodifiableSet(mappedPeople);
    }
101644
def users(&callback)
      connection.http(:get, "/room/#{id}.json") do |data, http| # data can be blank on locked rooms
        callback.call(data ? data[:room][:users].map { |user| Firering::User.instantiate(connection, user) } : Array.new) if callback
      end
    end
739870
@Override
    protected List<IPersonAttributes> getPeopleForQuery(final PartialWhereClause queryBuilder, final String queryUserName) {
        //Execute the query
        final RowMapper<R> rowMapper = this.getRowMapper();

        final List<R> results;
        if (queryBuilder != null) {
            //Merge the generated SQL with the base query template
            final StringBuilder partialSqlWhere = queryBuilder.sql;
            final Matcher queryMatcher = WHERE_PLACEHOLDER.matcher(this.queryTemplate);
            final String querySQL = queryMatcher.replaceAll(partialSqlWhere.toString());

            results = this.simpleJdbcTemplate.query(querySQL, rowMapper, queryBuilder.arguments.toArray());

            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Executed '" + this.queryTemplate + "' with arguments " + queryBuilder.arguments + " and got results " + results);
            }
        } else {
            results = this.simpleJdbcTemplate.query(this.queryTemplate, rowMapper);

            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Executed '" + this.queryTemplate + "' and got results " + results);
            }
        }

        return this.parseAttributeMapFromResults(results, queryUserName);
    }
858226
@Override
	public String[] getUsersInRole(String role) {
		if (role_list.containsKey(role)) {
			return role_list.get(role).toArray(new String[0]);
		} else {
			return new String[0];
		}
	}
420632
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> List<T> getUsersInGroup(String groupId) {
	    Collection<User> sfsUsers = getZone().getUsersInGroup(groupId);
	    List<T> anwser = new ArrayList<>();
	    for(User sfsUser : sfsUsers)
	        if(sfsUser.containsProperty(APIKey.USER))
	            anwser.add((T) sfsUser.getProperty(APIKey.USER));
	    return anwser;
	}