-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db;\r
-\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.InvalidResourceReferenceException;\r
-import org.simantics.db.service.SerialisationSupport;\r
-\r
-/**\r
- * @deprecated use {@link SerialisationSupport} instead\r
- */\r
-@Deprecated\r
-public interface ResourceSerializer {\r
-\r
- /**\r
- * Allocates and returns an identifier that can be stored persistently over\r
- * time in a client and the database will be able to give you the\r
- * corresponding Resource at a later time, until all statements of the\r
- * resource are removed or the identifier is released by\r
- * {@link #releaseRandomAccessForResource(String)}.\r
- * \r
- * <p>\r
- * If random access is requested multiple times for a particular resource,\r
- * the allocated ID's should be separate and each need to be released\r
- * separately.\r
- * \r
- * <p>\r
- * The format of the generated ID's should be such that they do not contain\r
- * ':' characters.\r
- * \r
- * <p>\r
- * To retrieve the Resource for the generated ID later a read transaction is\r
- * needed where {@link ReadGraph#getResource(String)} can be used.\r
- * \r
- * @param resource\r
- * @return a persistent identifier\r
- * @throws InvalidResourceReferenceException ??? does this ever need to be\r
- * thrown ???\r
- */\r
- @Deprecated // in favor of getRandomAccessId\r
- String createRandomAccessId(Resource resource)\r
- throws InvalidResourceReferenceException;\r
-\r
- long getRandomAccessId(Resource resource) throws DatabaseException;\r
- int getTransientId(Resource resource) throws DatabaseException;\r
-\r
- /**\r
- * \r
- * @param id\r
- * @return\r
- * @throws InvalidResourceReferenceException\r
- */\r
- @Deprecated // in favor of getResource(long)\r
- Resource getResource(String randomAccessId)\r
- throws InvalidResourceReferenceException;\r
-\r
- Resource getResource(long randomAccessId) throws DatabaseException;\r
-\r
- Resource getResource(int transientId) throws DatabaseException;\r
-\r
- /**\r
- * @param identifier an identifier for a previously created random access\r
- * resource id using\r
- * {@link #createRandomAccessForResource(Resource)}.\r
- * @return <code>true</code> if the id was successfully released and\r
- * <code>false</code> if the id did not exist.\r
- * @throws InvalidResourceReferenceException\r
- */\r
- boolean disposeRandomAccessId(String randomAccessId)\r
- throws InvalidResourceReferenceException;\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db;
+
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.exception.InvalidResourceReferenceException;
+import org.simantics.db.service.SerialisationSupport;
+
+/**
+ * @deprecated use {@link SerialisationSupport} instead
+ */
+@Deprecated
+public interface ResourceSerializer {
+
+ /**
+ * Allocates and returns an identifier that can be stored persistently over
+ * time in a client and the database will be able to give you the
+ * corresponding Resource at a later time, until all statements of the
+ * resource are removed or the identifier is released by
+ * {@link #releaseRandomAccessForResource(String)}.
+ *
+ * <p>
+ * If random access is requested multiple times for a particular resource,
+ * the allocated ID's should be separate and each need to be released
+ * separately.
+ *
+ * <p>
+ * The format of the generated ID's should be such that they do not contain
+ * ':' characters.
+ *
+ * <p>
+ * To retrieve the Resource for the generated ID later a read transaction is
+ * needed where {@link ReadGraph#getResource(String)} can be used.
+ *
+ * @param resource
+ * @return a persistent identifier
+ * @throws InvalidResourceReferenceException ??? does this ever need to be
+ * thrown ???
+ */
+ @Deprecated // in favor of getRandomAccessId
+ String createRandomAccessId(Resource resource)
+ throws InvalidResourceReferenceException;
+
+ long getRandomAccessId(Resource resource) throws DatabaseException;
+ int getTransientId(Resource resource) throws DatabaseException;
+
+ /**
+ *
+ * @param id
+ * @return
+ * @throws InvalidResourceReferenceException
+ */
+ @Deprecated // in favor of getResource(long)
+ Resource getResource(String randomAccessId)
+ throws InvalidResourceReferenceException;
+
+ Resource getResource(long randomAccessId) throws DatabaseException;
+
+ Resource getResource(int transientId) throws DatabaseException;
+
+ /**
+ * @param identifier an identifier for a previously created random access
+ * resource id using
+ * {@link #createRandomAccessForResource(Resource)}.
+ * @return <code>true</code> if the id was successfully released and
+ * <code>false</code> if the id did not exist.
+ * @throws InvalidResourceReferenceException
+ */
+ boolean disposeRandomAccessId(String randomAccessId)
+ throws InvalidResourceReferenceException;
+
+}