3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
11 * @file ICacheUpdateAware.java
13 * @brief Interface for getting clustered cache updates
15 * Interface that needs to be implemented by the components
16 * that want to be informed of an update in a Clustered Cache. The
17 * interface need to be registerd in the OSGi service registry with a
18 * property "cachenames" which will contains a PropertySet object
19 * listing all the caches for which their is interes.
21 package org.opendaylight.controller.clustering.services;
24 * Interface that needs to be implemented by the components
25 * that want to be informed of an update in a Clustered Cache. The
26 * interface need to be registerd in the OSGi service registry with a
27 * property "cachenames" which will contains a PropertySet object
28 * listing all the caches for which their is interes.
31 public interface ICacheUpdateAware<K, V> {
33 * Invoked when a new entry is available in the cache, the key is
34 * only provided, the value will come as an entryUpdate invocation
36 * @param key Key for the entry just created
37 * @param cacheName name of the cache for which update has been
39 * @param originLocal true if the event is generated from this
42 void entryCreated(K key, String cacheName, boolean originLocal);
45 * Called anytime a given entry is updated
47 * @param key Key for the entry modified
48 * @param new_value the new value the key will have
49 * @param cacheName name of the cache for which update has been
51 * @param originLocal true if the event is generated from this
54 void entryUpdated(K key, V new_value, String cacheName, boolean originLocal);
57 * Called anytime a given key is removed from the
58 * ConcurrentHashMap we are listening to.
60 * @param key Key of the entry removed
61 * @param cacheName name of the cache for which update has been
63 * @param originLocal true if the event is generated from this
66 void entryDeleted(K key, String cacheName, boolean originLocal);