X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db%2Fsrc%2Forg%2Fsimantics%2Fdb%2FResourceSerializer.java;h=6f09736d4fc9ef2faedaaca236085112868f4baf;hb=1880e63cc11f9139f0c6a3c21ada4266bd7f2f9a;hp=72568194157e0458a2aa1119e9b863156bba5850;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db/src/org/simantics/db/ResourceSerializer.java b/bundles/org.simantics.db/src/org/simantics/db/ResourceSerializer.java index 725681941..6f09736d4 100644 --- a/bundles/org.simantics.db/src/org/simantics/db/ResourceSerializer.java +++ b/bundles/org.simantics.db/src/org/simantics/db/ResourceSerializer.java @@ -1,81 +1,81 @@ -/******************************************************************************* - * 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)}. - * - *
- * 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. - * - *
- * The format of the generated ID's should be such that they do not contain - * ':' characters. - * - *
- * 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 true
if the id was successfully released and
- * false
if the id did not exist.
- * @throws InvalidResourceReferenceException
- */
- boolean disposeRandomAccessId(String randomAccessId)
- throws InvalidResourceReferenceException;
-
-}
+/*******************************************************************************
+ * 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)}.
+ *
+ *
+ * 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. + * + *
+ * The format of the generated ID's should be such that they do not contain + * ':' characters. + * + *
+ * 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 true
if the id was successfully released and
+ * false
if the id did not exist.
+ * @throws InvalidResourceReferenceException
+ */
+ boolean disposeRandomAccessId(String randomAccessId)
+ throws InvalidResourceReferenceException;
+
+}