1 package org.simantics.db.request;
\r
3 import org.simantics.db.AsyncRequestProcessor;
\r
4 import org.simantics.db.ReadGraph;
\r
5 import org.simantics.db.RequestProcessor;
\r
6 import org.simantics.db.Session;
\r
7 import org.simantics.db.exception.DatabaseException;
\r
8 import org.simantics.db.procedure.AsyncListener;
\r
9 import org.simantics.db.procedure.AsyncProcedure;
\r
10 import org.simantics.db.procedure.Listener;
\r
11 import org.simantics.db.procedure.Procedure;
\r
12 import org.simantics.db.procedure.SyncListener;
\r
13 import org.simantics.db.procedure.SyncProcedure;
\r
17 * An interface representing a computation of a single result. Some standard implementations of ReadInterface and WriteInterface include
\r
19 * <li>{@link ResourceRead} which is identified by a single resource
\r
20 * <li>{@link ResourceRead2} which is identified by a pair of resources
\r
21 * <li>{@link UnaryRead} which is identifier by a single object
\r
22 * <li>{@link BinaryRead} which is identifier by a pair of objects
\r
23 * <li>{@link UniqueRead} which is unique (not equal to anything but itself)
\r
24 * <li>{@link ReadRequest} which does not report a result
\r
28 * The client is not expected to implement this class but rather to extend one of the standard implementations.
\r
31 * @author Antti Villberg
\r
32 * @see WriteInterface
\r
33 * @see RequestProcessor
\r
38 public interface ReadInterface<Result> {
\r
40 Result request(RequestProcessor processor) throws DatabaseException;
\r
41 void request(AsyncRequestProcessor processor, AsyncProcedure<Result> procedure);
\r
42 void request(AsyncRequestProcessor processor, Procedure<Result> procedure);
\r
43 void request(AsyncRequestProcessor processor, SyncProcedure<Result> procedure);
\r
44 void request(AsyncRequestProcessor processor, AsyncListener<Result> procedure);
\r
45 void request(AsyncRequestProcessor processor, Listener<Result> procedure);
\r
46 void request(AsyncRequestProcessor processor, SyncListener<Result> procedure);
\r