Package com.kii.cloud.storage
Class KiiACL
- java.lang.Object
 - 
- com.kii.cloud.storage.KiiACL
 
 
- 
public final class KiiACL extends java.lang.ObjectProvides ACL operation on KiiCloud. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceKiiACL.ActionDefines action of each entity.static classKiiACL.BucketActionDefines action of bucket.static classKiiACL.ObjectActionDefines action of object.static classKiiACL.TopicActionDefines action of topic. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<KiiACLEntry>listACLEntries()Get the current ACL This API access to server and fetch all list of User/Group and granted actions.intlistACLEntries(KiiACLCallBack callback)Asynchronous call forlistACLEntries()
Background task will be initiated to execute the task.voidputACLEntry(KiiACLEntry entry)Add an ACL entry locally if it is not present.voidremoveACLEntry(KiiACLEntry entry)Remove an ACL entry locally if it is present.voidsave()Save the ACL entry to the cloud.This API will update all the local entry to the cloud.
On finish it will flush the all entry cached by put/remove operation.intsave(KiiACLCallBack callback)Asynchronous call forsave(). 
 - 
 
- 
- 
Method Detail
- 
save
@WorkerThread public void save() throws ACLOperationExceptionSave the ACL entry to the cloud.This API will update all the local entry to the cloud.
On finish it will flush the all entry cached by put/remove operation.
NOTE: Subscribe or send message to topic is not supported forKiiAnonymousUser.ACLOperationException(which caused byBadRequestException) will be thrown when an ACL entry has been created withKiiAnonymousUserandTopicAction.
This API access to server. Should not be executed in UI/Main thread.- Throws:
 ACLOperationException- Thrown if KiiCloud operation failed. (seeACLOperationException)java.lang.IllegalStateException- Thrown if SDK not initialized, user not logged in or KiiObject already deleted or not refresh properly.- See Also:
 save(KiiACLCallBack)
 
- 
save
public int save(@NonNull KiiACLCallBack callback)Asynchronous call forsave(). A background task will be initiated to execute the task.- Parameters:
 callback- notifies events.- Returns:
 - unique ID which is used to cancel this task
 - See Also:
 Kii.cancelTask(int)
 
- 
putACLEntry
public void putACLEntry(@NonNull KiiACLEntry entry)Add an ACL entry locally if it is not present. This API access does NOT to server and update the ACL immediately. Callsave()to reflect the operation on Cloud. Multiple put operation can be done before callsave().save()will flush the all cached operation put/remove.- Parameters:
 entry- KiiACLEntry of this operation.KiiACLEntry
 
- 
removeACLEntry
public void removeACLEntry(@NonNull KiiACLEntry entry)Remove an ACL entry locally if it is present. This API access does NOT to server and update the ACL immediately. Callsave()to reflect the operation on Cloud. Multiple put operation can be done before callsave().save()will flush the all cached operation put/remove.- Parameters:
 entry- KiiACLEntry of this operation.KiiACLEntry
 
- 
listACLEntries
@WorkerThread @NonNull public java.util.Set<KiiACLEntry> listACLEntries() throws ACLOperationException
Get the current ACL This API access to server and fetch all list of User/Group and granted actions.
NOTE: This api access to server. Should not be executed in UI/Main thread.- Returns:
 - Set of KiiACLEntry. Returns empty set if no ACL entries found for the parent.
 - Throws:
 ACLOperationException- Thrown if KiiCloud operation failed. (seeACLOperationException)
 
- 
listACLEntries
public int listACLEntries(@NonNull KiiACLCallBack callback)Asynchronous call forlistACLEntries()
Background task will be initiated to execute the task.- Parameters:
 callBack- notifies event.- Returns:
 - id of this task. Can be used to cancel this operation by 
Kii.cancelTask(int) 
 
 - 
 
 -