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