-package org.simantics.db.common.request;\r
-\r
-import java.util.Collection;\r
-import java.util.Collections;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.ResourceSet;\r
-import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.service.CollectionSupport;\r
-import org.simantics.layer0.Layer0;\r
-\r
-public class IndexRoots extends ResourceRead<Collection<Resource>> {\r
-\r
- public IndexRoots(Resource r) {\r
- super(r);\r
- }\r
-\r
- @Override\r
- public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {\r
- Layer0 L0 = Layer0.getInstance(graph);\r
- if (graph.isInstanceOf(resource, L0.IndexRoot))\r
- return Collections.singletonList(resource);\r
- CollectionSupport cs = graph.getService(CollectionSupport.class);\r
- ResourceSet types = cs.getResourceSet(graph, L0.IndexRoot);\r
- ResourceSetGraph rsg = graph.syncRequest(new DependentInstances3(resource), TransientCacheAsyncListener.<ResourceSetGraph>instance());\r
- return rsg.resolve(graph, types);\r
- }\r
-\r
+package org.simantics.db.common.request;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.ResourceSet;
+import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.service.CollectionSupport;
+import org.simantics.layer0.Layer0;
+
+public class IndexRoots extends ResourceRead<Collection<Resource>> {
+
+ public IndexRoots(Resource r) {
+ super(r);
+ }
+
+ @Override
+ public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(graph);
+ if (graph.isInstanceOf(resource, L0.IndexRoot))
+ return Collections.singletonList(resource);
+ CollectionSupport cs = graph.getService(CollectionSupport.class);
+ ResourceSet types = cs.getResourceSet(graph, L0.IndexRoot);
+ ResourceSetGraph rsg = graph.syncRequest(new DependentInstances3(resource), TransientCacheAsyncListener.<ResourceSetGraph>instance());
+ return rsg.resolve(graph, types);
+ }
+