2 * Copyright (c) 2014 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.yangtools.restconf.client.api.data;
10 import org.opendaylight.yangtools.yang.binding.DataObject;
11 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
13 import com.google.common.base.Optional;
14 import com.google.common.util.concurrent.ListenableFuture;
16 public interface Datastore {
19 * Reads data from data store and return's result in future.
21 * This call is equivalent to invocation of {@link #readData(InstanceIdentifier, RetrievalStrategy)}
22 * with {@link DefaultRetrievalStrategy#getInstance()}.
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()}.
28 <T extends DataObject> ListenableFuture<Optional<T>> readData(InstanceIdentifier<T> path);
31 * Reads data from data store and return's result in future.
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()}.
38 <T extends DataObject> ListenableFuture<Optional<T>> readData(InstanceIdentifier<T> path, RetrievalStrategy strategy);