1 /*******************************************************************************
2 * Copyright (c) 2007, 2014 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
12 *******************************************************************************/
13 package org.simantics.modeling.rules;
15 import java.util.Collection;
17 import org.simantics.db.ReadGraph;
18 import org.simantics.db.Resource;
19 import org.simantics.db.WriteGraph;
20 import org.simantics.db.exception.DatabaseException;
21 import org.simantics.structural2.modelingRules.IConnectionPoint;
24 * Abstraction of diagram to configuration mapping.
25 * @author Hannu Niemistö
27 public interface IMapping {
28 IConnectionPoint mapConnectionPoint(ReadGraph g, IConnectionPoint cp) throws DatabaseException;
30 * @param g database access handle
31 * @param cp diagram connection point to map to configuration
32 * @param result the collection to add the discovered connection points to
33 * @return the amount of connection points added to the result
34 * @throws DatabaseException
37 int mapToConnectionPoints(ReadGraph g, IConnectionPoint cp, Collection<IConnectionPoint> result) throws DatabaseException;
38 Resource mapComponentType(ReadGraph g, Resource componentType) throws DatabaseException;
39 Resource mapConnection(ReadGraph g, Resource connection) throws DatabaseException;
40 Resource invMapConnection(WriteGraph g, Resource connection) throws DatabaseException;
41 Resource mapConnectionRelation(ReadGraph g, Resource relation) throws DatabaseException;
42 Resource mapComponent(ReadGraph g, Resource component) throws DatabaseException;