Bug 1029: Remove dead code: samples/clustersession
[controller.git] / opendaylight / clustering / services / src / main / java / org / opendaylight / controller / clustering / services / ICacheUpdateAware.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
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
8  */
9
10 /**
11  * @file   ICacheUpdateAware.java
12  *
13  * @brief Interface for getting clustered cache updates
14  *
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.
20  */
21 package org.opendaylight.controller.clustering.services;
22
23 /**
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.
29  *
30  */
31 public interface ICacheUpdateAware<K, V> {
32     /**
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
35      *
36      * @param key Key for the entry just created
37      * @param cacheName name of the cache for which update has been
38      * received
39      * @param originLocal true if the event is generated from this
40      * node
41      */
42     void entryCreated(K key, String cacheName, boolean originLocal);
43
44     /**
45      * Called anytime a given entry is updated
46      *
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
50      * received
51      * @param originLocal true if the event is generated from this
52      * node
53      */
54     void entryUpdated(K key, V new_value, String cacheName, boolean originLocal);
55
56     /**
57      * Called anytime a given key is removed from the
58      * ConcurrentHashMap we are listening to.
59      *
60      * @param key Key of the entry removed
61      * @param cacheName name of the cache for which update has been
62      * received
63      * @param originLocal true if the event is generated from this
64      * node
65      */
66     void entryDeleted(K key, String cacheName, boolean originLocal);
67 }