public abstract class SecuredItemImpl extends Object implements SecuredItem
Security checks are performed at multiple locations. This implementation ensures that during a single operation the specific check is only evaluated once by caching the result.
SecuredItem.Util
Modifier and Type | Field and Description |
---|---|
static ThreadLocal<org.apache.commons.collections4.map.LRUMap<org.apache.jena.permissions.impl.SecuredItemImpl.CacheKey,Boolean>> |
CACHE |
static ThreadLocal<Integer> |
COUNT |
static int |
MAX_CACHE |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreate() |
boolean |
canCreate(FrontsTriple frontsTriple)
Return true if the fronted triple can be created.
|
boolean |
canCreate(Triple triple)
Return true if the triple can be created.
|
boolean |
canDelete() |
boolean |
canDelete(FrontsTriple frontsTriple)
Return true if the fronted triple can be deleted.
|
boolean |
canDelete(Triple triple)
Return true if the triple can be deleted.
|
boolean |
canRead() |
boolean |
canRead(FrontsTriple frontsTriple)
Return true if the fronted triple can be read.
|
boolean |
canRead(Triple triple)
Return true if the triple can be read.
|
boolean |
canUpdate() |
boolean |
canUpdate(FrontsTriple from,
FrontsTriple to)
Return true if the fronted triple can be updated.
|
boolean |
canUpdate(Triple f,
Triple t)
Return true if the triple can be updated.
|
static void |
decrementUse()
Decrement the number of instances of SecuredItem.
|
boolean |
equals(Object o) |
Object |
getBaseItem() |
String |
getModelIRI() |
Node |
getModelNode()
get the name of the model.
|
SecurityEvaluator |
getSecurityEvaluator()
The SecurityEvaluator implementation that is being used to determine
access.
|
int |
hashCode() |
static void |
incrementUse()
Increment the number of instances of SecuredItem.
|
boolean |
isEquivalent(SecuredItem securedItem)
Return true if this secured item is equivalent to another secured item.
|
String |
toString() |
public static int MAX_CACHE
public static final ThreadLocal<org.apache.commons.collections4.map.LRUMap<org.apache.jena.permissions.impl.SecuredItemImpl.CacheKey,Boolean>> CACHE
public static final ThreadLocal<Integer> COUNT
public static void decrementUse()
public static void incrementUse()
public String toString() throws AuthenticationRequiredException
toString
in class Object
AuthenticationRequiredException
public boolean canCreate() throws AuthenticationRequiredException
canCreate
in interface SecuredItem
AuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canCreate(Triple triple) throws AuthenticationRequiredException
SecuredItem
canCreate
in interface SecuredItem
triple
- The triple to checkAuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canCreate(FrontsTriple frontsTriple) throws AuthenticationRequiredException
SecuredItem
canCreate
in interface SecuredItem
frontsTriple
- The fronted triple to checkAuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canDelete() throws AuthenticationRequiredException
canDelete
in interface SecuredItem
AuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canDelete(Triple triple) throws AuthenticationRequiredException
SecuredItem
canDelete
in interface SecuredItem
triple
- The triple to checkAuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canDelete(FrontsTriple frontsTriple) throws AuthenticationRequiredException
SecuredItem
canDelete
in interface SecuredItem
frontsTriple
- The fronted triple to checkAuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canRead() throws AuthenticationRequiredException
canRead
in interface SecuredItem
AuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canRead(Triple triple) throws AuthenticationRequiredException
SecuredItem
canRead
in interface SecuredItem
triple
- The triple to checkAuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canRead(FrontsTriple frontsTriple) throws AuthenticationRequiredException
SecuredItem
canRead
in interface SecuredItem
frontsTriple
- The frontedtriple to checkAuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canUpdate() throws AuthenticationRequiredException
canUpdate
in interface SecuredItem
AuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canUpdate(Triple f, Triple t) throws AuthenticationRequiredException
SecuredItem
canUpdate
in interface SecuredItem
f
- The triple that will be changedt
- The resulting triple.AuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean canUpdate(FrontsTriple from, FrontsTriple to) throws AuthenticationRequiredException
SecuredItem
canUpdate
in interface SecuredItem
from
- The fronted triple that will be changedto
- The resulting fronted triple.AuthenticationRequiredException
- if user is not authenticated and is required to be.public boolean equals(Object o)
equals
in interface SecuredItem
equals
in class Object
public Object getBaseItem()
getBaseItem
in interface SecuredItem
public String getModelIRI()
getModelIRI
in interface SecuredItem
public Node getModelNode()
getModelNode
in interface SecuredItem
public SecurityEvaluator getSecurityEvaluator()
SecuredItem
getSecurityEvaluator
in interface SecuredItem
public boolean isEquivalent(SecuredItem securedItem)
SecuredItem
isEquivalent
in interface SecuredItem
securedItem
- the other secured item.Licensed under the Apache License, Version 2.0