[Mulgara-svn] r380 - branches/nw-interface/src/jar/query/java/org/mulgara/query/ast

pag at mulgara.org pag at mulgara.org
Mon Aug 27 21:12:46 UTC 2007


Author: pag
Date: 2007-08-27 16:12:45 -0500 (Mon, 27 Aug 2007)
New Revision: 380

Added:
   branches/nw-interface/src/jar/query/java/org/mulgara/query/ast/TransactionCommand.java
Log:
Base class for commands initiating manual transaction operations

Added: branches/nw-interface/src/jar/query/java/org/mulgara/query/ast/TransactionCommand.java
===================================================================
--- branches/nw-interface/src/jar/query/java/org/mulgara/query/ast/TransactionCommand.java	2007-08-27 21:10:01 UTC (rev 379)
+++ branches/nw-interface/src/jar/query/java/org/mulgara/query/ast/TransactionCommand.java	2007-08-27 21:12:45 UTC (rev 380)
@@ -0,0 +1,64 @@
+/*
+ * The contents of this file are subject to the Open Software License
+ * Version 3.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.opensource.org/licenses/osl-3.0.txt
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ */
+
+package org.mulgara.query.ast;
+
+import java.net.URI;
+
+/**
+ * An AST element for controlling transactions.
+ *
+ * @created 2007-08-09
+ * @author Paul Gearon
+ * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
+ * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
+ */
+public abstract class TransactionCommand {
+
+  /** An optional message that can be returned to a UI after execution. */
+  protected String resultMessage = "";
+
+  /**
+   * Indicates that this operation may require network access.
+   * @return <code>false</code> as network access may be needed.
+   */
+  public boolean isLocalOperation() {
+    return false;
+  }
+
+  /**
+   * Indicates that this operation is not specific to a UI.
+   * @return <code>false</code> as operation is not specific to UIs.
+   */
+  public boolean isUICommand() {
+    return false;
+  }
+
+  /**
+   * Requests a server URI for this operation.  None available, as it
+   * operates on the local connection.
+   * @return <code>null</code>
+   */
+  public URI getServerURI() {
+    return null;
+  }
+
+  /**
+   * Gets a message text relevant to the operation.  Useful for the UI.
+   * @return A text message associated with the result of this
+   * operation.
+   */
+  public String getResultMessage() {
+    return resultMessage;
+  }
+
+}
\ No newline at end of file




More information about the Mulgara-svn mailing list