Refactor Register*ListenerReply classes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / modification / Modification.java
index ed9b1fe3b9548f9b529b4e1e9ce6929e41fcda11..a04fbd0719444f7b27d1f03459cdee765c983a85 100644 (file)
@@ -8,27 +8,46 @@
 
 package org.opendaylight.controller.cluster.datastore.modification;
 
-import org.opendaylight.controller.cluster.datastore.messages.SerializableMessage;
+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.
+ *
  * <p>
  * Simple modifications can be of type,
+ * <ul>
  * <li> {@link org.opendaylight.controller.cluster.datastore.modification.WriteModification}
  * <li> {@link org.opendaylight.controller.cluster.datastore.modification.MergeModification}
  * <li> {@link org.opendaylight.controller.cluster.datastore.modification.DeleteModification}
- * </p>
+ * </ul>
  *
  * <p>
- * Modifications can in turn be lumped into a single {@link org.opendaylight.controller.cluster.datastore.modification.CompositeModification}
- * which can then be applied to a write transaction
- * </p>
+ * Modifications can in turn be lumped into a single
+ * {@link org.opendaylight.controller.cluster.datastore.modification.CompositeModification}
+ * which can then be applied to a write transaction.
  */
-public interface Modification extends SerializableMessage {
-  /**
-   * 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 the transaction
+     */
+    void apply(DOMStoreWriteTransaction transaction);
+
+    /**
+     * Apply the modification to the specified transaction.
+     *
+     * @param transaction the transaction
+     */
+    void apply(DataTreeModification transaction);
+
+    byte getType();
 }