Disconnect mdsal-bind-dom-codec yangtools/mdsal APIs
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / yangtools / binding / data / codec / api / BindingNormalizedNodeSerializer.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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.yangtools.binding.data.codec.api;
9
10 import java.util.Map.Entry;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.binding.DataContainer;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16 import org.opendaylight.yangtools.yang.binding.Notification;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
18 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
19 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
20 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
21
22 /**
23  * Serialization service, which provides two-way serialization between Java
24  * Binding Data representation and NormalizedNode representation.
25  */
26 @Deprecated
27 public interface BindingNormalizedNodeSerializer {
28
29     /**
30      * Translates supplied Binding Instance Identifier into NormalizedNode
31      * instance identifier.
32      *
33      * @param binding
34      *            Binding Instance Identifier
35      * @return DOM Instance Identifier
36      * @throws IllegalArgumentException
37      *             If supplied Instance Identifier is not valid.
38      */
39     YangInstanceIdentifier toYangInstanceIdentifier(@Nonnull InstanceIdentifier<?> binding);
40
41     /**
42      * Translates supplied YANG Instance Identifier into Binding instance
43      * identifier.
44      *
45      * @param dom
46      *            YANG Instance Identifier
47      * @return Binding Instance Identifier, or null if the instance identifier
48      *         is not representable.
49      */
50     @Nullable
51     InstanceIdentifier<?> fromYangInstanceIdentifier(@Nonnull YangInstanceIdentifier dom);
52
53     /**
54      * Translates supplied Binding Instance Identifier and data into
55      * NormalizedNode representation.
56      *
57      * @param path
58      *            Binding Instance Identifier pointing to data
59      * @param data
60      *            Data object representing data
61      * @return NormalizedNode representation
62      * @throws IllegalArgumentException
63      *             If supplied Instance Identifier is not valid.
64      */
65     <T extends DataObject> Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> toNormalizedNode(
66             InstanceIdentifier<T> path, T data);
67
68     /**
69      * Translates supplied YANG Instance Identifier and NormalizedNode into
70      * Binding data.
71      *
72      * @param path Binding Instance Identifier
73      * @param data NormalizedNode representing data
74      * @return DOM Instance Identifier
75      */
76     @Nullable
77     Entry<InstanceIdentifier<?>, DataObject> fromNormalizedNode(@Nonnull YangInstanceIdentifier path,
78             NormalizedNode<?, ?> data);
79
80     /**
81      * Translates supplied NormalizedNode Notification into Binding data.
82      *
83      * @param path Schema Path of Notification, schema path is absolute, and consists of Notification QName.
84      * @param data NormalizedNode representing data
85      * @return Binding representation of Notification
86      */
87     @Nullable Notification fromNormalizedNodeNotification(@Nonnull SchemaPath path,@Nonnull ContainerNode data);
88
89     /**
90      * Translates supplied NormalizedNode RPC input or output into Binding data.
91      *
92      * @param path Schema path of RPC data, Schema path consists of rpc QName and input / output QName.
93      * @param data NormalizedNode representing data
94      * @return Binding representation of RPC data
95      */
96     @Nullable DataObject fromNormalizedNodeRpcData(@Nonnull SchemaPath path,@Nonnull ContainerNode data);
97
98     /**
99      * Translates supplied Binding Notification or output into NormalizedNode notification.
100      *
101      * @param data NormalizedNode representing notification data
102      * @return NormalizedNode representation of notification
103      */
104     @Nonnull ContainerNode toNormalizedNodeNotification(@Nonnull Notification data);
105
106     /**
107      * Translates supplied Binding RPC input or output into NormalizedNode data.
108      *
109      * @param data NormalizedNode representing rpc data
110      * @return NormalizedNode representation of rpc data
111      */
112     @Nonnull ContainerNode toNormalizedNodeRpcData(@Nonnull DataContainer data);
113 }