Class SecuredRDFListImpl
java.lang.Object
org.apache.jena.permissions.impl.SecuredItemImpl
org.apache.jena.permissions.model.impl.SecuredRDFNodeImpl
org.apache.jena.permissions.model.impl.SecuredResourceImpl
org.apache.jena.permissions.model.impl.SecuredRDFListImpl
- All Implemented Interfaces:
FrontsNode
,SecuredRDFList
,SecuredRDFNode
,SecuredResource
,SecuredItem
,RDFList
,RDFNode
,Resource
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.rdf.model.RDFList
RDFList.ApplyFn, RDFList.ReduceFn
Nested classes/interfaces inherited from interface org.apache.jena.permissions.SecuredItem
SecuredItem.Util
-
Field Summary
Fields inherited from class org.apache.jena.permissions.impl.SecuredItemImpl
CACHE, COUNT, MAX_CACHE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
apply
(Set<SecurityEvaluator.Action> perms, RDFList.ApplyFn fn) Apply fn to all elements of the graph for which the user has the permissions.void
apply
(RDFList.ApplyFn fn) void
concatenate
(Iterator<? extends RDFNode> nodes) void
concatenate
(RDFList list) boolean
copy()
get
(int i) getHead()
static <T extends RDFList>
SecuredRDFListgetInstance
(SecuredModel securedModel, T rdfList) Get an instance of SecuredPropertyboolean
getTail()
int
int
boolean
isEmpty()
boolean
isValid()
iterator()
iterator
(Set<SecurityEvaluator.Action> constraints) Retrieve an iterator on the list for which the user has the specified permissions.<T> ExtendedIterator<T>
reduce
(Set<SecurityEvaluator.Action> requiredActions, RDFList.ReduceFn fn, Object initial) Execute a reduct function across the list.reduce
(RDFList.ReduceFn fn, Object initial) void
boolean
sameListAs
(RDFList list) void
setStrict
(boolean strict) int
size()
Methods inherited from class org.apache.jena.permissions.model.impl.SecuredResourceImpl
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, asLiteral, asResource, begin, canReadProperty, commit, getId, getInstance, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, visitWith
Methods inherited from class org.apache.jena.permissions.model.impl.SecuredRDFNodeImpl
as, asNode, canAs, equals, getInstance, getModel, hashCode, isAnon, isLiteral, isResource, isStmtResource, isURIResource
Methods inherited from class org.apache.jena.permissions.impl.SecuredItemImpl
canCreate, canCreate, canCreate, canDelete, canDelete, canDelete, canRead, canRead, canRead, canUpdate, canUpdate, canUpdate, decrementUse, getBaseItem, getModelIRI, getModelNode, getSecurityEvaluator, incrementUse, isEquivalent, toString
Methods inherited from interface org.apache.jena.graph.FrontsNode
asNode
Methods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, canAs, getModel, isAnon, isLiteral, isResource, isStmtResource, isURIResource, visitWith
Methods inherited from interface org.apache.jena.rdf.model.Resource
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
Methods inherited from interface org.apache.jena.permissions.SecuredItem
canCreate, canCreate, canCreate, canDelete, canDelete, canDelete, canRead, canRead, canRead, canUpdate, canUpdate, canUpdate, equals, getBaseItem, getModelIRI, getModelNode, getSecurityEvaluator, isEquivalent
-
Method Details
-
getInstance
Get an instance of SecuredProperty- Parameters:
securedModel
- the Secured Model to use.rdfList
- The rdfList to secure- Returns:
- The SecuredProperty
-
add
public void add(RDFNode value) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException - Specified by:
add
in interfaceRDFList
- Throws:
UpdateDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Create SecTriple(SecNode.FUTURE, RDF.first, value), Create SecTriple(SecNode.FUTURE, RDF.first, RDF.nil)
-
append
public RDFList append(Iterator<? extends RDFNode> nodes) throws ReadDeniedException, AuthenticationRequiredException - Specified by:
append
in interfaceRDFList
- Throws:
UpdateDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.ReadDeniedException
- Required graph permissions:
- Update
- Required triple permissions:
- Create SecTriple( SecNode.FUTURE, RDF.first, value ), Create SecTriple( SecNode.FUTURE, RDF.rest, this )
-
append
- Specified by:
append
in interfaceRDFList
- Throws:
UpdateDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.ReadDeniedException
- Required graph permissions:
- Update
- Required triple permissions:
- Create SecTriple( SecNode.FUTURE, RDF.first, value ), Create SecTriple( SecNode.FUTURE, RDF.rest, this )
-
apply
- Specified by:
apply
in interfaceRDFList
- Throws:
ReadDeniedException
- graph Read or other permissions are not metAuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then the function is not applied to any list items., Read - Required triple permissions:
- Read (to be included in the calculation), other permissions required by the function.
-
apply
public void apply(Set<SecurityEvaluator.Action> perms, RDFList.ApplyFn fn) throws ReadDeniedException, AuthenticationRequiredException Description copied from interface:SecuredRDFList
Apply fn to all elements of the graph for which the user has the permissions.- Specified by:
apply
in interfaceSecuredRDFList
- Parameters:
perms
- The permissions the user must have on the items in the list.fn
- The function to apply.- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then the function will not be applied to any of the elements. - Required triple permissions:
- Read and constraints
-
asJavaList
- Specified by:
asJavaList
in interfaceRDFList
- Returns:
- List<SecuredRDFNode>
- Throws:
AuthenticationRequiredException
- if user is not authenticated and is required to be.ReadDeniedException
- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then an empty list is returned. - Required triple permissions:
- Read for triples containing the returned RDFNodes.
-
concatenate
public void concatenate(Iterator<? extends RDFNode> nodes) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException - Specified by:
concatenate
in interfaceRDFList
- Throws:
UpdateDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Create SecTriple( SecNode.FUTURE, RDF.first, node ) for each node in nodes.
-
concatenate
public void concatenate(RDFList list) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException - Specified by:
concatenate
in interfaceRDFList
- Throws:
UpdateDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Create SecTriple( SecNode.FUTURE, RDF.first, node ) for each node in nodes.
-
cons
public SecuredRDFList cons(RDFNode value) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException - Specified by:
cons
in interfaceRDFList
- Throws:
UpdateDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Create SecTriple( SecNode.FUTURE, RDF.first, value ), Create SecTriple( SecNode.FUTURE, RDF.rest, this )
-
contains
- Specified by:
contains
in interfaceRDFList
- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access thenfalse
is returned. - Required triple permissions:
- Read for triple containing value.
-
copy
- Specified by:
copy
in interfaceRDFList
- Throws:
ReadDeniedException
AddDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then an empty list is returned., Update - Required triple permissions:
- Read on each triple to be read., Create SecTriple( SecNode.FUTURE, RDF.first, value ), Create SecTriple( SecNode.FUTURE, RDF.rest, this )
-
get
- Specified by:
get
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then aListIndexException
is thrown. The indexing of the underlying list may be shifted by permission constraints.
-
getHead
- Specified by:
getHead
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then aListIndexException
is thrown. The head may be shifted from the underlying list by permission constraints. - Required triple permissions:
- Read for triple containing value.
-
getStrict
public boolean getStrict() -
getTail
- Specified by:
getTail
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then aListIndexException
is thrown. The tail may be shifted from the underlying list by permission constraints. - Required triple permissions:
- Read for triple containing value.
-
getValidityErrorMessage
- Specified by:
getValidityErrorMessage
in interfaceRDFList
- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read- if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then null is returned.
-
indexOf
- Specified by:
indexOf
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then -1 is returned. - Required triple permissions:
- Read for triple containing value.
-
indexOf
public int indexOf(RDFNode value, int start) throws ReadDeniedException, AuthenticationRequiredException - Specified by:
indexOf
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then -1 is returned - Required triple permissions:
- Read for triple containing value.
-
isEmpty
- Specified by:
isEmpty
in interfaceRDFList
- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access thentrue
is returned.
-
isValid
- Specified by:
isValid
in interfaceRDFList
- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read
-
iterator
public ExtendedIterator<RDFNode> iterator() throws ReadDeniedException, AuthenticationRequiredException- Specified by:
iterator
in interfaceRDFList
- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then an empty iterator is returned. - Required triple permissions:
- Read for triple containing value to be included in the result.
-
iterator
public ExtendedIterator<RDFNode> iterator(Set<SecurityEvaluator.Action> constraints) throws ReadDeniedException, AuthenticationRequiredException Description copied from interface:SecuredRDFList
Retrieve an iterator on the list for which the user has the specified permissions.- Specified by:
iterator
in interfaceSecuredRDFList
- Parameters:
constraints
- the permissions required for the user to access the node.- Returns:
- an iterator on the items.
- Throws:
ReadDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then an empty iterator is returned. - Required triple permissions:
- Read for triple containing value to be included in the result.
-
mapWith
public <T> ExtendedIterator<T> mapWith(Function<RDFNode, T> fn) throws ReadDeniedException, AuthenticationRequiredException- Specified by:
mapWith
in interfaceRDFList
- Throws:
ReadDeniedException
AuthenticationRequiredException
-
reduce
public Object reduce(RDFList.ReduceFn fn, Object initial) throws ReadDeniedException, AuthenticationRequiredException - Specified by:
reduce
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - Only readable triples will be passed to the function. if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then no items will be passed to the function.. - Required triple permissions:
- Read for triple containing value to be included in the result., Read for triple containing value.
-
reduce
public Object reduce(Set<SecurityEvaluator.Action> requiredActions, RDFList.ReduceFn fn, Object initial) throws EmptyListException, ListIndexException, InvalidListException, ReadDeniedException, AuthenticationRequiredException Description copied from interface:SecuredRDFList
Execute a reduct function across the list.- Specified by:
reduce
in interfaceSecuredRDFList
- Parameters:
requiredActions
- the permission set required to execute the reduce.fn
- the reduction function.initial
- the initial accumulation value.- Returns:
- the accumulator after execution.
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - Only readable triples will be passed to the function. if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then no items will be passed to the function. - Required triple permissions:
- Read for triple containing value to be included in the result., Read for triple containing value.
-
remove
public RDFList remove(RDFNode val) throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException - Specified by:
remove
in interfaceRDFList
- Throws:
UpdateDeniedException
DeleteDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Delete for triple containing value.
-
removeHead
public SecuredRDFList removeHead() throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException- Specified by:
removeHead
in interfaceRDFList
- Throws:
UpdateDeniedException
DeleteDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Delete for the head triple.
-
removeList
- Specified by:
removeList
in interfaceRDFList
- Throws:
UpdateDeniedException
DeleteDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Delete for triple containing value.
-
replace
public SecuredRDFNode replace(int i, RDFNode value) throws UpdateDeniedException, AuthenticationRequiredException, ListIndexException - Specified by:
replace
in interfaceRDFList
- Throws:
UpdateDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Update for triple i, and value.
-
sameListAs
- Specified by:
sameListAs
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then the the lists will be the same if the list parameter is an empty list. - Required triple permissions:
- Read for triples included in the comparison.
-
setHead
public SecuredRDFNode setHead(RDFNode value) throws EmptyListException, AuthenticationRequiredException - Specified by:
setHead
in interfaceRDFList
- Throws:
UpdateDeniedException
DeleteDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
- Required triple permissions:
- Create for triple containing value.
-
setStrict
- Specified by:
setStrict
in interfaceRDFList
- Throws:
UpdateDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Update
-
setTail
public SecuredRDFList setTail(RDFList tail) throws UpdateDeniedException, AuthenticationRequiredException - Specified by:
setTail
in interfaceRDFList
- Throws:
UpdateDeniedException
AuthenticationRequiredException
-
size
- Specified by:
size
in interfaceRDFList
- Throws:
ReadDeniedException
EmptyListException
ListIndexException
InvalidListException
AuthenticationRequiredException
- if user is not authenticated and is required to be.- Required graph permissions:
- Read - if
SecurityEvaluator.isHardReadError()
is true and the user does not have read access then zero (0) will be returned. - Required triple permissions:
- Read for triples counted in the result.
-
with
public SecuredRDFList with(RDFNode value) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException - Specified by:
with
in interfaceRDFList
- Throws:
UpdateDeniedException
DeleteDeniedException
AuthenticationRequiredException
- if user is not authenticated and is required to be.AddDeniedException
- Required graph permissions:
- Update
- Required triple permissions:
- Create for triple containing value.
-