2 * Copyright (c) 2016 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.netconf.util;
10 import java.util.List;
11 import java.util.Optional;
12 import org.opendaylight.netconf.api.EffectiveOperation;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.api.schema.AnyxmlNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.DOMSourceAnyxmlNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
17 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
20 * Transforms rpc structures to normalized nodes and vice versa.
22 interface RpcStructureTransformer {
24 * Transforms data and path to the config element structure. It means creating of parent xml structure
25 * specified by path and appending data to the structure. Operation is set as attribute on data element.
28 * @param dataPath path, where data will be written
29 * @param operation operation
30 * @return config structure
32 DOMSourceAnyxmlNode createEditConfigStructure(Optional<NormalizedNode> data, YangInstanceIdentifier dataPath,
33 Optional<EffectiveOperation> operation);
36 * Transforms path to filter structure.
39 * @return filter structure
41 AnyxmlNode<?> toFilterStructure(YangInstanceIdentifier path);
44 * Transforms list of fields filters to filter structure.
45 * Field paths are relative to parent query path.
47 * @param fieldsFilters list of: parent path and selection fields
48 * @return filter structure
50 AnyxmlNode<?> toFilterStructure(List<FieldsFilter> fieldsFilters);
53 * Selects data specified by path from data node. Data must be product of get-config rpc with filter created by
54 * {@link #toFilterStructure(YangInstanceIdentifier)} or {@link #toFilterStructure(List)} )} with same path.
57 * @param path path to select
58 * @return selected data
60 Optional<NormalizedNode> selectFromDataStructure(DataContainerChild data, YangInstanceIdentifier path);