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