Fixed some major sonar issues in yang-validation-tool
[yangtools.git] / restconf / restconf-client-api / src / main / java / org / opendaylight / yangtools / restconf / client / api / data / Datastore.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.restconf.client.api.data;
9
10 import org.opendaylight.yangtools.yang.binding.DataObject;
11 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12
13 import com.google.common.base.Optional;
14 import com.google.common.util.concurrent.ListenableFuture;
15
16 public interface Datastore {
17
18     /**
19      * Reads data from data store and return's result in future.
20      * 
21      * This call is equivalent to invocation of {@link #readData(InstanceIdentifier, RetrievalStrategy)}
22      * with {@link DefaultRetrievalStrategy#getInstance()}.
23      * 
24      * @param path InstanceIdentifier representing path in YANG schema to be retrieved.
25      * @return Future promising the data requested. If the requested data are not present returns value of {@link Optional#absent()}.
26      * 
27      */
28     <T extends DataObject> ListenableFuture<Optional<T>> readData(InstanceIdentifier<T> path);
29     
30     /**
31      * Reads data from data store and return's result in future.
32      * 
33      * @param path Representing path in YANG schema to be retrieved.
34      * @param strategy Strategy which should be used to retrieve data
35      * @return Future promising the data requested. If the requested data are not present returns value of {@link Optional#absent()}.
36      * 
37      */
38     <T extends DataObject> ListenableFuture<Optional<T>> readData(InstanceIdentifier<T> path, RetrievalStrategy strategy);
39
40 }