2 * Copyright (c) 2016 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.groupbasedpolicy.sxp.mapper.api;
10 import javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
14 * Purpose: encapsulate access to DS by exposing
17 * <dd>search through cached values</dd>
19 * <dd>stores given pair (key, value) to local cache</dd>
22 * @param <K> data key type
23 * @param <V> data type
25 public interface SimpleCachedDao<K, V> extends SimpleDao<K, V> {
28 * store given pair to local cache
30 * @param key associated to value
31 * @param value associated to key
33 V update(@Nonnull K key, @Nullable V value);
36 * invalidate all cache entries
38 void invalidateCache();
41 * @return true if there is nothing cached
46 * @return unmodifiable iterator through all cached values