BUG-509: cleanup datastore interafaces
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / tree / DataPreconditionFailedException.java
index bb2111e6a08882b71656e28c96758ccfe19f178e..bd24ac5fcfd3c670b2677531eb485cba3a9e7d4c 100644 (file)
@@ -11,20 +11,42 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 
 import com.google.common.base.Preconditions;
 
+/**
+ * Exception thrown when a proposed change fails validation before being
+ * applied into the datastore. This can have multiple reasons, for example
+ * the datastore has been concurrently modified such that a conflicting
+ * node is present, or the modification is structurally incorrect.
+ */
 public class DataPreconditionFailedException extends Exception {
     private static final long serialVersionUID = 1L;
     private final InstanceIdentifier path;
 
+    /**
+     * Create a new instance.
+     *
+     * @param path Object path which caused this exception
+     * @param message Specific message describing the failure
+     */
     public DataPreconditionFailedException(final InstanceIdentifier path, final String message) {
-        super(message);
-        this.path = Preconditions.checkNotNull(path);
+        this(path, message, null);
     }
-
+    /**
+     * Create a new instance, initializing
+     *
+     * @param path Object path which caused this exception
+     * @param message Specific message describing the failure
+     * @param cause Exception which triggered this failure, may be null
+     */
     public DataPreconditionFailedException(final InstanceIdentifier path, final String message, final Throwable cause) {
         super(message, cause);
         this.path = Preconditions.checkNotNull(path);
     }
 
+    /**
+     * Returns the offending object path.
+     *
+     * @return Path of the offending object
+     */
     public InstanceIdentifier getPath() {
         return path;
     }