2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.netconf.sal.connect.api;
10 import org.opendaylight.mdsal.dom.api.DOMActionResult;
11 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
12 import org.opendaylight.mdsal.dom.api.DOMNotification;
13 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
14 import org.opendaylight.netconf.api.NetconfMessage;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
19 public interface MessageTransformer {
21 DOMNotification toNotification(NetconfMessage message);
23 NetconfMessage toRpcRequest(QName rpc, NormalizedNode node);
25 DOMRpcResult toRpcResult(NetconfMessage message, QName rpc);
28 * Parse action into message for request.
30 * @param action - action schema path
31 * @param domDataTreeIdentifier - identifier of action
32 * @param payload - input of action
35 default NetconfMessage toActionRequest(final Absolute action, final DOMDataTreeIdentifier domDataTreeIdentifier,
36 final NormalizedNode payload) {
37 throw new UnsupportedOperationException();
41 * Parse result of invoking action into DOM result.
43 * @param action - action schema path
44 * @param message - message to parsing
45 * @return {@link DOMActionResult}
47 default DOMActionResult toActionResult(final Absolute action, final NetconfMessage message) {
48 throw new UnsupportedOperationException();