com.kii.cloud.storage
Class KiiACL

java.lang.Object
  extended by com.kii.cloud.storage.KiiACL

public final class KiiACL
extends java.lang.Object

Provides ACL operation on KiiCloud.


Nested Class Summary
static interface KiiACL.Action
          Defines action of each entity.
static class KiiACL.BucketAction
          Defines action of bucket.
static class KiiACL.FileAction
          Defines action of file.
static class KiiACL.ObjectAction
          Defines action of object.
static class KiiACL.TopicAction
          Defines action of topic.
 
Method Summary
 java.util.Set<KiiACLEntry> listACLEntries()
          Get the current ACL This API access to server and fetch all list of User/Group and granted actions.
 int listACLEntries(KiiACLCallBack callback)
          Asynchronous call for listACLEntries()
Background task will be initiated to execute the task.
 void putACLEntry(KiiACLEntry entry)
          Add an ACL entry locally if it is not present.
 void removeACLEntry(KiiACLEntry entry)
          Remove an ACL entry locally if it is present.
 void save()
          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.
 int save(KiiACLCallBack callback)
          Asynchronous call for save().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

listACLEntries

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. (see ACLOperationException)

listACLEntries

public int listACLEntries(KiiACLCallBack callback)
Asynchronous call for listACLEntries()
Background task will be initiated to execute the task.
NOTE: This method should be executed in UI thread.

Parameters:
callBack - notifies event.
Returns:
id of this task. Can be used to cancel this operation by Kii.cancelTask(int)
Throws:
WrongThreadException - Thrown if this method is not executed in UI thread.

putACLEntry

public void putACLEntry(KiiACLEntry entry)
Add an ACL entry locally if it is not present. This API access does NOT to server and update the ACL immediately. Call save() to reflect the operation on Cloud. Multiple put operation can be done before call save(). save() will flush the all cached operation put/remove.

Parameters:
entry - KiiACLEntry of this operation. KiiACLEntry

removeACLEntry

public void removeACLEntry(KiiACLEntry entry)
Remove an ACL entry locally if it is present. This API access does NOT to server and update the ACL immediately. Call save() to reflect the operation on Cloud. Multiple put operation can be done before call save(). save() will flush the all cached operation put/remove.

Parameters:
entry - KiiACLEntry of this operation. KiiACLEntry

save

public void save()
          throws ACLOperationException
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.
NOTE: This API access to server. Should not be executed in UI/Main thread.

Throws:
ACLOperationException - Thrown if KiiCloud operation failed. (see ACLOperationException)
java.lang.IllegalStateException - Thrown if SDK not initialized, user not logged in or KiiObject/KiiFile already deleted or not refresh properly.
See Also:
save(KiiACLCallBack)

save

public int save(KiiACLCallBack callback)
Asynchronous call for save(). A background task will be initiated to execute the task.
NOTE: This method should be executed in UI thread.

Parameters:
callback - notifies events.
Returns:
unique ID which is used to cancel this task
Throws:
WrongThreadException - Thrown if this method is not executed in UI thread.
See Also:
Kii.cancelTask(int)