Package com.bitheads.braincloud.services
Class GroupService
java.lang.Object
com.bitheads.braincloud.services.GroupService
public class GroupService extends Object
Created by bradleyh on 5/6/2016.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGroupService.AutoJoinStrategystatic classGroupService.Role -
Constructor Summary
Constructors Constructor Description GroupService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidacceptGroupInvitation(String groupId, IServerCallback callback)Accept an outstanding invitation to join the group.voidaddGroupMember(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Add a member to the group.voidapproveGroupJoinRequest(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Approve an outstanding request to join the group.voidautoJoinGroup(String groupType, GroupService.AutoJoinStrategy autoJoinStrategy, String dataQueryJson, IServerCallback callback)Automatically join an open group that matches the search criteria and has space available.voidautoJoinGroupMulti(String[] groupTypes, GroupService.AutoJoinStrategy autoJoinStrategy, String where, IServerCallback callback)Find and join an open group in the pool of groups in multiple group types provided as input arguments.voidcancelGroupInvitation(String groupId, String profileId, IServerCallback callback)Cancel an outstanding invitation to the group.voidcreateGroup(String name, String groupType, boolean isOpenGroup, GroupACL acl, String jsonData, String jsonOwnerAttributes, String jsonDefaultMemberAttributes, IServerCallback callback)Create a group.voidcreateGroupEntity(String groupId, String entityType, boolean isOwnedByGroupMember, GroupACL acl, String jsonData, IServerCallback callback)Create a group entity.voidcreateGroupWithSummaryData(String name, String groupType, boolean isOpenGroup, GroupACL acl, String jsonData, String jsonOwnerAttributes, String jsonDefaultMemberAttributes, String summaryData, IServerCallback callback)Create a group with summaryData.voiddeleteGroup(String groupId, long version, IServerCallback callback)Delete a group.voiddeleteGroupEntity(String groupId, String entityId, long version, IServerCallback callback)Delete a group entity.voidgetMyGroups(IServerCallback callback)Read information on groups to which the current player belongs.voidgetRandomGroupsMatching(String jsonWhere, int maxReturn, IServerCallback callback)Gets a list of up to maxReturn randomly selected groups from the server based on the where condition Service Name - group Service Operation - GET_RANDOM_GROUPS_MATCHINGvoidincrementGroupData(String groupId, String jsonData, IServerCallback callback)Increment elements for the group's data field.voidincrementGroupEntityData(String groupId, String entityId, String jsonData, IServerCallback callback)Increment elements for the group entity's data field.voidinviteGroupMember(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Invite a member to the group.voidjoinGroup(String groupId, IServerCallback callback)Join an open group or request to join a closed group.voidleaveGroup(String groupId, IServerCallback callback)Leave a group in which the player is a member.voidlistGroupsPage(String jsonContext, IServerCallback callback)Read a page of group information.voidlistGroupsPageByOffset(String encodedContext, int pageOffset, IServerCallback callback)Read a page of group information.voidlistGroupsWithMember(String profileId, IServerCallback callback)Read information on groups to which the specified player belongs.voidreadGroup(String groupId, IServerCallback callback)Read the specified group.voidreadGroupData(String groupId, IServerCallback callback)Read the data of the specified group.voidreadGroupEntitiesPage(String jsonContext, IServerCallback callback)Read a page of group entity information.voidreadGroupEntitiesPageByOffset(String encodedContext, int pageOffset, IServerCallback callback)Read a page of group entity information.voidreadGroupEntity(String groupId, String entityId, IServerCallback callback)Read the specified group entity.voidreadGroupMembers(String groupId, IServerCallback callback)Read the members of the group.voidrejectGroupInvitation(String groupId, IServerCallback callback)Reject an outstanding invitation to join the group.voidrejectGroupJoinRequest(String groupId, String profileId, IServerCallback callback)Reject an outstanding request to join the group.voidremoveGroupMember(String groupId, String profileId, IServerCallback callback)Remove a member from the group.voidsetGroupOpen(String groupId, boolean isOpenGroup, IServerCallback callback)Set whether a group is open (true) or closed (false).voidupdateGroupData(String groupId, long version, String jsonData, IServerCallback callback)Updates a group's data.voidupdateGroupEntityData(String groupId, String entityId, long version, String jsonData, IServerCallback callback)Update a group entity.voidupdateGroupMember(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Update a member of the group.voidupdateGroupName(String groupId, String name, IServerCallback callback)Updates a group's name.voidupdateGroupSummaryData(String groupId, int version, String jsonSummaryData, IServerCallback callback)Updates a group's summaryData Service Name - group Service Operation - UPDATE_GROUP_SUMMARY_DATA
-
Constructor Details
-
GroupService
-
-
Method Details
-
acceptGroupInvitation
Accept an outstanding invitation to join the group. Service Name - group Service Operation - ACCEPT_GROUP_INVITATION- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
addGroupMember
public void addGroupMember(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Add a member to the group. Service Name - group Service Operation - ADD_GROUP_MEMBER- Parameters:
groupId- ID of the group.profileId- Profile ID of the member being added.role- Role of the member being added.jsonAttributes- Attributes of the member being added.callback- The method to be invoked when the server response is received
-
approveGroupJoinRequest
public void approveGroupJoinRequest(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Approve an outstanding request to join the group. Service Name - group Service Operation - APPROVE_GROUP_JOIN_REQUEST- Parameters:
groupId- ID of the group.profileId- Profile ID of the invitation being deleted.role- Role of the member being invited.jsonAttributes- Attributes of the member being invited.callback- The method to be invoked when the server response is received
-
autoJoinGroup
public void autoJoinGroup(String groupType, GroupService.AutoJoinStrategy autoJoinStrategy, String dataQueryJson, IServerCallback callback)Automatically join an open group that matches the search criteria and has space available. Service Name - group Service Operation - AUTO_JOIN_GROUP- Parameters:
groupType- Name of the associated group type.autoJoinStrategy- Selection strategy to employ when there are multiple matchesdataQueryJson- Query parameters (optional)callback- The method to be invoked when the server response is received
-
autoJoinGroupMulti
public void autoJoinGroupMulti(String[] groupTypes, GroupService.AutoJoinStrategy autoJoinStrategy, String where, IServerCallback callback)Find and join an open group in the pool of groups in multiple group types provided as input arguments. * Service Name - group Service Operation - AUTO_JOIN_GROUP_MULTI- Parameters:
groupTypes- Name of the associated group type.autoJoinStrategy- Selection strategy to employ when there are multiple matcheswhere- Query parameters (optional)callback- The method to be invoked when the server response is received
-
cancelGroupInvitation
Cancel an outstanding invitation to the group. Service Name - group Service Operation - CANCEL_GROUP_INVITATION- Parameters:
groupId- ID of the group.profileId- Profile ID of the invitation being deleted.callback- The method to be invoked when the server response is received
-
createGroup
public void createGroup(String name, String groupType, boolean isOpenGroup, GroupACL acl, String jsonData, String jsonOwnerAttributes, String jsonDefaultMemberAttributes, IServerCallback callback)Create a group. Service Name - group Service Operation - CREATE_GROUP- Parameters:
name- Name of the group.groupType- Name of the type of group.isOpenGroup- true if group is open; false if closed.acl- The group's access control list. A null ACL implies default.jsonOwnerAttributes- Attributes for the group owner (current player).jsonDefaultMemberAttributes- Default attributes for group members.jsonData- Custom application data.callback- The method to be invoked when the server response is received
-
createGroupWithSummaryData
public void createGroupWithSummaryData(String name, String groupType, boolean isOpenGroup, GroupACL acl, String jsonData, String jsonOwnerAttributes, String jsonDefaultMemberAttributes, String summaryData, IServerCallback callback)Create a group with summaryData. Service Name - group Service Operation - CREATE_GROUP- Parameters:
name- Name of the group.groupType- Name of the type of group.isOpenGroup- true if group is open; false if closed.acl- The group's access control list. A null ACL implies default.jsonOwnerAttributes- Attributes for the group owner (current player).jsonDefaultMemberAttributes- Default attributes for group members.jsonData- Custom application data.summaryData- summarycallback- The method to be invoked when the server response is received
-
createGroupEntity
public void createGroupEntity(String groupId, String entityType, boolean isOwnedByGroupMember, GroupACL acl, String jsonData, IServerCallback callback)Create a group entity. Service Name - group Service Operation - CREATE_GROUP_ENTITY- Parameters:
groupId- ID of the group.isOwnedByGroupMember- true if entity is owned by a member; false if owned by the entire group.entityType- Type of the group entity.acl- Access control list for the group entity.jsonData- Custom application data.callback- The method to be invoked when the server response is received
-
deleteGroup
Delete a group. Service Name - group Service Operation - DELETE_GROUP- Parameters:
groupId- ID of the group.version- Current version of the groupcallback- The method to be invoked when the server response is received
-
deleteGroupEntity
public void deleteGroupEntity(String groupId, String entityId, long version, IServerCallback callback)Delete a group entity. Service Name - group Service Operation - DELETE_GROUP_ENTITY- Parameters:
groupId- ID of the group.entityId- ID of the entity.version- The current version of the group entity (for concurrency checking).callback- The method to be invoked when the server response is received
-
getMyGroups
Read information on groups to which the current player belongs. Service Name - group Service Operation - GET_MY_GROUPS- Parameters:
callback- The method to be invoked when the server response is received
-
incrementGroupData
Increment elements for the group's data field. Service Name - group Service Operation - INCREMENT_GROUP_DATA- Parameters:
groupId- ID of the group.jsonData- Partial data map with incremental values.callback- The method to be invoked when the server response is received
-
incrementGroupEntityData
public void incrementGroupEntityData(String groupId, String entityId, String jsonData, IServerCallback callback)Increment elements for the group entity's data field. Service Name - group Service Operation - INCREMENT_GROUP_ENTITY_DATA- Parameters:
groupId- ID of the group.entityId- ID of the entity.jsonData- Partial data map with incremental values.callback- The method to be invoked when the server response is received
-
inviteGroupMember
public void inviteGroupMember(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Invite a member to the group. Service Name - group Service Operation - INVITE_GROUP_MEMBER- Parameters:
groupId- ID of the group.profileId- Profile ID of the member being invited.role- Role of the member being invited.jsonAttributes- Attributes of the member being invited.callback- The method to be invoked when the server response is received
-
joinGroup
Join an open group or request to join a closed group. Service Name - group Service Operation - JOIN_GROUP- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
leaveGroup
Leave a group in which the player is a member. Service Name - group Service Operation - LEAVE_GROUP- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
listGroupsPage
Read a page of group information. Service Name - group Service Operation - LIST_GROUPS_PAGE- Parameters:
jsonContext- Query context.callback- The method to be invoked when the server response is received
-
listGroupsPageByOffset
public void listGroupsPageByOffset(String encodedContext, int pageOffset, IServerCallback callback)Read a page of group information. Service Name - group Service Operation - LIST_GROUPS_PAGE_BY_OFFSET- Parameters:
encodedContext- Encoded reference query context.pageOffset- Number of pages by which to offset the query.callback- The method to be invoked when the server response is received
-
listGroupsWithMember
Read information on groups to which the specified player belongs. Access is subject to restrictions. Service Name - group Service Operation - LIST_GROUPS_WITH_MEMBER- Parameters:
profileId- ID of the user to search forcallback- The method to be invoked when the server response is received
-
readGroup
Read the specified group. Service Name - group Service Operation - READ_GROUP- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
readGroupEntitiesPage
Read a page of group entity information. Service Name - group Service Operation - READ_GROUP_ENTITIES_PAGE- Parameters:
jsonContext- Query context.callback- The method to be invoked when the server response is received
-
readGroupEntitiesPageByOffset
public void readGroupEntitiesPageByOffset(String encodedContext, int pageOffset, IServerCallback callback)Read a page of group entity information. Service Name - group Service Operation - READ_GROUP_ENTITIES_PAGE_BY_OFFSET- Parameters:
encodedContext- Encoded reference query context.pageOffset- Number of pages by which to offset the query.callback- The method to be invoked when the server response is received
-
readGroupData
Read the data of the specified group. Service Name - group Service Operation - READ_GROUP_DATA- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
readGroupEntity
Read the specified group entity. Service Name - group Service Operation - READ_GROUP_ENTITY- Parameters:
groupId- ID of the group.entityId- ID of the entity.callback- The method to be invoked when the server response is received
-
readGroupMembers
Read the members of the group. Service Name - group Service Operation - READ_MEMBERS_OF_GROUP- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
rejectGroupInvitation
Reject an outstanding invitation to join the group. Service Name - group Service Operation - REJECT_GROUP_INVITATION- Parameters:
groupId- ID of the group.callback- The method to be invoked when the server response is received
-
rejectGroupJoinRequest
Reject an outstanding request to join the group. Service Name - group Service Operation - REJECT_GROUP_JOIN_REQUEST- Parameters:
groupId- ID of the group.profileId- Profile ID of the invitation being deleted.callback- The method to be invoked when the server response is received
-
removeGroupMember
Remove a member from the group. Service Name - group Service Operation - REMOVE_GROUP_MEMBER- Parameters:
groupId- ID of the group.profileId- Profile ID of the member being deleted.callback- The method to be invoked when the server response is received
-
setGroupOpen
Set whether a group is open (true) or closed (false). Service Name - group Service Operation - SET_GROUP_OPEN- Parameters:
groupId- ID of the group.isOpenGroup- true if group is open; false if closedcallback- The method to be invoked when the server response is received
-
updateGroupData
public void updateGroupData(String groupId, long version, String jsonData, IServerCallback callback)Updates a group's data. Service Name - group Service Operation - UPDATE_GROUP_DATA- Parameters:
groupId- ID of the group.version- Version to verify.jsonData- Data to apply.callback- The method to be invoked when the server response is received
-
updateGroupEntityData
public void updateGroupEntityData(String groupId, String entityId, long version, String jsonData, IServerCallback callback)Update a group entity. Service Name - group Service Operation - UPDATE_GROUP_ENTITY_DATA- Parameters:
groupId- ID of the group.entityId- ID of the entity.version- The current version of the group entity (for concurrency checking).jsonData- Custom application data.callback- The method to be invoked when the server response is received
-
updateGroupMember
public void updateGroupMember(String groupId, String profileId, GroupService.Role role, String jsonAttributes, IServerCallback callback)Update a member of the group. Service Name - group Service Operation - UPDATE_GROUP_MEMBER- Parameters:
groupId- ID of the group.profileId- Profile ID of the member being updated.role- Role of the member being updated (optional).jsonAttributes- Attributes of the member being updated (optional).callback- The method to be invoked when the server response is received
-
updateGroupName
Updates a group's name. Service Name - group Service Operation - UPDATE_GROUP_NAME- Parameters:
groupId- ID of the group.name- Name to apply.callback- The method to be invoked when the server response is received
-
updateGroupSummaryData
public void updateGroupSummaryData(String groupId, int version, String jsonSummaryData, IServerCallback callback)Updates a group's summaryData Service Name - group Service Operation - UPDATE_GROUP_SUMMARY_DATA- Parameters:
groupId- ID of the group.version- version of the groupjsonSummaryData- summarycallback- The method to be invoked when the server response is received
-
getRandomGroupsMatching
Gets a list of up to maxReturn randomly selected groups from the server based on the where condition Service Name - group Service Operation - GET_RANDOM_GROUPS_MATCHING- Parameters:
jsonWhere- ID of the group.maxReturn- max num groups to searchcallback- The method to be invoked when the server response is received
-