X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmodification%2FModification.java;h=b11357e61ab13377e34bd80c1712c3d01fef26c0;hp=60dbf0f4b17e06131db9c0939f257a2af76a31fb;hb=35dfbc096623d860b6e24b2d17ac6e2c6a3dca1c;hpb=b2e6c299fad844633c8b40a2e180780f5774a4ae diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/Modification.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/Modification.java index 60dbf0f4b1..b11357e61a 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/Modification.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/Modification.java @@ -8,26 +8,55 @@ package org.opendaylight.controller.cluster.datastore.modification; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; +import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; /** * Represents a modification to the data store. + * *

* Simple modifications can be of type, + *

* *

- * 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 - *

+ * 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 { - /** - * 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(); + + @Override + void writeExternal(ObjectOutput out) throws IOException; + + @Override + void readExternal(ObjectInput in) throws IOException, ClassNotFoundException; }