Split up MessageTransformer
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / api / ActionTransformer.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.sal.connect.api;
9
10 import org.opendaylight.mdsal.dom.api.DOMActionResult;
11 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
12 import org.opendaylight.netconf.api.NetconfMessage;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
15
16 /**
17  * Interface for transforming NETCONF device action request/response messages.
18  */
19 public interface ActionTransformer {
20     /**
21      * Parse action into message for request.
22      *
23      * @param action - action schema path
24      * @param domDataTreeIdentifier - identifier of action
25      * @param payload - input of action
26      * @return message
27      */
28     NetconfMessage toActionRequest(Absolute action, DOMDataTreeIdentifier domDataTreeIdentifier,
29             NormalizedNode payload);
30
31     /**
32      * Parse result of invoking action into DOM result.
33      *
34      * @param action - action schema path
35      * @param message - message to parsing
36      * @return {@link DOMActionResult}
37      */
38     DOMActionResult toActionResult(Absolute action, NetconfMessage message);
39 }