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;
\r
14 import org.simantics.databoard.binding.Binding;
\r
15 import org.simantics.db.request.Write;
\r
16 import org.simantics.db.request.WriteOnly;
\r
19 * An interface that VirtualGraphSource can use to manipulate the transient virtual graph.
\r
21 * @author Antti Villberg
\r
23 public interface VirtualGraphContext {
\r
26 * Creates a new transient resource.
\r
29 int newResource(boolean lazy);
\r
31 void finish(int resource);
\r
34 * Converts a transient or persistent resource to an integer id.
\r
38 int getIndex(Resource resource);
\r
40 * Converts an integer id to a resource.
\r
44 Resource getResource(int index);
\r
46 void initialise(Write write);
\r
47 void postModification(AsyncRequestProcessor processor, WriteOnly request);
\r
49 * Updates previously given result to getStatements.
\r
53 void updateStatements(int resource, int[] statements);
\r
55 * Updates previously given result to getValue.
\r
60 void updateValue(int resource, Object value, Binding binding);
\r
62 // * Makes a request to persistent graph in getStatements of getValue
\r
63 // * and updates the results.
\r
66 // * @param procedure
\r
68 // <T> void pending(AsyncRead<T> read, Procedure<T> procedure);
\r