public class NCMBRoleService extends NCMBService
NCMBService.RequestParams| Modifier and Type | Field and Description |
|---|---|
static int |
HTTP_STATUS_ROLE_CREATED
Status code of role created
|
static int |
HTTP_STATUS_ROLE_DELETED
Status code of role deleted
|
static int |
HTTP_STATUS_ROLE_UPDATED
Status code of role created
|
static java.lang.String |
SERVICE_PATH
service path for API category
|
mContext, mServicePath| Modifier and Type | Method and Description |
|---|---|
org.json.JSONObject |
addRoleRelations(java.lang.String roleId,
java.util.List<NCMBRole> roles)
Add roles to role
|
void |
addRoleRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBRole> roles,
ExecuteServiceCallback callback)
Add roles to role in background
|
org.json.JSONObject |
addUserRelations(java.lang.String roleId,
java.util.List<NCMBUser> users)
Add users to role
|
void |
addUserRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBUser> users,
ExecuteServiceCallback callback)
Add users to role in background
|
org.json.JSONObject |
createRole(java.lang.String roleName)
Create role with given name
|
protected void |
createRoleCheckResponse(NCMBResponse response)
Check response to create role with gevin name
|
void |
createRoleInBackground(java.lang.String roleName,
ExecuteServiceCallback callback)
Create role with gevin name in background
|
protected NCMBService.RequestParams |
createRoleParams(java.lang.String roleName)
Setup params to create role with gevin name
|
void |
deleteRole(java.lang.String roleId)
Delete role
|
protected void |
deleteRoleCheckResponse(NCMBResponse response)
Check response to delete role
|
void |
deleteRoleInBackground(java.lang.String roleId,
DoneCallback callback)
Delete role in background
|
protected NCMBService.RequestParams |
deleteRoleParams(java.lang.String roleId)
Setup params to delete role
|
NCMBRole |
fetchRole(java.lang.String roleId)
Get role information
|
void |
fetchRoleInBackground(java.lang.String objectId,
FetchCallback callback)
Get role information in background
|
java.util.ArrayList<java.lang.String> |
findBelongUser(java.lang.String roleId)
Get belong users with gevin role id
|
protected void |
getRoleCheckResponse(NCMBResponse response)
Check response to get role information
|
NCMBService.RequestParams |
getRoleParams(java.lang.String roleId)
Setup params to get role information
|
protected org.json.JSONObject |
relationQueryJson(java.lang.String type,
java.lang.String roleId)
Build relation query as JSONObject
|
org.json.JSONObject |
removeRoleRelations(java.lang.String roleId,
java.util.List<NCMBRole> roles)
Remove roles to role
|
void |
removeRoleRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBRole> roles,
ExecuteServiceCallback callback)
Remove roles to role in background
|
org.json.JSONObject |
removeUserRelations(java.lang.String roleId,
java.util.List<NCMBUser> users)
Remove users to role
|
void |
removeUserRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBUser> users,
ExecuteServiceCallback callback)
Remove users to role in background
|
protected NCMBService.RequestParams |
roleRelationParams(java.lang.String roleId,
java.util.List<NCMBRole> roles,
boolean isAdd)
Setup params to add or remove roles to role
|
java.util.ArrayList<NCMBRole> |
searchRole(org.json.JSONObject conditions)
Search role synchronously
|
void |
searchRoleInBackground(org.json.JSONObject conditions,
SearchRoleCallback callback)
Search role asynchronously
|
protected void |
setAclCheckResponse(NCMBResponse response)
Check response to set ACL to role
|
protected NCMBService.RequestParams |
setAclParams(java.lang.String roleId,
NCMBAcl acl)
Setup params to set ACL to role
|
void |
updateAcl(java.lang.String roleId,
NCMBAcl acl)
Update ACL to role
|
void |
updateAclInBackground(java.lang.String roleId,
NCMBAcl acl,
DoneCallback callback)
Update ACL to role in background
|
protected void |
updateRoleCheckResponse(NCMBResponse response)
Check response to update role
|
protected NCMBService.RequestParams |
userRelationsParams(java.lang.String roleId,
java.util.List<NCMBUser> users,
boolean isAdd)
Setup params to add or remove users to role
|
sendRequest, sendRequest, sendRequest, sendRequest, sendRequestAsync, sendRequestAsync, sendRequestFile, sendRequestFileAsyncpublic static final java.lang.String SERVICE_PATH
public static final int HTTP_STATUS_ROLE_CREATED
public static final int HTTP_STATUS_ROLE_UPDATED
public static final int HTTP_STATUS_ROLE_DELETED
protected NCMBService.RequestParams createRoleParams(java.lang.String roleName) throws NCMBException
roleName - role nameNCMBException - exception from NIFCLOUD mobile backendprotected void createRoleCheckResponse(NCMBResponse response) throws NCMBException
response - response to create role with gevin nameNCMBException - exception from NIFCLOUD mobile backendpublic org.json.JSONObject createRole(java.lang.String roleName)
throws NCMBException
roleName - role nameNCMBException - exception from NIFCLOUD mobile backendpublic void createRoleInBackground(java.lang.String roleName,
ExecuteServiceCallback callback)
throws NCMBException
roleName - role namecallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams deleteRoleParams(java.lang.String roleId) throws NCMBException
roleId - object id for roleNCMBException - exception from NIFCLOUD mobile backendprotected void deleteRoleCheckResponse(NCMBResponse response) throws NCMBException
response - response to delete roleNCMBException - exception from NIFCLOUD mobile backendpublic void deleteRole(java.lang.String roleId)
throws NCMBException
roleId - object id of roleNCMBException - exception from NIFCLOUD mobile backendpublic void deleteRoleInBackground(java.lang.String roleId,
DoneCallback callback)
throws NCMBException
roleId - object id of rolecallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendpublic NCMBService.RequestParams getRoleParams(java.lang.String roleId) throws NCMBException
roleId - role idNCMBException - exception from NIFCLOUD mobile backendprotected void getRoleCheckResponse(NCMBResponse response) throws NCMBException
response - response to get role informationNCMBException - exception from NIFCLOUD mobile backendpublic NCMBRole fetchRole(java.lang.String roleId) throws NCMBException
roleId - role idNCMBException - exception from NIFCLOUD mobile backendpublic void fetchRoleInBackground(java.lang.String objectId,
FetchCallback callback)
throws NCMBException
objectId - objectId of rolecallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendpublic java.util.ArrayList<NCMBRole> searchRole(org.json.JSONObject conditions) throws NCMBException
conditions - conditions for role searchNCMBException - exception from NIFCLOUD mobile backendpublic void searchRoleInBackground(org.json.JSONObject conditions,
SearchRoleCallback callback)
conditions - conditions for role searchcallback - Callback is executed after search roleprotected org.json.JSONObject relationQueryJson(java.lang.String type,
java.lang.String roleId)
throws org.json.JSONException
type - "user" or "role"roleId - role idorg.json.JSONException - exception from JSONObjectpublic java.util.ArrayList<java.lang.String> findBelongUser(java.lang.String roleId)
throws NCMBException
roleId - role idNCMBException - exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams userRelationsParams(java.lang.String roleId, java.util.List<NCMBUser> users, boolean isAdd) throws NCMBException
roleId - role idusers - users added or removedisAdd - add or remove usersNCMBException - exception from NIFCLOUD mobile backendprotected void updateRoleCheckResponse(NCMBResponse response) throws NCMBException
response - response to update roleNCMBException - exception from NIFCLOUD mobile backendpublic org.json.JSONObject addUserRelations(java.lang.String roleId,
java.util.List<NCMBUser> users)
throws NCMBException
roleId - role idusers - users addedNCMBException - exception from NIFCLOUD mobile backendpublic void addUserRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBUser> users,
ExecuteServiceCallback callback)
throws NCMBException
roleId - role idusers - users addedcallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendpublic org.json.JSONObject removeUserRelations(java.lang.String roleId,
java.util.List<NCMBUser> users)
throws NCMBException
roleId - role idusers - users removedNCMBException - exception from NIFCLOUD mobile backendpublic void removeUserRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBUser> users,
ExecuteServiceCallback callback)
throws NCMBException
roleId - role idusers - users removedcallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams roleRelationParams(java.lang.String roleId, java.util.List<NCMBRole> roles, boolean isAdd) throws NCMBException
roleId - role idroles - roles added or removedisAdd - to add or remove relationNCMBException - exception from NIFCLOUD mobile backendpublic org.json.JSONObject addRoleRelations(java.lang.String roleId,
java.util.List<NCMBRole> roles)
throws NCMBException
roleId - role idroles - roles addedNCMBException - exception from NIFCLOUD mobile backendpublic void addRoleRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBRole> roles,
ExecuteServiceCallback callback)
throws NCMBException
roleId - role idroles - roles addedcallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendpublic org.json.JSONObject removeRoleRelations(java.lang.String roleId,
java.util.List<NCMBRole> roles)
throws NCMBException
roleId - role idroles - roles removedNCMBException - exception from NIFCLOUD mobile backendpublic void removeRoleRelationsInBackground(java.lang.String roleId,
java.util.List<NCMBRole> roles,
ExecuteServiceCallback callback)
throws NCMBException
roleId - role idroles - roles removedcallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backendprotected NCMBService.RequestParams setAclParams(java.lang.String roleId, NCMBAcl acl) throws NCMBException
roleId - role idacl - Assiend ACLNCMBException - exception from NIFCLOUD mobile backendprotected void setAclCheckResponse(NCMBResponse response) throws NCMBException
response - response to set ACL to roleNCMBException - exception from NIFCLOUD mobile backendpublic void updateAcl(java.lang.String roleId,
NCMBAcl acl)
throws NCMBException
roleId - role idacl - Assigned ACLNCMBException - exception from NIFCLOUD mobile backendpublic void updateAclInBackground(java.lang.String roleId,
NCMBAcl acl,
DoneCallback callback)
throws NCMBException
roleId - role idacl - Assigned ACLcallback - callback when process finishedNCMBException - exception from NIFCLOUD mobile backend