]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/ReadGraph.java
Multiple reader thread support for db client
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / ReadGraph.java
index bead66644ff103a67c6a3ad4db713457f068c2fd..36081c3a802276bd8ec81f7a974b9b9617d90958 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * Copyright (c) 2007, 2018 Association for Decentralized Information Management
  * in Industry THTH ry.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -12,6 +12,7 @@
 package org.simantics.db;
 
 import java.util.Collection;
+import java.util.Map;
 import java.util.Set;
 
 import org.simantics.databoard.accessor.Accessor;
@@ -36,7 +37,6 @@ import org.simantics.db.procedure.SyncMultiListener;
 import org.simantics.db.procedure.SyncMultiProcedure;
 import org.simantics.db.procedure.SyncProcedure;
 import org.simantics.db.procedure.SyncSetListener;
-import org.simantics.db.request.MultiRead;
 import org.simantics.db.request.Read;
 import org.simantics.scl.compiler.types.Type;
 
@@ -67,7 +67,7 @@ import org.simantics.scl.compiler.types.Type;
  * @see Statement
  * @noimplement
  */
-public interface ReadGraph extends AsyncReadGraph, RequestProcessor {
+public interface ReadGraph extends RequestProcessor {
 
     /**
      * 
@@ -108,6 +108,18 @@ public interface ReadGraph extends AsyncReadGraph, RequestProcessor {
      */
     Resource getPossibleResource(String uri) throws ResourceNotFoundException, ValidationException, ServiceException;
 
+    /**
+     * Computes a map of objects related to resource with L0.ConsistsOf that also contain a L0.HasName property
+     * 
+     * @param resource the resource
+     * @return the children
+     * @throws ValidationException if a resource could not be produced due to
+     *         invalid semantics
+     * @throws ServiceException on connection and database failures
+     * @see AsyncReadGraph#forResourceByURI
+     */
+    Map<String,Resource> getChildren(Resource resource) throws ValidationException, ServiceException;
+
     /**
      * Gets a builtin resource. For a list of builtin resources see TODO Wiki
      * 
@@ -1071,4 +1083,9 @@ public interface ReadGraph extends AsyncReadGraph, RequestProcessor {
     
     boolean setSynchronous(boolean value);
     boolean getSynchronous();
+
+    boolean isImmutable(Resource resource) throws DatabaseException;
+
+    int thread();
+
 }