import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
} else if (WriteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
writeData(WriteData.fromSerializable(message, schemaContext));
} else if (MergeData.SERIALIZABLE_CLASS.equals(message.getClass())) {
mergeData(MergeData.fromSerializable(message, schemaContext));
} else if (DeleteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
deleteData(DeleteData.fromSerizalizable(message));
} else if (WriteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
writeData(WriteData.fromSerializable(message, schemaContext));
} else if (MergeData.SERIALIZABLE_CLASS.equals(message.getClass())) {
mergeData(MergeData.fromSerializable(message, schemaContext));
} else if (DeleteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
deleteData(DeleteData.fromSerizalizable(message));
- } else if (message instanceof ReadyTransaction) {
- readyTransaction((ReadyTransaction) message);
- } else if (message instanceof CloseTransaction) {
- closeTransaction((CloseTransaction) message);
+ } else if (ReadyTransaction.SERIALIZABLE_CLASS.equals(message.getClass())) {
+ readyTransaction(new ReadyTransaction());
+ } else if (message.getClass().equals(CloseTransaction.SERIALIZABLE_CLASS)) {
+ closeTransaction(new CloseTransaction());
} else if (message instanceof GetCompositedModification) {
// This is here for testing only
getSender().tell(new GetCompositeModificationReply(
new ImmutableCompositeModification(modification)), getSelf());
} else if (message instanceof GetCompositedModification) {
// This is here for testing only
getSender().tell(new GetCompositeModificationReply(
new ImmutableCompositeModification(modification)), getSelf());
}
}
private void readData(ReadData message) {
final ActorRef sender = getSender();
final ActorRef self = getSelf();
}
}
private void readData(ReadData message) {
final ActorRef sender = getSender();
final ActorRef self = getSelf();
try {
Optional<NormalizedNode<?, ?>> optional = future.get();
if (optional.isPresent()) {
try {
Optional<NormalizedNode<?, ?>> optional = future.get();
if (optional.isPresent()) {
private void writeData(WriteData message) {
modification.addModification(
new WriteModification(message.getPath(), message.getData(),schemaContext));
private void writeData(WriteData message) {
modification.addModification(
new WriteModification(message.getPath(), message.getData(),schemaContext));
}
private void mergeData(MergeData message) {
modification.addModification(
new MergeModification(message.getPath(), message.getData(), schemaContext));
}
private void mergeData(MergeData message) {
modification.addModification(
new MergeModification(message.getPath(), message.getData(), schemaContext));
}
private void deleteData(DeleteData message) {
modification.addModification(new DeleteModification(message.getPath()));
transaction.delete(message.getPath());
}
private void deleteData(DeleteData message) {
modification.addModification(new DeleteModification(message.getPath()));
transaction.delete(message.getPath());
ActorRef cohortActor = getContext().actorOf(
ThreePhaseCommitCohort.props(cohort, shardActor, modification), "cohort");
getSender()
ActorRef cohortActor = getContext().actorOf(
ThreePhaseCommitCohort.props(cohort, shardActor, modification), "cohort");
getSender()