Prepare netconf to support YANG 1.1 actions
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / api / MessageTransformer.java
index 1d1acaa0ff7764fc34cf176bb011c03864312f40..0cbc2fd5569b35258948fedd15fccda8ee3af6b5 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.netconf.sal.connect.api;
 
 import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
+import org.opendaylight.mdsal.dom.api.DOMActionResult;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
@@ -20,4 +22,27 @@ public interface MessageTransformer<M> {
 
     DOMRpcResult toRpcResult(M message, SchemaPath rpc);
 
+    /**
+     * Parse action into message for request.
+     *
+     * @param action - action schema path
+     * @param domDataTreeIdentifier - identifier of action
+     * @param payload - input of action
+     * @return message
+     */
+    default M toActionRequest(SchemaPath action, DOMDataTreeIdentifier domDataTreeIdentifier, NormalizedNode<?,
+            ?> payload) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Parse result of invoking action into DOM result.
+     *
+     * @param action - action schema path
+     * @param message - message to parsing
+     * @return {@link DOMActionResult}
+     */
+    default DOMActionResult toActionResult(SchemaPath action, M message) {
+        throw new UnsupportedOperationException();
+    }
 }