org.apache.clerezza.rdf.core.access
Class SecuredMGraph

java.lang.Object
  extended by org.apache.clerezza.rdf.core.access.SecuredTripleCollection
      extended by org.apache.clerezza.rdf.core.access.SecuredMGraph
All Implemented Interfaces:
Iterable<Triple>, Collection<Triple>, LockableMGraph, MGraph, TripleCollection

public class SecuredMGraph
extends SecuredTripleCollection
implements LockableMGraph

A SecuredMGraph is a LockableMGraph that wraps a LockableMGraph checking each access for the rights on a the graph for which the uri is passed to the constructor.

Author:
mir

Constructor Summary
SecuredMGraph(LockableMGraph wrapped, UriRef name, TcAccessController tcAccessController)
           
 
Method Summary
 Graph getGraph()
          Returns the graph
 ReadWriteLock getLock()
          The lock provided by this methods allows to create read- and write-locks that span individual method calls.
 LockableMGraph getUnsecuredMGraph()
          Returns the wrapped LockableMGraph if the caller has all access rights.
 
Methods inherited from class org.apache.clerezza.rdf.core.access.SecuredTripleCollection
add, addAll, addGraphListener, addGraphListener, clear, contains, containsAll, filter, isEmpty, iterator, remove, removeAll, removeGraphListener, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.clerezza.rdf.core.MGraph
equals
 
Methods inherited from interface org.apache.clerezza.rdf.core.TripleCollection
addGraphListener, addGraphListener, filter, removeGraphListener
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

SecuredMGraph

public SecuredMGraph(LockableMGraph wrapped,
                     UriRef name,
                     TcAccessController tcAccessController)
Method Detail

getGraph

public Graph getGraph()
Description copied from interface: MGraph
Returns the graph

Specified by:
getGraph in interface MGraph
Returns:
graph

getLock

public ReadWriteLock getLock()
Description copied from interface: LockableMGraph
The lock provided by this methods allows to create read- and write-locks that span individual method calls. Having a read locks prevents other threads from writing to this MGraph, having a write-lock prevents other threads from reading and writing.

Specified by:
getLock in interface LockableMGraph
Returns:
the lock of this MGraph

getUnsecuredMGraph

public LockableMGraph getUnsecuredMGraph()
Returns the wrapped LockableMGraph if the caller has all access rights. If the caller has only the read access right, then a write-blocked LockableMGraph is returned. If the caller has neither the read nor the write access right then an AccessControlException is thrown.

Returns:
the wrapped LockableMGraph or a write-block LockableMGraph depending on the access rights of the caller.


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.