Class FindRoomsRequest

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

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

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

    Example
    The following example looks for all the server Rooms whose "country" Room Variable is set to Sweden:

     private void someMethod() {
         sfs.addEventListener(SFSEvent.ROOM_FIND_RESULT, new IEventListener() {
             public void dispatch(BaseEvent evt) throws SFSException {
                 System.out.println("Rooms found: " + evt.getArguments().get("rooms"));
             }
         });
         
         // Create a matching expression to find Rooms with a "country" variable equal to "Sweden"
         MatchExpression exp = new MatchExpression("country", StringMatch.EQUALS, "Sweden");
         
         // Find the Rooms
         sfs.send(new FindRoomsRequest(exp));
     }
     
    See Also:
    MatchExpression, SFSEvent.ROOM_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_LIMIT

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

        public static final java.lang.String KEY_FILTERED_ROOMS
        * 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 *