]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/Valuations.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / Valuations.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.layer0.adapter;
13
14 import org.simantics.db.ReadGraph;
15 import org.simantics.db.Resource;
16 import org.simantics.db.exception.DatabaseException;
17
18
19 /*
20  * A value address in Simantics e.g.
21  * 
22  *  http://www.mycompany.com/My_Project/My_Model/My_Experiment/Composite1/Component1/Property1
23  *  
24  *  can be divided into 3 distinct parts.
25  * 
26  *  The model part : http://www.mycompany.com/My_Project/My_Model/
27  *  The experiment part : My_Experiment/ 
28  *  The variable part : Composite1/Component1/Property1
29  * 
30  *  A resource which is part of the flattened structure of a model 
31  *  
32  *  - Can specify uniquely its model part but does not always 
33  *  - Does not specify the experiment part 
34  *  - Can uniquely specify some part of the variable part
35  *
36  *  A variable identity is specified by the model part and the structure part  
37  *
38  *   -http://www.mycompany.com/My_Project/My_Model/Composite1/Component1/Property1
39  *  
40  *  Use cases:
41  *  
42  *   -Browse valid variable identities for selected components (e.g. for selected element in diagram)
43  *   -Retrieve values for stored variable suffices (e.g. in monitors or expressions)
44  *  
45  *  
46  *  
47  */
48
49 public interface Valuations {
50
51         /*
52          * Produces a resource in the value space specified by the given identity prefix and the given experiment.
53          * 
54          * @param variableIdentityPrefix a prefix which is sufficient to uniquely identify the VariableSpace
55          * @param experiment a valid experiment in the model specified by the variable identity
56          * @return a resource in a value space
57          */
58         Resource getValue(ReadGraph graph, String variableIdentityPrefix, String valuation) throws DatabaseException;
59
60         /*
61          * Produces a resource in the value space specified by the given identity prefix and and suffix and the given experiment.
62          * 
63          * @param variableIdentityPrefix a prefix which is sufficient to uniquely identify the VariableSpace
64          * @param experiment a valid experiment in the model specified by the variable identity
65          * @return a resource in a value space
66          */
67         Resource getValue(ReadGraph graph, String variableIdentityPrefix, String valuation, String suffix) throws DatabaseException;   
68         
69 }