public class UserClient extends BaseClient
_baseUrl, _gson, _httpClient| 构造器和说明 |
|---|
UserClient(java.lang.String appkey,
java.lang.String masterSecret)
Create a User Client with default parameters.
|
UserClient(java.lang.String appkey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy)
Create a User Client with a proxy.
|
UserClient(java.lang.String appkey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy,
JMessageConfig config)
Create a User Client with custom config.
|
| 限定符和类型 | 方法和说明 |
|---|---|
cn.jiguang.common.resp.ResponseWrapper |
addBlackList(java.lang.String username,
java.lang.String... users)
Add Users to black list
|
cn.jiguang.common.resp.ResponseWrapper |
addFriends(java.lang.String username,
java.lang.String... users)
Add friends to username
|
cn.jiguang.common.resp.ResponseWrapper |
deleteFriends(java.lang.String username,
java.lang.String... users)
Delete friends
|
cn.jiguang.common.resp.ResponseWrapper |
deleteUser(java.lang.String username) |
cn.jiguang.common.resp.ResponseWrapper |
forbidUser(java.lang.String username,
boolean disable)
Forbid or activate user
|
UserListResult |
getAdminListByAppkey(int start,
int count)
Get admins by appkey
|
UserInfoResult[] |
getBlackList(java.lang.String username)
Get a user's all black list
|
UserInfoResult[] |
getFriendsInfo(java.lang.String username)
Get friends'info from user
|
UserGroupsResult |
getGroupList(java.lang.String username)
Get all groups of a user
|
UserInfoResult |
getUserInfo(java.lang.String username) |
UserListResult |
getUserList(int start,
int count)
Get user list
|
UserStateListResult[] |
getUsersState(java.lang.String... users)
Get users' state
|
UserStateResult |
getUserState(java.lang.String username)
Get user state
|
cn.jiguang.common.resp.ResponseWrapper |
registerAdmins(RegisterInfo payload) |
cn.jiguang.common.resp.ResponseWrapper |
registerUsers(RegisterPayload payload) |
cn.jiguang.common.resp.ResponseWrapper |
removeBlackList(java.lang.String username,
java.lang.String... users) |
cn.jiguang.common.resp.ResponseWrapper |
setGroupShield(GroupShieldPayload payload,
java.lang.String username)
Set user's group message blocking
|
cn.jiguang.common.resp.ResponseWrapper |
setNoDisturb(java.lang.String username,
NoDisturbPayload payload)
Set don't disturb service while receiving messages.
|
cn.jiguang.common.resp.ResponseWrapper |
updateFriendsNote(java.lang.String username,
FriendNote[] array)
Update friends' note information.
|
cn.jiguang.common.resp.ResponseWrapper |
updatePassword(java.lang.String username,
java.lang.String password) |
cn.jiguang.common.resp.ResponseWrapper |
updateUserInfo(java.lang.String username,
UserPayload payload) |
setHttpClientpublic UserClient(java.lang.String appkey,
java.lang.String masterSecret)
appkey - The key of one application on JPush.masterSecret - API access secret of the appKey.public UserClient(java.lang.String appkey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy)
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.public UserClient(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 cn.jiguang.common.resp.ResponseWrapper registerUsers(RegisterPayload payload) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic cn.jiguang.common.resp.ResponseWrapper registerAdmins(RegisterInfo payload) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic UserInfoResult getUserInfo(java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic cn.jiguang.common.resp.ResponseWrapper updateUserInfo(java.lang.String username,
UserPayload payload)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic UserStateResult getUserState(java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - Necessarycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic UserStateListResult[] getUsersState(java.lang.String... users) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
users - username of usersUserStateListResultcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper updatePassword(java.lang.String username,
java.lang.String password)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic cn.jiguang.common.resp.ResponseWrapper deleteUser(java.lang.String username)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic UserInfoResult[] getBlackList(java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - The owner of the black listcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper addBlackList(java.lang.String username,
java.lang.String... users)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - The owner of the black listusers - The users that will add to black listcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper removeBlackList(java.lang.String username,
java.lang.String... users)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic UserListResult getUserList(int start, int count) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
start - The start index of the listcount - The number that how many you want to get from listcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic UserListResult getAdminListByAppkey(int start, int count) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
start - The start index of the listcount - The number that how many you want to get from listcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper setNoDisturb(java.lang.String username,
NoDisturbPayload payload)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - Necessarypayload - NoDisturbPayloadcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic UserGroupsResult getGroupList(java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - Necessarycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper addFriends(java.lang.String username,
java.lang.String... users)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - Necessaryusers - username to be addcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper deleteFriends(java.lang.String username,
java.lang.String... users)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - Friends you want to delete tousers - username to be deletecn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper updateFriendsNote(java.lang.String username,
FriendNote[] array)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - Necessaryarray - FriendNote arraycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic UserInfoResult[] getFriendsInfo(java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - Necessarycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper setGroupShield(GroupShieldPayload payload, java.lang.String username) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
payload - GroupShieldPayloadusername - Necessarycn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper forbidUser(java.lang.String username,
boolean disable)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - usernamedisable - true means forbid, false means activatecn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionCopyright © 2018. All Rights Reserved.