Author: rhauch
Date: 2008-07-09 10:54:59 -0400 (Wed, 09 Jul 2008)
New Revision: 345
Modified:
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/GraphCommand.java
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGraphCommand.java
Log:
DNA-115 - Create federation service
http://jira.jboss.com/jira/browse/DNA-115
Added to GraphCommand the ability to get and set an exception, as well as two convenience
methods to determine whether the command has (or does not have) an error.
Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/GraphCommand.java
===================================================================
---
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/GraphCommand.java 2008-07-09
14:52:15 UTC (rev 344)
+++
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/GraphCommand.java 2008-07-09
14:54:59 UTC (rev 345)
@@ -39,7 +39,40 @@
* Set the error for this command.
*
* @param error the exception
+ * @see #getError()
+ * @see #hasError()
+ * @see #hasNoError()
*/
void setError( Throwable error );
+ /**
+ * Get the error for this command.
+ *
+ * @return the error, or null if there is no error
+ * @see #setError(Throwable)
+ * @see #hasError()
+ * @see #hasNoError()
+ */
+ Throwable getError();
+
+ /**
+ * Return true if this command has an {@link #getError() error}.
+ *
+ * @return true if the command has an error, or false otherwise
+ * @see #getError()
+ * @see #setError(Throwable)
+ * @see #hasNoError()
+ */
+ boolean hasError();
+
+ /**
+ * Convenience method that is equivalent to <code>!hasError()</code>.
+ *
+ * @return true if the command has no error, or false otherwise
+ * @see #getError()
+ * @see #setError(Throwable)
+ * @see #hasError()
+ */
+ boolean hasNoError();
+
}
Modified:
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGraphCommand.java
===================================================================
---
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGraphCommand.java 2008-07-09
14:52:15 UTC (rev 344)
+++
trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGraphCommand.java 2008-07-09
14:54:59 UTC (rev 345)
@@ -72,12 +72,19 @@
}
/**
- * @return error
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.spi.graph.commands.GraphCommand#getError()
*/
public Throwable getError() {
return error;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.spi.graph.commands.GraphCommand#hasError()
+ */
public boolean hasError() {
return error != null;
}