com.plumtree.remote.prc
Interface IACL


public interface IACL

Represents an Access Control List that specifies which groups and users can access this object. Note that adding a non-existent user or group ID will succeed until the ACL has been applied via the ObjectManager/DocumentManager update(int, IACL) method, whereby the IACL instance will have all its contained entries refreshed.


Method Summary
 IACLEntry addUserEntry(int userID, AccessLevel accessLevel)
          Adds a user entry to this ACL
 IACLEntry addUserGroupEntry(int groupID, AccessLevel accessLevel)
          Adds a group entry to this ACL
 boolean contains(IACLEntry entry)
          Determines whether a specific ACLEntry is contained in this ACL.
 IACLEntry[] entries()
          All ACLEntry's contained within this ACL
 IACLEntry getUserEntry(int userID)
          Gets a user entry contained in this ACL
 IACLEntry getUserGroupEntry(int groupID)
          Gets a group entry contained in this ACL
 IACLEntry removeEntry(IACLEntry aclEntry)
          Removes an entry from the ACL, if present.
 IACLEntry removeUserEntry(int userID)
          Removes a user entry from the ACL (ignored if no entry is present)
 IACLEntry removeUserGroupEntry(int groupID)
          Removes a user entry from the ACL (ignored if no entry is present)
 

Method Detail

entries

public IACLEntry[] entries()
All ACLEntry's contained within this ACL

Returns:
all contained entries

addUserEntry

public IACLEntry addUserEntry(int userID,
                              AccessLevel accessLevel)
Adds a user entry to this ACL

Parameters:
userID - the user ID of the user to add
accessLevel - the access level to grant
Returns:
the previous ACLEntry specified for this user, null if there was no previous entry
Throws:
ACLEntryReadOnlyException - if the user already has a read-only entry set
java.lang.IllegalArgumentException - if passed an invalid user ID

addUserGroupEntry

public IACLEntry addUserGroupEntry(int groupID,
                                   AccessLevel accessLevel)
Adds a group entry to this ACL

Parameters:
groupID - the group ID of the group to add
accessLevel - the access level to grant
Returns:
the previous ACLEntry specified for this group, null if there was no previous entry
Throws:
ACLEntryReadOnlyException - if the group already has a read-only entry set
java.lang.IllegalArgumentException - if passed an invalid group ID

removeEntry

public IACLEntry removeEntry(IACLEntry aclEntry)
Removes an entry from the ACL, if present. Note that an ACLEntry will only be removed if it is present in full; i.e. the access level is equal as well as both the principal ID & class.

Parameters:
aclEntry - the entry to remove
Returns:
the removed ACLEntry, null if no entry was removed
Throws:
ACLEntryReadOnlyException - if the entry contained is read-only

removeUserEntry

public IACLEntry removeUserEntry(int userID)
Removes a user entry from the ACL (ignored if no entry is present)

Parameters:
userID - the user ID of the user to remove
Returns:
the removed ACLEntry, null if no entry was removed
Throws:
ACLEntryReadOnlyException - if the entry is present and read-only
java.lang.IllegalArgumentException - if passed an invalid user ID

removeUserGroupEntry

public IACLEntry removeUserGroupEntry(int groupID)
Removes a user entry from the ACL (ignored if no entry is present)

Parameters:
groupID - the group ID of the group to remove
Returns:
the removed ACLEntry, null if no entry was removed
Throws:
ACLEntryReadOnlyException - if the entry is present and read-only
java.lang.IllegalArgumentException - if passed an invalid group ID

getUserEntry

public IACLEntry getUserEntry(int userID)
Gets a user entry contained in this ACL

Parameters:
userID - the user ID of the user of which to retrieve the entry for
Returns:
the users entry
Throws:
java.lang.IllegalArgumentException - if passed an invalid user ID

getUserGroupEntry

public IACLEntry getUserGroupEntry(int groupID)
Gets a group entry contained in this ACL

Parameters:
groupID - the group ID of the group of which to retrieve the entry for
Returns:
the group's entry
Throws:
java.lang.IllegalArgumentException - if passed an invalid group ID

contains

public boolean contains(IACLEntry entry)
Determines whether a specific ACLEntry is contained in this ACL. If an entry with a non-existent ID is added then contains will return true for the added entry until the ACL is saved whence all invalid entries will be removed.

Parameters:
entry - the entry to query for; cannot be null.
Returns:
true if and only if this entry is contained in the ACL
Throws:
java.lang.NullPointerException - if passed a null ACLEntry.


For additional information on the IDK, including tutorials, blogs, code samples and more,see the AquaLogic User Interaction Developer Center on BEA dev2dev.

Copyright ©2007 BEA Systems, Inc. All Rights Reserved.