ac31581ee2a761215335b59f315b481b8d864802
[groupbasedpolicy.git] / sxp-mapper / src / main / java / org / opendaylight / groupbasedpolicy / sxp / mapper / api / DSAsyncDao.java
1 /**
2  * Copyright (c) 2016 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.groupbasedpolicy.sxp.mapper.api;
9
10 import com.google.common.base.Optional;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14
15 /**
16  * Purpose: encapsulate access to DS by exposing
17  * <dl>
18  * <dt>read</dt>
19  * <dd>search through values (either in local cache or directly in DataStore)</dd>
20  * </dl>
21  *
22  * @param <K> data key type
23  * @param <V> data type
24  */
25 public interface DSAsyncDao<K, V extends DataObject> {
26
27     /**
28      * @param key for search
29      * @return value found by key
30      */
31     ListenableFuture<Optional<V>> read(@Nonnull K key);
32
33 }