752e3c6b9b28f6b3256776cca5ec0d1a1a5f6180
[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.concurrent.atomic.AtomicBoolean;
21 import java.util.concurrent.atomic.AtomicReference;
22 import org.eclipse.jdt.annotation.Nullable;
23 import org.opendaylight.mdsal.binding.api.DataBroker;
24 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
25 import org.opendaylight.yangtools.yang.binding.DataObject;
26 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
27
28 /**
29  * @author herbert
30  *
31  */
32 public interface TransactionUtils {
33
34     /**
35      * Deliver the data back or null. Warning
36      *
37      * @param <T> SubType of the DataObject to be handled
38      * @param dataBroker for accessing data
39      * @param dataStoreType to address datastore
40      * @param iid id to access data
41      * @return null or object
42      */
43     @Nullable
44     <T extends DataObject> T readData(DataBroker dataBroker, LogicalDatastoreType dataStoreType,
45             InstanceIdentifier<T> iid);
46
47     /**
48      * Deliver the data back or null
49      *
50      * @param <T> SubType of the DataObject to be handled
51      * @param dataBroker for accessing data
52      * @param dataStoreType to address datastore
53      * @param iid id to access data
54      * @param noErrorIndication (Output) true if data could be read and are available and is not null
55      * @param statusIndicator (Output) String with status indications during the read.
56      * @return null or object
57      */
58     @Nullable
59     <T extends DataObject> T readDataOptionalWithStatus(DataBroker dataBroker, LogicalDatastoreType dataStoreType,
60             InstanceIdentifier<T> iid, AtomicBoolean noErrorIndication, AtomicReference<String> statusIndicator);
61
62 }