0818f79729ddb5fb5b109c33cb7012e18bd5134d
[ccsdk/features.git] /
1 /*
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt
4  * =================================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6  * =================================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  * ============LICENSE_END==========================================================================
17  */
18 package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice;
19
20 import java.util.Collection;
21 import java.util.Optional;
22 import org.eclipse.jdt.annotation.NonNull;
23 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
24 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
25 import org.opendaylight.mdsal.dom.api.DOMMountPoint;
26 import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
27 import org.opendaylight.yangtools.concepts.ListenerRegistration;
28 import org.opendaylight.yangtools.yang.binding.DataObject;
29 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
30 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
31 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
32
33 /**
34  * Interface handling netconf connection.
35  */
36 public interface NetconfDomAccessor extends NetconfAccessor {
37
38     /**
39      * @return the dataBroker
40      */
41     DOMDataBroker getDataBroker();
42
43     /**
44      * @return the MDSAL Mountpoint service
45      **/
46     DOMMountPoint getMountpoint();
47
48     /**
49      * Deliver the data into a class
50      * @param <T> DataObject type
51      * @param dataStoreType config or operational database
52      * @param path data path
53      * @return Optional<T> with object
54      */
55     <T extends DataObject> Optional<T> readData(LogicalDatastoreType dataStoreType, YangInstanceIdentifier path,
56             Class<T> clazz);
57
58     /**
59      * Read data from device
60      * @param dataStoreType
61      * @param path
62      * @return NormalizedNode<?, ?> with data
63      */
64     Optional<NormalizedNode<?, ?>> readDataNode(LogicalDatastoreType dataStoreType, YangInstanceIdentifier path);
65
66     /**
67      * Register netconf notification listener for related mountpoint
68      *
69      * @param <T> specific child class of DOMNotificationListener
70      * @param listener listener to be called
71      * @param types
72      * @return handler to manager registration
73      */
74     <T extends DOMNotificationListener> @NonNull ListenerRegistration<DOMNotificationListener> doRegisterNotificationListener(
75             @NonNull T listener, Collection<SchemaPath> types);
76     /**
77      * Register netconf notification listener for related mountpoint
78      *
79      * @param <T>
80      * @param listener
81      * @param types
82      * @return
83      */
84     <T extends DOMNotificationListener> @NonNull ListenerRegistration<DOMNotificationListener> doRegisterNotificationListener(
85             @NonNull T listener, SchemaPath[] types);
86
87
88
89 }