public class NCMBUserService extends NCMBService
NCMBService.RequestParams
Modifier and Type | Field and Description |
---|---|
static int |
HTTP_STATUS_AUTHORIZED
Status code of authorize success
|
static int |
HTTP_STATUS_REGISTERED
Status code of register success
|
static int |
HTTP_STATUS_REQUEST_ACCEPTED
Status code of invite api accespted
|
static java.lang.String |
SERVICE_PATH
service path for API category
|
mContext, mServicePath
Modifier and Type | Method and Description |
---|---|
void |
deleteUser(java.lang.String userId)
Delete user by given id
|
protected void |
deleteUserCheckResponse(NCMBResponse response)
Check responkse to delete user
|
void |
deleteUserInBackground(java.lang.String userId,
ExecuteServiceCallback callback)
Delete user by given id in background
|
protected NCMBService.RequestParams |
deleteUserParams(java.lang.String userId)
Setup params to delete user
|
NCMBUser |
fetchUser(java.lang.String userId)
Get user entity from given id
|
void |
fetchUserInBackground(java.lang.String userId,
FetchCallback callback)
Get user entity from given id in background
|
protected org.json.JSONObject |
fillParameters(java.lang.String[] keys,
org.json.JSONObject src)
Create JSONObject and copy values with given keys
|
protected void |
getUserCheckResponse(NCMBResponse response)
Check response to get user entity
|
protected NCMBService.RequestParams |
getUserParams(java.lang.String userId)
Setup params to get user entity
|
void |
inviteByMail(java.lang.String mailAddress)
Invite new user by Email
( /requestMailAddressUserEntry API )
|
protected void |
inviteByMailCheckResponse(NCMBResponse response)
Check response to invite new user by Email
|
void |
inviteByMailInBackground(java.lang.String mailAddress,
DoneCallback callback)
Invite new user by Email in background
|
protected NCMBService.RequestParams |
inviteByMailParams(java.lang.String mailAddress)
Setup params to invite new user by Email
|
NCMBUser |
loginByMail(java.lang.String mailAddress,
java.lang.String password)
login by mail address
|
protected void |
loginByMailCheckResponse(NCMBResponse response)
Check response to login by mail address
|
void |
loginByMailInBackground(java.lang.String mailAddress,
java.lang.String password,
LoginCallback callback)
Login by mail address in background
|
protected NCMBService.RequestParams |
loginByMailParams(java.lang.String mailAddress,
java.lang.String password)
Setup params to login by mail address
|
NCMBUser |
loginByName(java.lang.String userName,
java.lang.String password)
Login by user name
|
protected void |
loginByNameCheckResponse(NCMBResponse response)
Check response to login by user name
|
void |
loginByNameInBackground(java.lang.String userName,
java.lang.String password,
LoginCallback callback)
Login by user name in background
|
protected NCMBService.RequestParams |
loginByNameParams(java.lang.String userName,
java.lang.String password)
Setup params to login by user name
|
void |
logout()
Logout from session
|
protected void |
logoutCheckResponse(NCMBResponse response)
Check response to logout
|
void |
logoutInBackground(DoneCallback callback)
Logout from session in background
|
protected NCMBService.RequestParams |
logoutParams()
Setup parameters to logout
|
protected NCMBUser |
postLoginProcess(NCMBResponse response)
process after login
|
NCMBUser |
registerByName(java.lang.String userName,
java.lang.String password)
Register new user by name
|
NCMBUser |
registerByName(java.lang.String userName,
java.lang.String password,
org.json.JSONObject otherFields)
Register new user by name
|
void |
registerByNameInBackground(java.lang.String userName,
java.lang.String password,
org.json.JSONObject otherFields,
LoginCallback callback)
Register new user by name in background
|
void |
registerByNameInBackground(java.lang.String userName,
java.lang.String password,
LoginCallback callback)
Register new user by name in background
|
NCMBUser |
registerByOauth(org.json.JSONObject oauthOptions)
Register new user by OAuth services
|
void |
registerByOauthInBackground(org.json.JSONObject oauthOptions,
LoginCallback callback)
Register new user by OAuth services in background
|
protected org.json.JSONObject |
registerByOauthSetup(org.json.JSONObject oauthOptions)
Setup OAuth parameters to register new user with OAuth
|
protected NCMBUser |
registerUser(org.json.JSONObject params,
boolean oauth)
Internal method to register user
|
protected void |
registerUserCheckResponse(NCMBResponse response,
boolean oauth)
Check response to register new user
|
protected void |
registerUserInBackground(org.json.JSONObject params,
boolean oauth,
LoginCallback callback)
Internal method to register user in background
|
protected NCMBService.RequestParams |
registerUserParams(org.json.JSONObject params)
Setup params to register new user
|
void |
requestPasswordReset(java.lang.String mailAddress)
Send Email for the password reset in background thread
|
void |
requestPasswordResetInBackground(java.lang.String mailAddress,
DoneCallback callback)
Send Email for the password reset in background thread
|
protected NCMBService.RequestParams |
requestPasswordResetParams(java.lang.String mailAddress) |
void |
saveByName(java.lang.String userName,
java.lang.String password)
Save new user by name
|
void |
saveByName(java.lang.String userName,
java.lang.String password,
org.json.JSONObject otherFields)
Save new user by name
|
protected void |
saveByNameInBackground(java.lang.String userName,
java.lang.String password,
DoneCallback callback)
Internal Save new user by name in background
|
protected void |
saveByNameInBackground(java.lang.String userName,
java.lang.String password,
org.json.JSONObject otherFields,
DoneCallback callback)
Internal Save new user by name in background
|
protected void |
saveUser(org.json.JSONObject params,
boolean oauth)
Internal method to save user
|
protected void |
saveUserInBackground(org.json.JSONObject params,
DoneCallback callback)
Internal method to save user in background
|
java.util.ArrayList<NCMBUser> |
searchUser(org.json.JSONObject conditions)
Search users
|
protected void |
searchUserCheckResponse(NCMBResponse response)
Check response to search users
|
void |
searchUserInBackground(org.json.JSONObject conditions,
SearchUserCallback callback)
Search users in background
|
protected NCMBService.RequestParams |
searchUserParams(org.json.JSONObject conditions)
Setup parameters to search users
|
protected java.util.ArrayList<NCMBUser> |
searchUserPostProcess(org.json.JSONObject data)
Post process to search users
|
org.json.JSONObject |
updateUser(java.lang.String userId,
org.json.JSONObject params)
Update user information
|
protected void |
updateUserCheckResponse(NCMBResponse response)
Check response to update user information
|
void |
updateUserInBackground(java.lang.String userId,
org.json.JSONObject params,
ExecuteServiceCallback callback)
Update user information in background
|
protected NCMBService.RequestParams |
updateUserParams(java.lang.String userId,
org.json.JSONObject params)
Set up to update user information
|
sendRequest, sendRequest, sendRequest, sendRequest, sendRequestAsync, sendRequestAsync, sendRequestFile, sendRequestFileAsync
public static final java.lang.String SERVICE_PATH
public static final int HTTP_STATUS_REGISTERED
public static final int HTTP_STATUS_AUTHORIZED
public static final int HTTP_STATUS_REQUEST_ACCEPTED
public NCMBUser registerByName(java.lang.String userName, java.lang.String password) throws NCMBException
userName
- user namepassword
- passwordNCMBException
- exception from NIFCLOUD mobile backendpublic NCMBUser registerByName(java.lang.String userName, java.lang.String password, org.json.JSONObject otherFields) throws NCMBException
userName
- user namepassword
- passwordotherFields
- other fieldsNCMBException
- exception from NIFCLOUD mobile backendpublic void saveByName(java.lang.String userName, java.lang.String password) throws NCMBException
userName
- user namepassword
- passwordNCMBException
- exception from NIFCLOUD mobile backendpublic void saveByName(java.lang.String userName, java.lang.String password, org.json.JSONObject otherFields) throws NCMBException
userName
- user namepassword
- passwordotherFields
- other fieldsNCMBException
- exception from NIFCLOUD mobile backendpublic void registerByNameInBackground(java.lang.String userName, java.lang.String password, LoginCallback callback) throws NCMBException
userName
- user namepassword
- passwordcallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendpublic void registerByNameInBackground(java.lang.String userName, java.lang.String password, org.json.JSONObject otherFields, LoginCallback callback) throws NCMBException
userName
- user namepassword
- passwordotherFields
- other fieldscallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected void saveByNameInBackground(java.lang.String userName, java.lang.String password, DoneCallback callback) throws NCMBException
userName
- user namepassword
- passwordcallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected void saveByNameInBackground(java.lang.String userName, java.lang.String password, org.json.JSONObject otherFields, DoneCallback callback) throws NCMBException
userName
- userNamepassword
- passwordotherFields
- other fieldscallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected org.json.JSONObject registerByOauthSetup(org.json.JSONObject oauthOptions) throws NCMBException
oauthOptions
- OAuth optionsNCMBException
- exception from NIFCLOUD mobile backendpublic NCMBUser registerByOauth(org.json.JSONObject oauthOptions) throws NCMBException
oauthOptions
- OAuth optionsNCMBException
- exception from NIFCLOUD mobile backendpublic void registerByOauthInBackground(org.json.JSONObject oauthOptions, LoginCallback callback) throws NCMBException
oauthOptions
- OAuth optionscallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected org.json.JSONObject fillParameters(java.lang.String[] keys, org.json.JSONObject src) throws NCMBException
keys
- String[] keys to copysrc
- JSONObject source of copyNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams inviteByMailParams(java.lang.String mailAddress) throws NCMBException
mailAddress
- mail addressNCMBException
- exception from NIFCLOUD mobile backendprotected void inviteByMailCheckResponse(NCMBResponse response) throws NCMBException
response
- response of invitation mailNCMBException
- exception from NIFCLOUD mobile backendpublic void inviteByMail(java.lang.String mailAddress) throws NCMBException
mailAddress
- mail addressNCMBException
- exception from NIFCLOUD mobile backendpublic void inviteByMailInBackground(java.lang.String mailAddress, DoneCallback callback) throws NCMBException
mailAddress
- mail addresscallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams requestPasswordResetParams(java.lang.String mailAddress) throws java.lang.Exception
java.lang.Exception
public void requestPasswordReset(java.lang.String mailAddress) throws NCMBException
mailAddress
- mail addressNCMBException
- exception from NIFCLOUD mobile backendpublic void requestPasswordResetInBackground(java.lang.String mailAddress, DoneCallback callback) throws NCMBException
mailAddress
- mail addresscallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams registerUserParams(org.json.JSONObject params) throws NCMBException
params
- user parametersNCMBException
- exception from NIFCLOUD mobile backendprotected void registerUserCheckResponse(NCMBResponse response, boolean oauth) throws NCMBException
response
- response of the registrationoauth
- use oauth or notNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBUser registerUser(org.json.JSONObject params, boolean oauth) throws NCMBException
params
- parametersoauth
- use oauth or notNCMBException
- exception from NIFCLOUD mobile backendprotected void saveUser(org.json.JSONObject params, boolean oauth) throws NCMBException
params
- parametersoauth
- use oauth or notNCMBException
protected void registerUserInBackground(org.json.JSONObject params, boolean oauth, LoginCallback callback) throws NCMBException
params
- parametersoauth
- use oauth or notcallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected void saveUserInBackground(org.json.JSONObject params, DoneCallback callback) throws NCMBException
params
- parameterscallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams getUserParams(java.lang.String userId) throws NCMBException
userId
- user idNCMBException
- exception from NIFCLOUD mobile backendprotected void getUserCheckResponse(NCMBResponse response) throws NCMBException
response
- response to get user entityNCMBException
- exception from NIFCLOUD mobile backendpublic NCMBUser fetchUser(java.lang.String userId) throws NCMBException
userId
- user idNCMBException
- exception from NIFCLOUD mobile backendpublic void fetchUserInBackground(java.lang.String userId, FetchCallback callback) throws NCMBException
userId
- user idcallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams updateUserParams(java.lang.String userId, org.json.JSONObject params)
userId
- user idparams
- update valuesprotected void updateUserCheckResponse(NCMBResponse response) throws NCMBException
response
- response to update user informationNCMBException
- exception from NIFCLOUD mobile backendpublic org.json.JSONObject updateUser(java.lang.String userId, org.json.JSONObject params) throws NCMBException
userId
- user idparams
- update valuesNCMBException
- exception from NIFCLOUD mobile backendpublic void updateUserInBackground(java.lang.String userId, org.json.JSONObject params, ExecuteServiceCallback callback) throws NCMBException
userId
- user idparams
- update valuescallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams loginByNameParams(java.lang.String userName, java.lang.String password) throws NCMBException
userName
- user namepassword
- passwordNCMBException
- exception from NIFCLOUD mobile backendprotected void loginByNameCheckResponse(NCMBResponse response) throws NCMBException
response
- response to login by user nameNCMBException
- exception from NIFCLOUD mobile backendpublic NCMBUser loginByName(java.lang.String userName, java.lang.String password) throws NCMBException
userName
- user namepassword
- passwordNCMBException
- exception from NIFCLOUD mobile backendpublic void loginByNameInBackground(java.lang.String userName, java.lang.String password, LoginCallback callback) throws NCMBException
userName
- user namepassword
- passwordcallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams loginByMailParams(java.lang.String mailAddress, java.lang.String password) throws NCMBException
mailAddress
- mail addresspassword
- passwordNCMBException
- exception from NIFCLOUD mobile backendprotected void loginByMailCheckResponse(NCMBResponse response) throws NCMBException
response
- exception from NIFCLOUD mobile backendNCMBException
- exception from NIFCLOUD mobile backendpublic NCMBUser loginByMail(java.lang.String mailAddress, java.lang.String password) throws NCMBException
mailAddress
- mail addresspassword
- passwordNCMBException
- exception from NIFCLOUD mobile backendpublic void loginByMailInBackground(java.lang.String mailAddress, java.lang.String password, LoginCallback callback) throws NCMBException
mailAddress
- mail addresspassword
- passwordcallback
- callback when process finishedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBUser postLoginProcess(NCMBResponse response) throws NCMBException
response
- response objectNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams deleteUserParams(java.lang.String userId)
userId
- user idprotected void deleteUserCheckResponse(NCMBResponse response) throws NCMBException
response
- responkse to delete userNCMBException
- exception from NIFCLOUD mobile backendpublic void deleteUser(java.lang.String userId) throws NCMBException
userId
- user idNCMBException
- exception from NIFCLOUD mobile backendpublic void deleteUserInBackground(java.lang.String userId, ExecuteServiceCallback callback) throws NCMBException
userId
- user idcallback
- Callback is executed after delete userNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams logoutParams()
protected void logoutCheckResponse(NCMBResponse response) throws NCMBException
response
- response to logoutNCMBException
- exception from NIFCLOUD mobile backendpublic void logout() throws NCMBException
NCMBException
- exception from NIFCLOUD mobile backendpublic void logoutInBackground(DoneCallback callback) throws NCMBException
callback
- callback when logout completedNCMBException
- exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams searchUserParams(org.json.JSONObject conditions)
conditions
- search conditionsprotected void searchUserCheckResponse(NCMBResponse response) throws NCMBException
response
- response to search usersNCMBException
- exception from NIFCLOUD mobile backendprotected java.util.ArrayList<NCMBUser> searchUserPostProcess(org.json.JSONObject data) throws NCMBException
data
- response body in JSONObjectNCMBException
- exception from NIFCLOUD mobile backendpublic java.util.ArrayList<NCMBUser> searchUser(org.json.JSONObject conditions) throws NCMBException
conditions
- search conditions, if no condition set to nullNCMBException
- exception from NIFCLOUD mobile backendpublic void searchUserInBackground(org.json.JSONObject conditions, SearchUserCallback callback)
conditions
- search conditions, if no condition set to nullcallback
- callback when process finished