class Search
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List |
bindings
list of bindings found for this resource
|
private int[] |
checkList
array of subject IDs associated with this search
|
private int |
handle
handle of this instance
|
private static int |
handles
handle generator
|
private java.lang.String |
instanceName
resource instance name
|
private int |
lastUsed
index of the last returned item from the array or -1 if never
|
private int |
mode
access mode AKA requested rights
|
Constructor and Description |
---|
Search(java.lang.String instance,
int mode,
int[] checkList,
AccessControlList[] acls)
Package private constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getHandle()
Gets the handle of this search.
|
(package private) java.lang.String |
getInstanceName()
Gets the resource instance name of this search.
|
(package private) int |
getMode()
Gets the resource access mode of this search.
|
(package private) Rights |
next()
Gets the next Rights object from the list of bindings.
|
private static int handles
private int handle
private java.lang.String instanceName
private int mode
private int[] checkList
private java.util.List bindings
private int lastUsed
Search(java.lang.String instance, int mode, int[] checkList, AccessControlList[] acls)
instance
- resource instance namemode
- resource access modecheckList
- array of subject IDs to open this search withacls
- array of ACLs to find the resource instanceint getHandle()
java.lang.String getInstanceName()
int getMode()
Rights next()
Search is done in the order of subject IDs in the check list. The next unchecked ID is selected and the whole list of bindings is searched for a matching subject ID. If no matching entry exists, the next subject ID from the check list is checked and so on until either a matching ID is found or the end of the check list is reached.
If a matching binding is found for an ID, its index is saved so that the next call would start the search from the next unchecked ID.
When determining if a binding matches the current subject, bindings with 'all-others' among their subjects (-2 subject ID) have lower priority then bindings with explicit checklist subject. If no explicit binding found, it will return the first binding with 'all-others' among its subjects.
Rights
object or null