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
9 package org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.api.cache;
11 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
15 * Purpose: specify a cache driven by {@link DataTreeModification} where lookup key might differ from key used in
16 * dataStore and retrieved value is expected to be subset of <T>
18 * @param <T> dataStore object type
19 * @param <K> lookup key type
20 * @param <V> lookup result type
22 public interface DSTreeBasedCache<T extends DataObject, K, V> {
25 * @param exSource to be removed from cache
27 void invalidate(T exSource);
30 * @param newSource to be added to chache
32 void add(T newSource);
35 * update existing value
37 * @param before old value
38 * @param after new value
40 void update(T before, T after);
43 * @param key for finding cached value
44 * @return found value pair to given key or null
50 * dispose of all cached values