]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db/src/org/simantics/db/service/SerialisationSupport.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / service / SerialisationSupport.java
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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.service;\r
13 \r
14 import org.simantics.db.Resource;\r
15 import org.simantics.db.ResourceSerializer;\r
16 import org.simantics.db.exception.DatabaseException;\r
17 \r
18 public interface SerialisationSupport {\r
19 \r
20     /**\r
21      * Get a ResourceSerializer for this session which can be used to\r
22      * serialize Resource instances to string and back.\r
23      */\r
24     ResourceSerializer getResourceSerializer();\r
25 \r
26     Resource getResource(long randomAccessId) throws DatabaseException;\r
27     Resource getResource(int transientId) throws DatabaseException;\r
28     \r
29     int getTransientId(Resource resource) throws DatabaseException;\r
30     long getRandomAccessId(Resource resource) throws DatabaseException;\r
31     \r
32     int getTransientId(long randomAccessId) throws DatabaseException;\r
33     long getRandomAccessId(int transientId) throws DatabaseException;\r
34     \r
35     ResourceUID getUID(Resource resource) throws DatabaseException;\r
36     Resource getResource(ResourceUID uid) throws DatabaseException;\r
37         \r
38 }\r