Class FindUsersRequest

  • All Implemented Interfaces:
    sfs2x.client.requests.IRequest

    public class FindUsersRequest
    extends BaseRequest
    Retrieves a list of users from the server which match the specified criteria.

    By providing a matching expression and a search scope (a Room, a Group or the entire Zone), SmartFoxServer can find those users matching the passed criteria and return them by means of the userFindResult event.

    Example
    The following example looks for all the users whose "age" User Variable is greater than 29:

     private void someMethod() {
         sfs.addEventListener(SFSEvent.USER_FIND_RESULT, new IEventListener() {
             public void dispatch(BaseEvent evt) throws SFSException {
                 System.out.println("Users found: " + evt.getArguments().get("users"));
             }
         });
         
         // Create a matching expression to find users with an "age" variable greater than 29:
         MatchExpression exp = new MatchExpression("age", NumberMatch.GREATER_THAN, 29);
         
         // Find the users
         sfs.send(new FindUsersRequest(exp));
     }
     
    See Also:
    MatchExpression, SFSEvent.USER_FIND_RESULT
    • Field Detail

      • KEY_EXPRESSION

        public static final java.lang.String KEY_EXPRESSION
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_GROUP

        public static final java.lang.String KEY_GROUP
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_ROOM

        public static final java.lang.String KEY_ROOM
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_LIMIT

        public static final java.lang.String KEY_LIMIT
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_FILTERED_USERS

        public static final java.lang.String KEY_FILTERED_USERS
        * API internal usage only *
        See Also:
        Constant Field Values
    • Method Detail

      • validate

        public void validate​(ISmartFox sfs)
                      throws sfs2x.client.exceptions.SFSValidationException
        * API internal usage only *
        Throws:
        sfs2x.client.exceptions.SFSValidationException
      • execute

        public void execute​(ISmartFox sfs)
        * API internal usage only *