CDS: use internal DataTree instance
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / modification / Modification.java
index 60dbf0f4b17e06131db9c0939f257a2af76a31fb..6fc8183bd8f29b7e0b1e0c13ce34c4a73f9966f6 100644 (file)
@@ -8,7 +8,9 @@
 
 package org.opendaylight.controller.cluster.datastore.modification;
 
+import java.io.Externalizable;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 
 /**
  * Represents a modification to the data store.
@@ -24,10 +26,29 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
  * which can then be applied to a write transaction
  * </p>
  */
-public interface Modification {
-  /**
-   * Apply the modification to the specified transaction
-   * @param transaction
-   */
-  void apply(DOMStoreWriteTransaction transaction);
+public interface Modification extends Externalizable {
+
+    byte COMPOSITE = 1;
+    byte WRITE = 2;
+    byte MERGE = 3;
+    byte DELETE = 4;
+
+    /**
+     * Apply the modification to the specified transaction
+     *
+     * @param transaction
+     */
+    void apply(DOMStoreWriteTransaction transaction);
+
+    /**
+     * Apply the modification to the specified transaction
+     *
+     * @param transaction
+     */
+    void apply(DataTreeModification transaction);
+
+    byte getType();
+
+    @Deprecated
+    Object toSerializable();
 }