sfs2x.client.requests
Class UnsubscribeRoomGroupRequest

java.lang.Object
  extended by sfs2x.client.requests.BaseRequest
      extended by sfs2x.client.requests.UnsubscribeRoomGroupRequest
All Implemented Interfaces:
sfs2x.client.requests.IRequest

public class UnsubscribeRoomGroupRequest
extends BaseRequest

Unsubscribes the current user to Room-related events occurring in the specified Group. This allows the user to stop being notified of specific Room events occurring in Rooms belonging to the unsubscribed Group.

If the operation is successful, the current user receives a roomGroupUnsubscribe event; otherwise the roomGroupUnsubscribeError event is fired.

Example
The following example makes the current user unsubscribe a Group:

 private void someMethod() {
     sfs.addEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE, new IEventListener() {
         public void dispatch(BaseEvent evt) throws SFSException {
             System.out.println("Group unsubscribed: " + evt.getArguments().get("groupId"));
         }
     });
     sfs.addEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, new IEventListener() {
         public void dispatch(BaseEvent evt) throws SFSException {
             System.out.println("Group unsubscribing failed: " + evt.getArguments().get("errorMessage"));
         }
     });
     
     // Unsubscribe the "cardGames" group
     sfs.send(new UnsubscribeRoomGroupRequest("cardGames"));
 }
 

See Also:
SFSEvent.ROOM_GROUP_UNSUBSCRIBE, SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, SubscribeRoomGroupRequest

Field Summary
static java.lang.String KEY_GROUP_ID
          * API internal usage only *
 
Fields inherited from class sfs2x.client.requests.BaseRequest
AddBuddy, AdminMessage, AutoJoin, BanUser, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, CreateRoom, CreateSFSGame, FindRooms, FindUsers, 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, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserPosition, SetUserVariables, SpectatorToPlayer, SubscribeRoomGroup, UnsubscribeRoomGroup
 
Constructor Summary
UnsubscribeRoomGroupRequest(java.lang.String groupId)
          Creates a new UnsubscribeRoomGroupRequest instance.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_GROUP_ID

public static final java.lang.String KEY_GROUP_ID
* API internal usage only *

See Also:
Constant Field Values
Constructor Detail

UnsubscribeRoomGroupRequest

public UnsubscribeRoomGroupRequest(java.lang.String groupId)
Creates a new UnsubscribeRoomGroupRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

Parameters:
groupId - The name of the Room Group to unsubscribe.
See Also:
SmartFox.send(sfs2x.client.requests.IRequest), Room.getGroupId()
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 *