Package sfs2x.client.requests
Class FindUsersRequest
- java.lang.Object
-
- sfs2x.client.requests.BaseRequest
-
- sfs2x.client.requests.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 than29
: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 Summary
Fields Modifier and Type Field Description static java.lang.String
KEY_EXPRESSION
* API internal usage only *static java.lang.String
KEY_FILTERED_USERS
* API internal usage only *static java.lang.String
KEY_GROUP
* API internal usage only *static java.lang.String
KEY_LIMIT
* API internal usage only *static java.lang.String
KEY_ROOM
* API internal usage only *-
Fields inherited from class sfs2x.client.requests.BaseRequest
AddBuddy, AdminMessage, AutoJoin, BanUser, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, ClusterInviteUsers, ClusterJoinOrCreate, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GameServerConnectionRequired, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, JoinRoomInvite, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, QuickJoinOrCreateRoom, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserPosition, SetUserVariables, SpectatorToPlayer, SubscribeRoomGroup, UnsubscribeRoomGroup
-
-
Constructor Summary
Constructors Constructor Description FindUsersRequest(MatchExpression matchExpr)
FindUsersRequest(MatchExpression matchExpr, java.lang.Object target)
FindUsersRequest(MatchExpression matchExpr, java.lang.Object target, short limit)
Creates a new FindUsersRequest instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(ISmartFox sfs)
* API internal usage only *void
validate(ISmartFox sfs)
* API internal usage only *-
Methods inherited from class sfs2x.client.requests.BaseRequest
getId, getMessage, getTargetController, isEncrypted, setEncrypted, setId, setTargetController
-
-
-
-
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
-
-
Constructor Detail
-
FindUsersRequest
public FindUsersRequest(MatchExpression matchExpr, java.lang.Object target, short limit)
Creates a new FindUsersRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.- Parameters:
matchExpr
- A matching expression that the system will use to retrieve the users.target
- The name of a Group or a single Room object where to search for matching users; ifnull
, the search is performed in the whole Zone.limit
- The maximum size of the list of users that will be returned by the userFindResult event. If0
, all the found users are returned.- See Also:
SmartFox.send(sfs2x.client.requests.IRequest)
,Room
,SFSEvent.USER_FIND_RESULT
-
FindUsersRequest
public FindUsersRequest(MatchExpression matchExpr)
-
FindUsersRequest
public FindUsersRequest(MatchExpression matchExpr, java.lang.Object target)
-
-