private Graph getOrCreatePermisionGraph() {
   try {
     return tcManager.getMGraph(permissionGraphName);
   } catch (NoSuchEntityException e) {
     return tcManager.createGraph(permissionGraphName);
   }
 }
Beispiel #2
0
 private LockableMGraph getDataGraph() {
   try {
     return tcm.getMGraph(DATA_GRAPH_URI);
   } catch (NoSuchEntityException e) {
     return tcm.createMGraph(DATA_GRAPH_URI);
   }
 }
 private Collection<String> getRequiredPermissionStrings(final IRI GraphUri, IRI property) {
   try {
     final Graph permissionMGraph = tcManager.getMGraph(permissionGraphName);
     Lock l = permissionMGraph.getLock().readLock();
     l.lock();
     try {
       Triple t = permissionMGraph.filter(GraphUri, property, null).next();
       BlankNodeOrIRI list = (BlankNodeOrIRI) t.getObject();
       LinkedList<String> result = new LinkedList<String>();
       readList(list, permissionMGraph, result);
       return result;
     } catch (NoSuchElementException e) {
       return new ArrayList<String>(0);
     } finally {
       l.unlock();
     }
   } catch (NoSuchEntityException e) {
     return new ArrayList<String>(0);
   }
 }