hyphenate_SDK3.0  3.0.1
hyphenatejavaIMSDK
Classes | Public Member Functions | List of all members
com.hyphenate.chat.EMGroupManager Class Reference

Classes

class  EMGroupOptions
 
enum  EMGroupStyle
 

Public Member Functions

List< EMGroupgetAllGroups ()
 
EMGroup getGroup (String groupId)
 
EMGroup createGroup (String groupName, String desc, String[] allMembers, String reason, EMGroupOptions option) throws HyphenateException
 
synchronized void loadAllGroups ()
 
void destroyGroup (final String groupId) throws HyphenateException
 
void addUsersToGroup (String groupId, String[] newmembers) throws HyphenateException
 
void removeUserFromGroup (final String groupId, final String username) throws HyphenateException
 
void leaveGroup (String groupId) throws HyphenateException
 
EMGroup getGroupFromServer (String groupId) throws HyphenateException
 
synchronized List< EMGroupgetJoinedGroupsFromServer () throws HyphenateException
 
EMCursorResult< EMGroupInfogetPublicGroupsFromServer (int pageSize, String cursor) throws HyphenateException
 
void joinGroup (String groupId) throws HyphenateException
 
void changeGroupName (String groupId, String changedGroupName) throws HyphenateException
 
EMGroup acceptInvitation (String groupId, String inviter) throws HyphenateException
 
void declineInvitation (String groupId, String inviter, String reason) throws HyphenateException
 
void acceptApplication (String username, String groupId) throws HyphenateException
 
void declineApplication (String username, String groupId, String reason) throws HyphenateException
 
void setAutoAcceptInvitation (boolean autoAccept)
 
void inviteUser (String groupId, String[] beInvitedUsernames, String reason) throws HyphenateException
 
void applyJoinToGroup (String groupId, String reason) throws HyphenateException
 
void blockGroupMessage (String groupId) throws HyphenateException
 
void unblockGroupMessage (String groupId) throws HyphenateException
 
void blockUser (String groupId, String username) throws HyphenateException
 
void unblockUser (String groupId, String username) throws HyphenateException
 
List< String > getBlockedUsers (String groupId) throws HyphenateException
 
void addGroupChangeListener (EMGroupChangeListener listener)
 
void removeGroupChangeListener (EMGroupChangeListener listener)
 

Detailed Description

group manager is used to manage all the groups related operations, create, delete, group and invite members, block memebers, etc..

Member Function Documentation

void com.hyphenate.chat.EMGroupManager.acceptApplication ( String  username,
String  groupId 
) throws HyphenateException

accept the application of the user to join this group

Parameters
usernameapplication user
groupIdgroup id for application
Exceptions
HyphenateException
EMGroup com.hyphenate.chat.EMGroupManager.acceptInvitation ( String  groupId,
String  inviter 
) throws HyphenateException

accept group's invitation.

Parameters
Group'sID.
Inviter.
Returns
The group user has accepted.
void com.hyphenate.chat.EMGroupManager.addGroupChangeListener ( EMGroupChangeListener  listener)

register the group change listener

Parameters
listener
See also
GroupChangeListener
void com.hyphenate.chat.EMGroupManager.addUsersToGroup ( String  groupId,
String[]  newmembers 
) throws HyphenateException

add users to the group and only the group owner can do it.

Parameters
groupId
newmembersuser id to be added
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.applyJoinToGroup ( String  groupId,
String  reason 
) throws HyphenateException

apply to join the group

Parameters
groupId
reasonmessage for join application
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.blockGroupMessage ( String  groupId) throws HyphenateException

set to disable receiving the group messages

Parameters
groupId
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.blockUser ( String  groupId,
String  username 
) throws HyphenateException

set to block member who will be not allowed to receive any group messages and only the group owner can do it.

Parameters
groupId
usernameuser to be blocked
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.changeGroupName ( String  groupId,
String  changedGroupName 
) throws HyphenateException

change the group name and only group owner can do it.

