2 * Copyright (c) 2018 Inocybe Technologies 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.genius.mdsalutil.cache;
10 import org.opendaylight.infrautils.caches.CacheProvider;
11 import org.opendaylight.mdsal.binding.api.DataBroker;
12 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
17 * A DataObjectCache keyed by InstanceIdentifier.
19 * @author Thomas Pantelis
21 public class InstanceIdDataObjectCache<V extends DataObject> extends DataObjectCache<InstanceIdentifier<V>, V> {
22 public InstanceIdDataObjectCache(Class<V> dataObjectClass, DataBroker dataBroker,
23 LogicalDatastoreType datastoreType, InstanceIdentifier<V> listenerRegistrationPath,
24 CacheProvider cacheProvider) {
25 super(dataObjectClass, dataBroker, datastoreType, listenerRegistrationPath, cacheProvider,
26 (iid, value) -> iid, iid -> iid);
29 public InstanceIdDataObjectCache(Class<V> dataObjectClass, DataBroker dataBroker,
30 LogicalDatastoreType datastoreType, CacheProvider cacheProvider) {
31 super(dataObjectClass, dataBroker, datastoreType, cacheProvider, (iid, value) -> iid, iid -> iid);