public class AccountManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
io.reactivex.Completable |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
Change password of current account.
|
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
io.reactivex.functions.Action onComplete)
Change password of current account.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread. |
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
io.reactivex.functions.Action onComplete,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Change password of current account.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread. |
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
ChangePasswordCallback callback)
Deprecated.
|
void |
createNewProfile(AccountProfileProperties profilesProperties,
ProfileEditCallback callback)
|
io.reactivex.Single<AccountProfile> |
createNewProfile(ProfileProperties profileProperties)
Create new profile and use this profile as active profile.
|
void |
createNewProfile(ProfileProperties profileProperties,
io.reactivex.functions.Consumer<AccountProfile> onSuccess)
Create new profile and use this profile as active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
createNewProfile(ProfileProperties profileProperties,
io.reactivex.functions.Consumer<AccountProfile> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Create new profile and use this profile as active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
io.reactivex.Completable |
deleteAllMessage()
Delete all message.
|
void |
deleteAllMessage(io.reactivex.functions.Action onComplete)
Delete all message.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread. |
void |
deleteAllMessage(io.reactivex.functions.Action onComplete,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Delete all message.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread. |
void |
deleteAllMessages(DeleteMessageCallback deleteMessageCallback)
Deprecated.
|
io.reactivex.Completable |
deleteMessage(java.lang.String id)
Delete message by ID.
|
void |
deleteMessage(java.lang.String id,
io.reactivex.functions.Action onComplete)
Delete message by ID.
|
void |
deleteMessage(java.lang.String id,
io.reactivex.functions.Action onComplete,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Delete message by ID.
|
void |
deleteMessage(java.lang.String id,
DeleteMessageCallback deleteMessageCallback)
Deprecated.
|
io.reactivex.Completable |
deleteMultiMessage(java.util.List<java.lang.String> ids)
Delete messages by IDs.
|
void |
deleteMultiMessage(java.util.List<java.lang.String> ids,
io.reactivex.functions.Action onComplete)
Delete messages by IDs.
|
void |
deleteMultiMessage(java.util.List<java.lang.String> ids,
io.reactivex.functions.Action onComplete,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Delete messages by IDs.
|
void |
deleteMultiMessage(java.util.List<java.lang.String> ids,
DeleteMessageCallback deleteMessageCallback)
Deprecated.
|
io.reactivex.Completable |
deleteProfile(java.lang.String profileId)
Delete a profile by ID.
|
void |
deleteProfile(java.lang.String profileId,
io.reactivex.functions.Action onComplete)
Delete a profile by ID.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread. |
void |
deleteProfile(java.lang.String profileId,
io.reactivex.functions.Action onComplete,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Delete a profile by ID.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread. |
void |
deleteProfile(java.lang.String profileId,
ICallback<java.lang.Boolean> callback)
Deprecated.
|
io.reactivex.Single<java.util.List<AccountProfile>> |
getAccountProfiles()
Get all profile of current account.
|
void |
getAccountProfiles(io.reactivex.functions.Consumer<java.util.List<AccountProfile>> onSuccess)
Get all profile of current account.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
getAccountProfiles(io.reactivex.functions.Consumer<java.util.List<AccountProfile>> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Get all profile of current account.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
getAccountProfiles(ProfileListCallback callback)
Deprecated.
|
java.lang.String |
getCurrentActiveProfileId()
If user already logged in, it should return the ID of
the activating profile, otherwise null if no profile is activating.
|
io.reactivex.Single<java.util.List<Message>> |
getMessages(int limit,
int offset)
Get messages.
|
void |
getMessages(int limit,
int offset,
io.reactivex.functions.Consumer<java.util.List<Message>> onSuccess)
Get messages.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
getMessages(int limit,
int offset,
io.reactivex.functions.Consumer<java.util.List<Message>> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Get messages.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
getMessages(int limit,
int offset,
MessageListCallback callback)
Deprecated.
|
java.lang.String |
getRefreshToken()
Get OAuth refresh token of current account.
|
java.lang.String |
getUserToken()
Get authentication token using for interacting with CMS.
|
boolean |
hasActiveProfile()
Check if any profile is activating.
|
boolean |
isLoggedIn()
Determine if user is logged in or not.
|
void |
logout()
Log out, after that
isLoggedIn() will return false, and these methods also return null:
getCurrentActiveProfileId() , getUserToken() , getRefreshToken() |
io.reactivex.Single<java.lang.String> |
switchToProfile(java.lang.String newProfileId)
Switch profile.
|
void |
switchToProfile(java.lang.String newProfileId,
io.reactivex.functions.Consumer<java.lang.String> onSuccess)
Switch profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
switchToProfile(java.lang.String newProfileId,
io.reactivex.functions.Consumer<java.lang.String> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Switch profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
switchToProfile(java.lang.String profileId,
SwitchProfileCallback switchProfileCallback)
Deprecated.
|
io.reactivex.Single<java.util.List<ImageInfo>> |
updateAvatar(byte[] avatarStream)
Update avatar of current active profile.
|
void |
updateAvatar(byte[] avatarStream,
io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess)
Update avatar of current active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
updateAvatar(byte[] avatarStream,
io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Update avatar of current active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
io.reactivex.Single<java.util.List<ImageInfo>> |
updateAvatar(java.io.File avatarFile)
Update avatar of the current activating profile.
|
void |
updateAvatar(java.io.File avatarFile,
io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess)
Update avatar of current active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
updateAvatar(java.io.File avatarFile,
io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Update avatar of current active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
io.reactivex.Single<java.util.List<ImageInfo>> |
updateAvatar(java.io.File avatarFile,
java.lang.String profileId)
Update avatar of an profile, give this profile id.
|
void |
updateProfile(AccountProfileProperties profilesProperties,
ProfileEditCallback callback)
|
io.reactivex.Single<AccountProfile> |
updateProfile(ProfileProperties profileProperties)
Update current active profile.
|
void |
updateProfile(ProfileProperties profileProperties,
io.reactivex.functions.Consumer<AccountProfile> onSuccess)
Update current active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
updateProfile(ProfileProperties profileProperties,
io.reactivex.functions.Consumer<AccountProfile> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Update current active profile.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
public boolean isLoggedIn()
@Nullable public java.lang.String getCurrentActiveProfileId()
hasActiveProfile()
@Nullable public java.lang.String getUserToken()
@Nullable public java.lang.String getRefreshToken()
public boolean hasActiveProfile()
@Deprecated public void switchToProfile(java.lang.String profileId, SwitchProfileCallback switchProfileCallback)
switchToProfile(String)
, switchToProfile(String, Consumer)
,
switchToProfile(String, Consumer, Consumer)
instead.public io.reactivex.Single<java.lang.String> switchToProfile(java.lang.String newProfileId)
newProfileId
- ID of profile will be active.public void switchToProfile(java.lang.String newProfileId, io.reactivex.functions.Consumer<java.lang.String> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
newProfileId
- ID of profile will be active.onSuccess
- The callback after switching profile success, payload is new auth token.switchToProfile(String)
public void switchToProfile(java.lang.String newProfileId, io.reactivex.functions.Consumer<java.lang.String> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
newProfileId
- ID of profile will be active.onSuccess
- The callback after switching profile success, payload is new auth token.onError
- The callback on error.switchToProfile(String)
@Deprecated public void getAccountProfiles(ProfileListCallback callback)
getAccountProfiles()
, getAccountProfiles(Consumer)
,
getAccountProfiles(Consumer, Consumer)
instead.public io.reactivex.Single<java.util.List<AccountProfile>> getAccountProfiles()
AccountProfile
list of this account if success.public void getAccountProfiles(io.reactivex.functions.Consumer<java.util.List<AccountProfile>> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
onSuccess
- The callback on success.getAccountProfiles()
public void getAccountProfiles(io.reactivex.functions.Consumer<java.util.List<AccountProfile>> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
onSuccess
- The callback on success.onError
- The callback on error.getAccountProfiles()
@Deprecated public void createNewProfile(AccountProfileProperties profilesProperties, ProfileEditCallback callback)
public io.reactivex.Single<AccountProfile> createNewProfile(ProfileProperties profileProperties)
profileProperties
- Properties of new profile.AccountProfile
created.public void createNewProfile(ProfileProperties profileProperties, io.reactivex.functions.Consumer<AccountProfile> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
profileProperties
- Properties of new profile.onSuccess
- The callback on success, payload is the AccountProfile
created.createNewProfile(ProfileProperties)
public void createNewProfile(ProfileProperties profileProperties, io.reactivex.functions.Consumer<AccountProfile> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
profileProperties
- Properties of new profile.onSuccess
- The callback on success, payload is the AccountProfile
created.onError
- The callback on error.createNewProfile(ProfileProperties)
@Deprecated public void updateProfile(AccountProfileProperties profilesProperties, ProfileEditCallback callback)
public io.reactivex.Single<AccountProfile> updateProfile(ProfileProperties profileProperties)
profileProperties
- Properties to update.AccountProfile
after updated.public void updateProfile(ProfileProperties profileProperties, io.reactivex.functions.Consumer<AccountProfile> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
profileProperties
- Properties to update.onSuccess
- The callback on success, payload is the AccountProfile
after updated.updateProfile(ProfileProperties)
public void updateProfile(ProfileProperties profileProperties, io.reactivex.functions.Consumer<AccountProfile> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
profileProperties
- Properties to update.onSuccess
- The callback on success, payload is the AccountProfile
after updated.onError
- The callback on error.updateProfile(ProfileProperties)
@Deprecated public void deleteProfile(java.lang.String profileId, ICallback<java.lang.Boolean> callback)
deleteProfile(String)
,
deleteProfile(String, Action)
, deleteProfile(String, Action, Consumer)
instead.public io.reactivex.Completable deleteProfile(java.lang.String profileId)
profileId
- ID of the profile to be deleted.public void deleteProfile(java.lang.String profileId, io.reactivex.functions.Action onComplete)
Schedulers.io()
), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread.
profileId
- ID of the profile to be deleted.onComplete
- The callback on complete.deleteProfile(String)
public void deleteProfile(java.lang.String profileId, io.reactivex.functions.Action onComplete, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread.
profileId
- ID of the profile to be deleted.onComplete
- The callback on complete.onError
- The callback on error.deleteProfile(String)
@Deprecated public void changePassword(java.lang.String oldPassword, java.lang.String newPassword, ChangePasswordCallback callback)
changePassword(String, String)
,
changePassword(String, String, Action)
,
changePassword(String, String, Action, Consumer)
instead.public io.reactivex.Completable changePassword(java.lang.String oldPassword, java.lang.String newPassword)
oldPassword
- The old password.newPassword
- The new password.public void changePassword(java.lang.String oldPassword, java.lang.String newPassword, io.reactivex.functions.Action onComplete)
Schedulers.io()
), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread.
oldPassword
- The old password.newPassword
- The new password.onComplete
- The callback on complete.changePassword(String, String)
public void changePassword(java.lang.String oldPassword, java.lang.String newPassword, io.reactivex.functions.Action onComplete, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread.
oldPassword
- The old password.newPassword
- The new password.onComplete
- The callback on complete.onError
- The callback on error.changePassword(String, String)
public void logout()
isLoggedIn()
will return false, and these methods also return null:
getCurrentActiveProfileId()
, getUserToken()
, getRefreshToken()
@Deprecated public void getMessages(int limit, int offset, MessageListCallback callback)
getMessages(int, int)
,
getMessages(int, int, Consumer)
,
getMessages(int, int, Consumer, Consumer)
instead.public io.reactivex.Single<java.util.List<Message>> getMessages(int limit, int offset)
limit
- Limit number of messages per request.offset
- The offset from start of list message.Message
list if success.public void getMessages(int limit, int offset, io.reactivex.functions.Consumer<java.util.List<Message>> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
limit
- Limit number of messages per request.offset
- The offset from start of list message.onSuccess
- The callback on success, payload is a Message
list.getMessages(int, int)
public void getMessages(int limit, int offset, io.reactivex.functions.Consumer<java.util.List<Message>> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
limit
- Limit number of messages per request.offset
- The offset from start of list message.onSuccess
- The callback on success, payload is a Message
list.onError
- The callback on error.getMessages(int, int)
@Deprecated public void deleteAllMessages(DeleteMessageCallback deleteMessageCallback)
deleteAllMessage()
,
deleteAllMessage(Action)
, deleteAllMessage(Action, Consumer)
instead.public io.reactivex.Completable deleteAllMessage()
public void deleteAllMessage(io.reactivex.functions.Action onComplete)
Schedulers.io()
), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread.
onComplete
- The callback on complete.deleteAllMessage()
public void deleteAllMessage(io.reactivex.functions.Action onComplete, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back - `onComplete` in the current thread which call this method,
if can't, onComplete will call back on main thread.
onComplete
- The callback on complete.onError
- The callback on error.deleteAllMessage()
@Deprecated public void deleteMessage(java.lang.String id, DeleteMessageCallback deleteMessageCallback)
deleteMessage(String)
,
deleteMessage(String, Action)
, deleteMessage(String, Action, Consumer)
instead.public io.reactivex.Completable deleteMessage(java.lang.String id)
id
- The ID of message to be deleted.public void deleteMessage(java.lang.String id, io.reactivex.functions.Action onComplete)
id
- The ID of message to be deleted.onComplete
- The callback on complete.deleteMessage(String)
public void deleteMessage(java.lang.String id, io.reactivex.functions.Action onComplete, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
id
- The ID of message to be deleted.onComplete
- The callback on complete.onError
- The callback on error.deleteMessage(String)
@Deprecated public void deleteMultiMessage(java.util.List<java.lang.String> ids, DeleteMessageCallback deleteMessageCallback)
deleteMultiMessage(List)
,
deleteMultiMessage(List, Action)
,
deleteMultiMessage(List, Action, Consumer)
instead.public io.reactivex.Completable deleteMultiMessage(java.util.List<java.lang.String> ids)
ids
- List ID of messages to be deleted.public void deleteMultiMessage(java.util.List<java.lang.String> ids, io.reactivex.functions.Action onComplete)
ids
- List ID of messages to be deleted.onComplete
- The callback on complete.deleteMultiMessage(List)
public void deleteMultiMessage(java.util.List<java.lang.String> ids, io.reactivex.functions.Action onComplete, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
ids
- List ID of messages to be deleted.onComplete
- The callback on complete.onError
- The callback on error.deleteMultiMessage(List)
public io.reactivex.Single<java.util.List<ImageInfo>> updateAvatar(java.io.File avatarFile, java.lang.String profileId)
avatarFile
- The avatar file.profileId
- The ID of the profile to update avatarImageInfo
list of current profile.updateAvatar(byte[])
public io.reactivex.Single<java.util.List<ImageInfo>> updateAvatar(java.io.File avatarFile)
avatarFile
- The avatar file.ImageInfo
list of current profile.updateAvatar(byte[])
public void updateAvatar(java.io.File avatarFile, io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
avatarFile
- The avatar file.onSuccess
- The callback on success, payload is an ImageInfo
list of current profile.updateAvatar(File)
public void updateAvatar(java.io.File avatarFile, io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
avatarFile
- The avatar file.onSuccess
- The callback on success, payload is an ImageInfo
list of current profile.onError
- The callback on error.updateAvatar(File)
public io.reactivex.Single<java.util.List<ImageInfo>> updateAvatar(byte[] avatarStream)
avatarStream
- Byte array of avatar data.ImageInfo
list of current profile.public void updateAvatar(byte[] avatarStream, io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
avatarStream
- Byte array of avatar data.onSuccess
- The callback on success, payload is an ImageInfo
list of current profile.updateAvatar(byte[])
public void updateAvatar(byte[] avatarStream, io.reactivex.functions.Consumer<java.util.List<ImageInfo>> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
avatarStream
- Byte array of avatar data.onSuccess
- The callback on success, payload is an ImageInfo
list of current profile.onError
- The callback on error.updateAvatar(byte[])