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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db.impl.query;
\r
14 import java.io.InputStream;
\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
22 public interface QuerySupport extends ResourceTranslator {
\r
24 Session getSession();
\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
31 boolean resume(ReadGraphImpl graph);
\r
32 void dirtyPrimitives();
\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
40 org.simantics.db.DirectStatements getStatements(ReadGraphImpl graph, final int subject, QueryProcessor processor, boolean ignoreVirtual);
\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
46 void requestCluster(ReadGraphImpl graph, long clusterId, Runnable r);
\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
52 int getBuiltin(String uri);
\r
54 @Deprecated // Use SerialisationSupport instead
\r
55 int getRandomAccessReference(String id) throws ResourceNotFoundException;
\r
58 void ceased(int thread);
\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
65 void exit(Throwable t);
\r