|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.access.AclEntrySet
AclEntrySet represents a collection of access control entries mapping
principals to permissions. The access control list entry set is used
for evaluating access rights.
Supported API: false
Extendable: false
Constructor Summary | |
|
AclEntrySet()
Constructs an empty AclEntrySet object. |
protected |
AclEntrySet(Object cachedEntries)
|
Method Summary | |
private boolean |
acquireReadLock()
|
private boolean |
acquireWriteLock()
|
protected boolean |
checkOwnerPermission(AccessPermission permission)
Given a permission, computes whether the permission is granted to the owner user ( WTPrincipalReference.OWNER ). |
protected boolean |
checkPermission(WTPrincipal principal,
AccessPermission permission)
Given a principal and a permission, computes whether the permission is granted to the principal. |
Object |
clone()
Creates and returns a copy of this object. |
private void |
deflate()
|
protected AclEntrySet |
duplicate()
Create a deep copy of this AclEntrySet. |
protected EnumeratorVector |
getEntries()
Returns entries representing the cached entry set Supported API: false |
protected long |
getNegativeMask(String classname,
Long id)
Returns the negative permission mask corresponding to the specified principal reference. |
protected long |
getOwnerPermissionMask()
Gets the permission mask for the owner user ( WTPrincipalReference.OWNER ). |
protected EnumeratorVector |
getPendingEntries()
Returns entries representing the pending entries. |
protected long |
getPendingMask(WTPrincipalReference principal_ref,
String owner)
Returns the permission mask for the pending entry with the specified principal and owner. |
protected Hashtable |
getPendingPositiveEntries()
Gets the value of the attribute: pendingPositiveEntries. |
protected long |
getPermissionMask(WTPrincipal principal)
Returns the mask representing the set of permissions associated with the principal. |
protected long |
getPositiveMask(String classname,
Long id)
Returns the positive permission mask corresponding to the specified principal reference. |
private WTPrincipalReference |
getPrincipalReference(String class_name,
Long id)
|
protected Hashtable |
getRolePermissions()
|
protected boolean |
hasPositiveMask(WTPrincipalReference principal_reference)
Returns true if positive entries exist explicitly for the specified principal. |
protected void |
inflate()
|
private void |
inflateOldVersion()
|
private void |
invalidateCache()
|
protected boolean |
isEmpty()
Tells if there is any entry in the set. |
private void |
mapEntries(HashMap cache,
EnumeratorVector entries,
boolean negative)
|
protected void |
mergeEntry(WTAclEntry entry,
boolean persisted)
Merges an entry into the set. |
protected void |
oldInflate(byte[] stream)
|
private void |
parseOldEntry(String entry_str)
|
private void |
parseValue(String value)
|
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(AclEntrySet thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
private void |
releaseReadLock()
|
private void |
releaseWriteLock()
|
protected void |
removeEntry(WTAclEntry entry,
boolean persisted)
Removes an entry from the set. |
protected void |
removeNegativeEntry(WTPrincipalReference principal_ref)
Removes the entry for the specified principal from the negative entries cache. |
protected void |
removePendingEntries(String owner)
Removes permissions and updates the cached entries for each pending entry with a matching owner key. |
protected void |
removePendingEntry(WTAclEntry entry)
Removes the pending entry and removes the entry for the principal from the positive entries cache. |
protected void |
removePendingPermissions(String owner,
long removeMask)
For each pending entry with matching owner key, set permissions to current permissionMask & ~removeMask and update cachedEntries. |
protected void |
removePositiveEntry(WTPrincipalReference principal_ref)
Removes the entry for the specified principal from the positive entries cache. |
protected void |
setEntry(WTAclEntry entry,
boolean persisted)
Sets an entry in the set. |
protected void |
setNegativeEntry(WTPrincipalReference principal_ref,
long permission_mask)
Sets the permission mask for the specified principal in the negative entries cache. |
protected void |
setPendingEntry(WTAclEntry entry)
Sets a pending entry and sets the permission mask for the principal in the positive entries cache. |
protected void |
setPendingPositiveEntries(Hashtable a_PendingPositiveEntries)
Sets the value of the attribute: pendingPositiveEntries. |
protected void |
setPositiveEntry(WTPrincipalReference principal_ref,
long permission_mask)
Sets the permission mask for the specified principal in the positive entries cache. |
private void |
showEntries(HashMap entries,
StringBuffer buf,
boolean negative)
|
String |
toString()
Produces a String representation of the entry set. |
protected void |
updateAdHocEntrySet()
Rebuilds postitiveEntries from pendingPositiveEntries for a non-persistent AdHocControlled object. |
protected void |
validate()
Validates that the entry set of a non-persistent AdHocControlled
object has been properly initialized. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private Object cachedEntries
private Hashtable pendingPositiveEntries
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static final Long ALL_ID
private static final Long OWNER_ID
private static final String WTPRINCIPALREF_CLASSNAME
private volatile boolean inflated
private HashMap negativeEntries
private HashMap positiveEntries
private boolean stale
private static final int cachedMasksSize
private int cachedMasksIndex
private volatile long[][] cachedMasks
private static final boolean VERBOSE
protected static final long VERSION_PRE_70_UID
protected static final short STREAM_VERSION
private static final byte[] OBJECT_STREAM_MAGIC
private static final String GROUP_TARGET_KEY
private static final String PROXYGROUP_TARGET_KEY
private static final String PROXYUSER_TARGET_KEY
private static final String ROLE_TARGET_KEY
private static final String USER_TARGET_KEY
private static final String GROUP_TARGET_TYPE
private static final String REF_TARGET_TYPE
private static final String USER_TARGET_TYPE
private static final String DELETED
Hashtable rolePermissions
private transient int readerCount
private transient int writerCount
Constructor Detail |
public AclEntrySet()
protected AclEntrySet(Object cachedEntries)
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(AclEntrySet thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
protected Hashtable getPendingPositiveEntries()
protected void setPendingPositiveEntries(Hashtable a_PendingPositiveEntries)
a_PendingPositiveEntries
- public Object clone()
public String toString()
protected boolean checkOwnerPermission(AccessPermission permission) throws WTException
WTPrincipalReference.OWNER
). If the permission
is granted it returns true, otherwise it returns false.
permission
-
WTException
protected boolean checkPermission(WTPrincipal principal, AccessPermission permission) throws WTException
principal
- permission
-
WTException
protected AclEntrySet duplicate() throws WTException
WTException
protected EnumeratorVector getEntries() throws WTException
WTException
protected long getNegativeMask(String classname, Long id)
classname
- id
-
protected long getOwnerPermissionMask() throws WTException
WTPrincipalReference.OWNER
).
WTException
protected EnumeratorVector getPendingEntries() throws WTException
WTException
protected long getPendingMask(WTPrincipalReference principal_ref, String owner)
principal_ref
- owner
-
protected long getPermissionMask(WTPrincipal principal) throws WTException
principal
-
WTException
protected long getPositiveMask(String classname, Long id)
classname
- id
-
protected boolean hasPositiveMask(WTPrincipalReference principal_reference) throws WTException
WTException
protected boolean isEmpty()
protected void mergeEntry(WTAclEntry entry, boolean persisted)
entry
- entry to merge into the entry setpersisted
- true if the entry is for a persisted objectprotected void removeEntry(WTAclEntry entry, boolean persisted)
entry
- entry to remove from the entry setpersisted
- true if the entry is for a persisted objectprotected void removeNegativeEntry(WTPrincipalReference principal_ref)
principal_ref
- principal reference for the entryprotected void removePendingEntries(String owner)
owner
- protected void removePendingEntry(WTAclEntry entry)
entry
- pending entryprotected void removePendingPermissions(String owner, long removeMask)
owner
- removeMask
- protected void removePositiveEntry(WTPrincipalReference principal_ref)
principal_ref
- principal reference for the entryprotected void setEntry(WTAclEntry entry, boolean persisted)
entry
- entry to add to the entry setpersisted
- true if the entry is for a persisted objectprotected void setNegativeEntry(WTPrincipalReference principal_ref, long permission_mask)
principal_ref
- principal reference for the entrypermission_mask
- permission mask for the entryprotected void setPendingEntry(WTAclEntry entry)
entry
- pending entryprotected void setPositiveEntry(WTPrincipalReference principal_ref, long permission_mask)
principal_ref
- principal reference for the entrypermission_mask
- permission mask for the entryprotected void updateAdHocEntrySet()
AdHocControlled
object.
protected void validate()
AdHocControlled
object has been properly initialized. This is to ensure that when
an object is duplicated, the entry set on the original object is not
used to determine permissions for the new object.
private void deflate() throws IOException
IOException
private WTPrincipalReference getPrincipalReference(String class_name, Long id) throws WTException
WTException
protected void inflate()
protected void oldInflate(byte[] stream)
private void mapEntries(HashMap cache, EnumeratorVector entries, boolean negative) throws WTException
WTException
private void showEntries(HashMap entries, StringBuffer buf, boolean negative)
private void inflateOldVersion()
private void parseValue(String value)
private void parseOldEntry(String entry_str)
protected Hashtable getRolePermissions()
private boolean acquireReadLock()
private void releaseReadLock()
private boolean acquireWriteLock()
private void releaseWriteLock()
private void invalidateCache()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |