public class ChatRoomClient extends BaseClient
_baseUrl, _gson, _httpClient| Constructor and Description |
|---|
ChatRoomClient(java.lang.String appKey,
java.lang.String masterSecret) |
ChatRoomClient(java.lang.String appKey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy) |
ChatRoomClient(java.lang.String appKey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy,
JMessageConfig config)
Create a JMessage Base Client
|
| Modifier and Type | Method and Description |
|---|---|
cn.jiguang.common.resp.ResponseWrapper |
addChatRoomMember(long roomId,
Members members)
Add members to chat room
|
cn.jiguang.common.resp.ResponseWrapper |
addChatRoomMember(long roomId,
java.lang.String... members)
Add members to chat room
|
CreateChatRoomResult |
createChatRoom(ChatRoomPayload payload)
Create chat room
|
cn.jiguang.common.resp.ResponseWrapper |
deleteChatRoom(long roomId)
Delete chat room by id
|
ChatRoomListResult |
getAppChatRoomInfo(int start,
int count)
Get application's chat room list
|
ChatRoomListResult |
getBatchChatRoomInfo(long... roomIds)
Get chat room information by room ids
|
ChatRoomMemberList |
getChatRoomMembers(long roomId,
int start,
int count)
Get all member info of chat room
|
ChatRoomListResult |
getUserChatRoomInfo(java.lang.String username)
Get user's whole chat room information
|
cn.jiguang.common.resp.ResponseWrapper |
removeChatRoomMembers(long roomId,
Members members)
remove members from chat room
|
cn.jiguang.common.resp.ResponseWrapper |
removeChatRoomMembers(long roomId,
java.lang.String... members)
remove members from chat room
|
cn.jiguang.common.resp.ResponseWrapper |
updateChatRoomInfo(long roomId,
java.lang.String ownerUsername,
java.lang.String name,
java.lang.String desc)
Update chat room info
|
cn.jiguang.common.resp.ResponseWrapper |
updateUserSpeakStatus(long roomId,
java.lang.String username,
int flag)
Update user speak status
|
setHttpClientpublic ChatRoomClient(java.lang.String appKey,
java.lang.String masterSecret)
public ChatRoomClient(java.lang.String appKey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy)
public ChatRoomClient(java.lang.String appKey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy,
JMessageConfig config)
appKey - The KEY of one application on JPush.masterSecret - API access secret of the appKey.proxy - The proxy, if there is no proxy, should be null.config - The client configuration. Can use JMessageConfig.getInstance() as default.public CreateChatRoomResult createChatRoom(ChatRoomPayload payload) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
payload - ChatRoomPayloadcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic ChatRoomListResult getBatchChatRoomInfo(long... roomIds) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
roomIds - Array of room idChatRoomListResultcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic ChatRoomListResult getUserChatRoomInfo(java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - requiredChatRoomListResultcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic ChatRoomListResult getAppChatRoomInfo(int start, int count) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
start - start indexcount - list countChatRoomListResultcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper updateChatRoomInfo(long roomId,
java.lang.String ownerUsername,
java.lang.String name,
java.lang.String desc)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - room idownerUsername - owner usernamename - new chat room namedesc - chat room descriptioncn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper deleteChatRoom(long roomId)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - room idcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper updateUserSpeakStatus(long roomId,
java.lang.String username,
int flag)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - chat room idusername - user to be modifiedflag - 0 means allow to speak, 1 means forbid to speak in chat roomcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic ChatRoomMemberList getChatRoomMembers(long roomId, int start, int count) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
roomId - chat room idstart - start indexcount - member countChatRoomMemberListcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper addChatRoomMember(long roomId,
java.lang.String... members)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - chat room idmembers - username arraycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper addChatRoomMember(long roomId,
Members members)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - chat room idmembers - Memberscn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper removeChatRoomMembers(long roomId,
java.lang.String... members)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - chat room idmembers - username arraycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper removeChatRoomMembers(long roomId,
Members members)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
roomId - chat room idmembers - Memberscn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionCopyright © 2018. All Rights Reserved.