import org.opendaylight.controller.cluster.datastore.messages.WriteDataReply;
import org.opendaylight.controller.cluster.datastore.modification.CompositeModification;
import org.opendaylight.controller.cluster.datastore.modification.DeleteModification;
-import org.opendaylight.controller.cluster.datastore.modification.ImmutableCompositeModification;
import org.opendaylight.controller.cluster.datastore.modification.MergeModification;
import org.opendaylight.controller.cluster.datastore.modification.MutableCompositeModification;
import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
} else if(MergeData.isSerializedType(message)) {
mergeData(transaction, MergeData.fromSerializable(message), SERIALIZED_REPLY);
- } else if(DeleteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
+ } else if(DeleteData.isSerializedType(message)) {
deleteData(transaction, DeleteData.fromSerializable(message), SERIALIZED_REPLY);
} else if(ReadyTransaction.SERIALIZABLE_CLASS.equals(message.getClass())) {
} else if (message instanceof GetCompositedModification) {
// This is here for testing only
- getSender().tell(new GetCompositeModificationReply(
- new ImmutableCompositeModification(modification)), getSelf());
+ getSender().tell(new GetCompositeModificationReply(modification), getSelf());
} else {
super.handleReceive(message);
}
LOG.debug("writeData at path : {}", message.getPath());
modification.addModification(
- new WriteModification(message.getPath(), message.getData(), getSchemaContext()));
+ new WriteModification(message.getPath(), message.getData()));
try {
transaction.write(message.getPath(), message.getData());
WriteDataReply writeDataReply = WriteDataReply.INSTANCE;
LOG.debug("mergeData at path : {}", message.getPath());
modification.addModification(
- new MergeModification(message.getPath(), message.getData(), getSchemaContext()));
+ new MergeModification(message.getPath(), message.getData()));
try {
transaction.merge(message.getPath(), message.getData());
modification.addModification(new DeleteModification(message.getPath()));
try {
transaction.delete(message.getPath());
- DeleteDataReply deleteDataReply = new DeleteDataReply();
- getSender().tell(returnSerialized ? deleteDataReply.toSerializable() : deleteDataReply,
- getSelf());
+ DeleteDataReply deleteDataReply = DeleteDataReply.INSTANCE;
+ getSender().tell(returnSerialized ? deleteDataReply.toSerializable(message.getVersion()) :
+ deleteDataReply, getSelf());
}catch(Exception e){
getSender().tell(new akka.actor.Status.Failure(e), getSelf());
}