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