]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/request/ReadInterface.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / request / ReadInterface.java
diff --git a/bundles/org.simantics.db/src/org/simantics/db/request/ReadInterface.java b/bundles/org.simantics.db/src/org/simantics/db/request/ReadInterface.java
new file mode 100644 (file)
index 0000000..f8687df
--- /dev/null
@@ -0,0 +1,48 @@
+package org.simantics.db.request;\r
+\r
+import org.simantics.db.AsyncRequestProcessor;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.RequestProcessor;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.procedure.AsyncListener;\r
+import org.simantics.db.procedure.AsyncProcedure;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.procedure.Procedure;\r
+import org.simantics.db.procedure.SyncListener;\r
+import org.simantics.db.procedure.SyncProcedure;\r
+\r
+/**\r
+ * \r
+ * An interface representing a computation of a single result. Some standard implementations of ReadInterface and WriteInterface include\r
+ * <ul>\r
+ * <li>{@link ResourceRead} which is identified by a single resource\r
+ * <li>{@link ResourceRead2} which is identified by a pair of resources\r
+ * <li>{@link UnaryRead} which is identifier by a single object\r
+ * <li>{@link BinaryRead} which is identifier by a pair of objects\r
+ * <li>{@link UniqueRead} which is unique (not equal to anything but itself)\r
+ * <li>{@link ReadRequest} which does not report a result\r
+ * </ul>\r
+ * <p>\r
+ * \r
+ * The client is not expected to implement this class but rather to extend one of the standard implementations.\r
+ * \r
+ * @version 1.5\r
+ * @author Antti Villberg\r
+ * @see WriteInterface\r
+ * @see RequestProcessor\r
+ * @see ReadGraph\r
+ * @see Session\r
+ */\r
+\r
+public interface ReadInterface<Result> {\r
+\r
+       Result request(RequestProcessor processor) throws DatabaseException;\r
+       void request(AsyncRequestProcessor processor, AsyncProcedure<Result> procedure);\r
+       void request(AsyncRequestProcessor processor, Procedure<Result> procedure);\r
+       void request(AsyncRequestProcessor processor, SyncProcedure<Result> procedure);\r
+       void request(AsyncRequestProcessor processor, AsyncListener<Result> procedure);\r
+       void request(AsyncRequestProcessor processor, Listener<Result> procedure);\r
+       void request(AsyncRequestProcessor processor, SyncListener<Result> procedure);\r
+       \r
+}\r