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.yangtools.yang.data.api.schema.NormalizedNode;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17 public interface MessageTransformer<M> {
19 DOMNotification toNotification(M message);
21 M toRpcRequest(SchemaPath rpc, NormalizedNode<?, ?> node);
23 DOMRpcResult toRpcResult(M message, SchemaPath rpc);
26 * Parse action into message for request.
28 * @param action - action schema path
29 * @param domDataTreeIdentifier - identifier of action
30 * @param payload - input of action
33 default M toActionRequest(final SchemaPath action, final DOMDataTreeIdentifier domDataTreeIdentifier,
34 final NormalizedNode<?, ?> payload) {
35 throw new UnsupportedOperationException();
39 * Parse result of invoking action into DOM result.
41 * @param action - action schema path
42 * @param message - message to parsing
43 * @return {@link DOMActionResult}
45 default DOMActionResult toActionResult(final SchemaPath action, final M message) {
46 throw new UnsupportedOperationException();