]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / RequestProcessorSpecific.java
diff --git a/bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java b/bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java
new file mode 100644 (file)
index 0000000..b93b9c9
--- /dev/null
@@ -0,0 +1,500 @@
+/*******************************************************************************\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 java.util.Collection;\r
+\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.procedure.AsyncListener;\r
+import org.simantics.db.procedure.AsyncMultiListener;\r
+import org.simantics.db.procedure.AsyncMultiProcedure;\r
+import org.simantics.db.procedure.AsyncProcedure;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.procedure.MultiListener;\r
+import org.simantics.db.procedure.MultiProcedure;\r
+import org.simantics.db.procedure.Procedure;\r
+import org.simantics.db.procedure.SyncListener;\r
+import org.simantics.db.procedure.SyncMultiListener;\r
+import org.simantics.db.procedure.SyncMultiProcedure;\r
+import org.simantics.db.procedure.SyncProcedure;\r
+import org.simantics.db.request.AsyncMultiRead;\r
+import org.simantics.db.request.AsyncRead;\r
+import org.simantics.db.request.DelayedWrite;\r
+import org.simantics.db.request.DelayedWriteResult;\r
+import org.simantics.db.request.ExternalRead;\r
+import org.simantics.db.request.MultiRead;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.db.request.Write;\r
+import org.simantics.db.request.WriteOnly;\r
+import org.simantics.db.request.WriteOnlyResult;\r
+import org.simantics.db.request.WriteResult;\r
+\r
+/**\r
+ * \r
+ * For initiating requests in synchronous manner. The possible requests are\r
+ * <ul>\r
+ * <li>{@link Read} for computing a single result synchronously\r
+ * <li>{@link AsyncRead} for computing a single result asynchronously\r
+ * <li>{@link MultiRead} for computing a collection of results synchronously\r
+ * <li>{@link AsyncMultiRead} for computing a collection of results\r
+ * asynchronously\r
+ * <li>{@link Write} for reading and writing synchronously\r
+ * <li>{@link WriteOnly} for writing synchronously\r
+ * </ul>\r
+ * <p>\r
+ * The standard RequestProcessors are\r
+ * <ul>\r
+ * <li>{@link ReadGraph} for performing requests during other requests\r
+ * <li>{@link Session} for initiating a transactions for performing requests\r
+ * <li>{@link MergingGraphRequestProcessor} for merging several requests in a\r
+ * single transaction\r
+ * </ul>\r
+ * \r
+ * Database services (see e.g. {@link Session}) are available from implemented\r
+ * {@link ServiceLocator}. For an asynchronous counterpart with the same\r
+ * functionality as RequestProcessor see {@link AsyncRequestProcessor}\r
+ * \r
+ * <p>\r
+ * <b>IMPORTANT:</b>A client invoking any of the <code>syncRequest</code>\r
+ * -methods in this interface must not assume that the request is performed\r
+ * within the same thread that performed the <code>syncRequest</code>\r
+ * invocation. This is an implementation-specific matter.\r
+ * \r
+ * @version 0.7\r
+ * @author Antti Villberg\r
+ * @see Read\r
+ * @see AsyncRead\r
+ * @see MultiRead\r
+ * @see AsyncMultiRead\r
+ * @see Write\r
+ * @see WriteOnly\r
+ * @see ReadGraph\r
+ * @see Session\r
+ * @see MergingGraphRequestProcessor\r
+ * @see AsyncRequestProcessor\r
+ */\r
+public interface RequestProcessorSpecific extends AsyncRequestProcessor {\r
+\r
+    /**\r
+     * Synchronously determines and returns the result of the given {@link Read}\r
+     * and registers the given {@link Read} as a dependency of the ongoing\r
+     * request if any. This is usually invoked for the side-effects of the given\r
+     * {@link Read} but can also be used for e.g. dependency registering or\r
+     * cache priming.\r
+     * \r
+     * @param request an instance of {@link Read}\r
+     * @return the result of the given {@link Read}\r
+     * @throws DatabaseException from {@link Read#perform(ReadGraph)} or from\r
+     *         request processing system\r
+     */\r
+    <T> T syncRequest(Read<T> request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link AsyncListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link Read}. Registers the given {@link Read}\r
+     * as a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link AsyncListener}.\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link AsyncListener}.\r
+     */\r
+    //<T> T syncRequest(Read<T> request, AsyncListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link SyncListener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link Read}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link SyncListener}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link SyncListener}.\r
+     */\r
+    <T> T syncRequest(Read<T> request, SyncListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link Listener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link Read}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link Listener}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link Listener}.\r
+     */\r
+    <T> T syncRequest(Read<T> request, Listener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given {@link Read}\r
+     * to the given {@link AsyncProcedure}. Registers the given {@link Read} as\r
+     * a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link AsyncProcedure}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link AsyncProcedure}.\r
+     */\r
+    <T> T syncRequest(Read<T> request, AsyncProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given {@link Read}\r
+     * to the given {@link SyncProcedure}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link SyncProcedure}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link SyncProcedure}.\r
+     */\r
+    <T> T syncRequest(Read<T> request, SyncProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given {@link Read}\r
+     * to the given {@link Procedure}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link Procedure}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link Procedure}.\r
+     */\r
+    <T> T syncRequest(Read<T> request, Procedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously determines the result of the given {@link AsyncRead} and\r
+     * registers the given {@link AsyncRead} as a dependency of the ongoing\r
+     * request if any. This is usually invoked for the side-effects of the given\r
+     * {@link AsyncRead} but can also be used for e.g. dependency registering or\r
+     * cache priming.\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @return the result of the given {@link AsyncRead}\r
+     * @throws DatabaseException from {@link AsyncRead#perform(AsyncReadGraph)} or from\r
+     *         request processing system\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link AsyncListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link AsyncRead}. Registers the given\r
+     * {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link AsyncListener}.\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link AsyncListener}.\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request, AsyncListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link SyncListener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link AsyncRead}. Registers the given {@link AsyncRead}\r
+     * as a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link AsyncRead} will be\r
+     * transferred to the given {@link SyncListener}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link SyncListener}.\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request, SyncListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link Listener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link AsyncRead}. Registers the given {@link AsyncRead}\r
+     * as a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link AsyncRead} will be\r
+     * transferred to the given {@link Listener}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link Listener}.\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request, Listener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link AsyncRead} to the given {@link AsyncProcedure}. Registers the\r
+     * given {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link AsyncProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link AsyncProcedure}.\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request, AsyncProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link AsyncRead} to the given {@link SyncProcedure}. Registers the given\r
+     * {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link SyncProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link SyncProcedure}.\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request, SyncProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link AsyncRead} to the given {@link Procedure}. Registers the given\r
+     * {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link Procedure}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link Procedure}.\r
+     */\r
+    <T> T syncRequest(AsyncRead<T> request, Procedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously determines the result of the given {@link MultiRead} and\r
+     * registers the given {@link MultiRead} as a dependency of the ongoing\r
+     * request if any. This is usually invoked for the side-effects of the given\r
+     * {@link MultiRead} but can also be used for e.g. dependency registering or\r
+     * cache priming. All exceptions from request processing will be lost.\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @return the result of the given {@link MultiRead}\r
+     * @throws DatabaseException from {@link MultiRead#perform(ReadGraph)} or from\r
+     *         request processing system\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link AsyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link MultiRead}. Registers the given\r
+     * {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link AsyncMultiListener}.\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiListener}.\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request, AsyncMultiListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link SyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link MultiRead}. Registers the given\r
+     * {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link SyncMultiListener}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiListener}.\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request, SyncMultiListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link MultiListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link MultiRead}. Registers the given\r
+     * {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given {@link MultiListener}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link MultiListener}.\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request, MultiListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link MultiRead} to the given {@link AsyncMultiProcedure}. Registers the\r
+     * given {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link AsyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiProcedure}.\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request, AsyncMultiProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link MultiRead} to the given {@link SyncMultiProcedure}. Registers the\r
+     * given {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link SyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiProcedure}.\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request, SyncMultiProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link MultiRead} to the given {@link MultiProcedure}. Registers the\r
+     * given {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given {@link MultiProcedure}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link MultiProcedure}.\r
+     */\r
+    <T> Collection<T> syncRequest(MultiRead<T> request, MultiProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously determines the result of the given {@link AsyncMultiRead}\r
+     * and registers the given {@link AsyncMultiRead} as a dependency of the\r
+     * ongoing request if any. This is usually invoked for the side-effects of\r
+     * the given {@link AsyncMultiRead} but can also be used for e.g. dependency\r
+     * registering or cache priming. All exceptions from request processing will\r
+     * be lost.\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @throws DatabaseException from {@link AsyncMultiRead#perform(AsyncReadGraph)} or from\r
+     *         request processing system\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link AsyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link AsyncMultiRead}. Registers the\r
+     * given {@link AsyncMultiRead} as a dependency of the ongoing request if\r
+     * any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link AsyncMultiListener}.\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiListener}.\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request, AsyncMultiListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link SyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link AsyncMultiRead}. Registers the\r
+     * given {@link AsyncMultiRead} as a dependency of the ongoing request if\r
+     * any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link SyncMultiListener}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiListener}.\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request, SyncMultiListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously registers the given {@link MultiListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link AsyncMultiRead}. Registers the given\r
+     * {@link AsyncMultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link MultiListener}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link MultiListener}.\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request, MultiListener<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link AsyncMultiRead} to the given {@link AsyncMultiProcedure}.\r
+     * Registers the given {@link AsyncMultiRead} as a dependency of the ongoing\r
+     * request if any. Exceptions due to the determination of the result of the\r
+     * given {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link AsyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiProcedure}.\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request, AsyncMultiProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link AsyncMultiRead} to the given {@link SyncMultiProcedure}. Registers\r
+     * the given {@link AsyncMultiRead} as a dependency of the ongoing request\r
+     * if any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link SyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiProcedure}.\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request, SyncMultiProcedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously supplies the result determined from the given\r
+     * {@link AsyncMultiRead} to the given {@link MultiProcedure}. Registers the\r
+     * given {@link AsyncMultiRead} as a dependency of the ongoing request if\r
+     * any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link MultiProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link MultiProcedure}.\r
+     */\r
+    <T> Collection<T> syncRequest(AsyncMultiRead<T> request, MultiProcedure<T> procedure) throws DatabaseException;\r
+\r
+\r
+    <T> T syncRequest(ExternalRead<T> request) throws DatabaseException;\r
+    <T> T syncRequest(ExternalRead<T> request, Listener<T> procedure) throws DatabaseException;\r
+    <T> T syncRequest(ExternalRead<T> request, Procedure<T> procedure) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously performs the given {@link Write}.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    void syncRequest(Write request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously performs the given {@link DelayedWrite}.\r
+     * \r
+     * @param request an instance of {@link DelayedWrite}.\r
+     */\r
+    void syncRequest(DelayedWrite request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously performs the given {@link WriteOnly}.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    void syncRequest(WriteOnly r) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously performs the given {@link Write}.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    <T> T syncRequest(WriteResult<T> request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously performs the given {@link DelayedWrite}.\r
+     * \r
+     * @param request an instance of {@link DelayedWrite}.\r
+     */\r
+    <T> T syncRequest(DelayedWriteResult<T> request) throws DatabaseException;\r
+\r
+    /**\r
+     * Synchronously performs the given {@link WriteOnly}.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    <T> T syncRequest(WriteOnlyResult<T> r) throws DatabaseException;\r
+    \r
+}\r