+package org.simantics.db.impl.internal;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ExternalValueSupport;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+/**\r
+ * A database {@link Session} service for registering and retrieving random\r
+ * access binary instances related to a session.\r
+ * \r
+ * <p>\r
+ * This service is internal to the implementation and must not be used\r
+ * elsewhere.\r
+ * </p>\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ * \r
+ * @see ExternalValueSupport\r
+ */\r
+public interface RandomAccessValueSupport {\r
+\r
+ /**\r
+ * Registers the specified value with the specified resource.\r
+ * \r
+ * @param resource\r
+ * @param data\r
+ * @throws IllegalStateException\r
+ * if a previous registration already exists for the specified\r
+ * resource\r
+ */\r
+ void put(Resource resource, ResourceData data);\r
+\r
+ /**\r
+ * @param Resource\r
+ * @return currently registered value attached to the specified resource\r
+ */\r
+ ResourceData get(Resource resource);\r
+\r
+ /**\r
+ * @return currently registered entries\r
+ */\r
+ Collection<Pair<Resource, ResourceData>> entries();\r
+\r
+ /**\r
+ * Removes all value registrations from this registry.\r
+ * \r
+ * @return the set of previously registered values\r
+ */\r
+ Collection<Pair<Resource, ResourceData>> removeAll();\r
+\r
+}\r