]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QuerySupport.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / QuerySupport.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.impl.query;\r
13 \r
14 import java.io.InputStream;\r
15 \r
16 import org.simantics.db.Resource;\r
17 import org.simantics.db.Session;\r
18 import org.simantics.db.VirtualGraph;\r
19 import org.simantics.db.exception.ResourceNotFoundException;\r
20 import org.simantics.db.impl.graph.ReadGraphImpl;\r
21 \r
22 public interface QuerySupport extends ResourceTranslator {\r
23 \r
24         Session getSession();\r
25         \r
26         boolean isImmutable(int id);\r
27         long getClusterId(int id);\r
28         int getId(Resource resource);\r
29         Resource getResource(int id);\r
30         \r
31     boolean resume(ReadGraphImpl graph);\r
32         void dirtyPrimitives();\r
33         void aboutToRead();\r
34         \r
35         int getSingleInstance(int subject);\r
36         int getSingleSuperrelation(int subject);\r
37         int getFunctionalObject(int subject, int predicate);\r
38         boolean getObjects(ReadGraphImpl graph, int subject, int predicate, IntProcedure procedure);\r
39     \r
40         org.simantics.db.DirectStatements getStatements(ReadGraphImpl graph, final int subject, QueryProcessor processor, boolean ignoreVirtual);\r
41     \r
42     void getPredicates(ReadGraphImpl graph, int subject, IntProcedure procedure);\r
43     byte[] getValue(ReadGraphImpl graph, int resource);\r
44     InputStream getValueStream(ReadGraphImpl graph, int resource);\r
45     \r
46     void requestCluster(ReadGraphImpl graph, long clusterId, Runnable r);\r
47     \r
48     void ensureLoaded(final ReadGraphImpl graph, final int subject, final int predicate);\r
49     void ensureLoaded(final ReadGraphImpl graph, final int subject);\r
50     boolean isLoaded(int subject);\r
51     \r
52         int getBuiltin(String uri);\r
53 \r
54         @Deprecated // Use SerialisationSupport instead\r
55         int getRandomAccessReference(String id) throws ResourceNotFoundException;\r
56 \r
57     void checkTasks();\r
58     void ceased(int thread);\r
59     Object getLock();\r
60     \r
61     VirtualGraph getProvider(int subject, int predicate, int object);\r
62     VirtualGraph getProvider(int subject, int predicate);\r
63     VirtualGraph getValueProvider(int subject);\r
64     \r
65     void exit(Throwable t);\r
66     \r
67 }\r