Interface PermissionCache
Each instance represents one logical cache generation. For a resource-node ID, implementations maintain two
independent semantic slots: one for the permission of the resource node revision itself, and one for the
resource-based baseline permission of ordinary objects contained in that resource node or resource. Updating one
slot must not change the other. Permissions stored in the cache are non-null CDOPermission values;
null is reserved to indicate a cache miss.
Authorization may access a cache concurrently, so implementations must be thread-safe. An obsolete generation
may continue to receive calls from authorizations that already captured it, but its entries must not become visible
through a newer generation created by PermissionCache.Creator.
- Since:
- 4.13
- Author:
- Eike Stepper
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCreates independent logical cache generations for repository, user, and branch scopes. -
Method Summary
Modifier and TypeMethodDescriptionReturns the permission in the selected semantic slot, ornullwhen that slot is unknown.voidput(CDOID resourceNodeID, boolean resourceNode, CDOPermission permission) Stores a non-null permission in the selected semantic slot without changing the other slot for the same resource node ID.
-
Method Details
-
get
Returns the permission in the selected semantic slot, ornullwhen that slot is unknown.A returned
CDOPermission.NONEis a cache hit and must not be confused withnull, which means that no permission is cached for the slot.- Parameters:
resourceNodeID- the resource node identifying the cache entryresourceNode-trueto select the permission for the resource-node revision itself, orfalseto select the resource-based baseline used for ordinary objects in that resource- Returns:
- the cached permission, including
CDOPermission.NONE, ornullon a cache miss
-
put
Stores a non-null permission in the selected semantic slot without changing the other slot for the same resource node ID.- Parameters:
resourceNodeID- the resource node identifying the cache entryresourceNode-trueto select the permission for the resource-node revision itself, orfalseto select the resource-based baseline used for ordinary objects in that resourcepermission- the permission to store;nullis reserved for cache misses and is not a stored value
-