From 093728d9bc64609b5503ae9191a8cc1d0a937b79 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 19 Aug 2019 14:01:27 +0200 Subject: [PATCH 1/1] Propagate action logical datastore type Unlike RFC7950 and related specifications, actions are generalized in ODL to work on any datastore type, as otherwise internal cooperation could not work on onything but operational datastore. This patch correctly propagates the invocation datastore type, so that invoking actions on top of config datastore becomes possible. JIRA: CONTROLLER-1894 Change-Id: I20f340bee0321a446a07d701650d6dac57057ee6 Signed-off-by: Robert Varga --- .../controller/remote/rpc/messages/ExecuteAction.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteAction.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteAction.java index 5f9d99f698..6d19d9c7ed 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteAction.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteAction.java @@ -75,7 +75,7 @@ public final class ExecuteAction extends AbstractExecute<@NonNull ContainerNode> public void writeExternal(final ObjectOutput out) throws IOException { try (NormalizedNodeDataOutput stream = NormalizedNodeInputOutput.newDataOutput(out)) { stream.writeSchemaPath(executeAction.getType()); - // FIXME: deal with data store types? + executeAction.getPath().getDatastoreType().writeTo(out); stream.writeYangInstanceIdentifier(executeAction.getPath().getRootIdentifier()); stream.writeOptionalNormalizedNode(executeAction.getInput()); } @@ -85,11 +85,11 @@ public final class ExecuteAction extends AbstractExecute<@NonNull ContainerNode> public void readExternal(final ObjectInput in) throws IOException { final NormalizedNodeDataInput stream = NormalizedNodeInputOutput.newDataInput(in); final SchemaPath name = stream.readSchemaPath(); + final LogicalDatastoreType type = LogicalDatastoreType.readFrom(in); final YangInstanceIdentifier path = stream.readYangInstanceIdentifier(); final ContainerNode input = (ContainerNode) stream.readOptionalNormalizedNode().orElse(null); - executeAction = new ExecuteAction(name, new DOMDataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, path), - input); + executeAction = new ExecuteAction(name, new DOMDataTreeIdentifier(type, path), input); } private Object readResolve() { -- 2.36.6