Parameters
groupIdgroup id to be change name
changedGroupNamenew name
Exceptions
HyphenateException
EMGroup com.hyphenate.chat.EMGroupManager.createGroup ( String  groupName,
String  desc,
String[]  allMembers,
String  reason,
EMGroupOptions  option 
) throws HyphenateException

create a group on IM server

Parameters
groupName,groupname
allMembers,arrayof all members, no need include the owner of this group
reason,messageused to invite the group members
options,optionsfor this group
void com.hyphenate.chat.EMGroupManager.declineApplication ( String  username,
String  groupId,
String  reason 
) throws HyphenateException

accept the application of the user to join this group

Parameters
usernameapplication user
groupIdgroup id for application
reasonmessage for decline
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.declineInvitation ( String  groupId,
String  inviter,
String  reason 
) throws HyphenateException

decline group's invitation.

Parameters
Group'sID.
Inviter.
reason,messagefor decline
Returns
The group user has accepted.
void com.hyphenate.chat.EMGroupManager.destroyGroup ( final String  groupId) throws HyphenateException

dismiss the group and only the group owner can do it.

Parameters
groupId
Exceptions
HyphenateException
List<EMGroup> com.hyphenate.chat.EMGroupManager.getAllGroups ( )

get all grops from cache

Returns
group List
List<String> com.hyphenate.chat.EMGroupManager.getBlockedUsers ( String  groupId) throws HyphenateException

get the list of blocked users and only the group owner can do it.

Returns
List<String>
Exceptions
HyphenateException
EMGroup com.hyphenate.chat.EMGroupManager.getGroup ( String  groupId)

get local group from cache by group id

Parameters
groupId
Returns
instance of EMGroup, return null if group is not exist
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer ( String  groupId) throws HyphenateException

get information of group from server.

Parameters
groupId
Returns
instance of EMGroup
synchronized List<EMGroup> com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer ( ) throws HyphenateException

fetch all joined groups from server, only return the group list, not include member list in group, use getGroupFromServer(String groupId) if you want it

Returns
group list
Exceptions
HyphenateException
EMCursorResult<EMGroupInfo> com.hyphenate.chat.EMGroupManager.getPublicGroupsFromServer ( int  pageSize,
String  cursor 
) throws HyphenateException

get all public groups from server

Parameters
pageSizethe number of groups
cursorused to get group page by page, use null if first call
Returns
cursor used to get next page and the group list
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.inviteUser ( String  groupId,
String[]  beInvitedUsernames,
String  reason 
) throws HyphenateException

invite other users to join the group if the group has been set to allow member to invite

Parameters
groupId
beInvitedUsernamesarray of users to be invited
reasonmessage for invitation
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.joinGroup ( String  groupId) throws HyphenateException

join the group by the group id

Parameters
groupId
void com.hyphenate.chat.EMGroupManager.leaveGroup ( String  groupId) throws HyphenateException

the member exit the group

Parameters
groupId
Exceptions
HyphenateException
synchronized void com.hyphenate.chat.EMGroupManager.loadAllGroups ( )

load all local groups synchronously

void com.hyphenate.chat.EMGroupManager.removeGroupChangeListener ( EMGroupChangeListener  listener)

remove group change listener

Parameters
listener
void com.hyphenate.chat.EMGroupManager.removeUserFromGroup ( final String  groupId,
final String  username 
) throws HyphenateException

remove the member from the group and only the group owner can do it.

Parameters
groupId
usernameuser id to be removed
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.setAutoAcceptInvitation ( boolean  autoAccept)

set to acception invitation automatically

Parameters
autoAccept
Deprecated:
use EMOptions.setAutoAcceptGroupInvitation
void com.hyphenate.chat.EMGroupManager.unblockGroupMessage ( String  groupId) throws HyphenateException

set to enable to receive the group message again

Parameters
groupId
Exceptions
HyphenateException
void com.hyphenate.chat.EMGroupManager.unblockUser ( String  groupId,
String  username 
) throws HyphenateException

remove the blocked user from the group balcklist

Parameters
groupId
username

The documentation for this class was generated from the following file: