X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fadsal%2Fclustering%2Fservices%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fservices%2FICacheUpdateAware.java;fp=opendaylight%2Fadsal%2Fclustering%2Fservices%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fservices%2FICacheUpdateAware.java;h=187309ba82bb7ff19da92446c874910846d624f9;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hp=0000000000000000000000000000000000000000;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b;p=controller.git diff --git a/opendaylight/adsal/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/ICacheUpdateAware.java b/opendaylight/adsal/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/ICacheUpdateAware.java new file mode 100644 index 0000000000..187309ba82 --- /dev/null +++ b/opendaylight/adsal/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/ICacheUpdateAware.java @@ -0,0 +1,67 @@ + +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +/** + * @file ICacheUpdateAware.java + * + * @brief Interface for getting clustered cache updates + * + * Interface that needs to be implemented by the components + * that want to be informed of an update in a Clustered Cache. The + * interface need to be registerd in the OSGi service registry with a + * property "cachenames" which will contains a PropertySet object + * listing all the caches for which their is interes. + */ +package org.opendaylight.controller.clustering.services; + +/** + * Interface that needs to be implemented by the components + * that want to be informed of an update in a Clustered Cache. The + * interface need to be registerd in the OSGi service registry with a + * property "cachenames" which will contains a PropertySet object + * listing all the caches for which their is interes. + * + */ +public interface ICacheUpdateAware { + /** + * Invoked when a new entry is available in the cache, the key is + * only provided, the value will come as an entryUpdate invocation + * + * @param key Key for the entry just created + * @param cacheName name of the cache for which update has been + * received + * @param originLocal true if the event is generated from this + * node + */ + void entryCreated(K key, String cacheName, boolean originLocal); + + /** + * Called anytime a given entry is updated + * + * @param key Key for the entry modified + * @param new_value the new value the key will have + * @param cacheName name of the cache for which update has been + * received + * @param originLocal true if the event is generated from this + * node + */ + void entryUpdated(K key, V new_value, String cacheName, boolean originLocal); + + /** + * Called anytime a given key is removed from the + * ConcurrentHashMap we are listening to. + * + * @param key Key of the entry removed + * @param cacheName name of the cache for which update has been + * received + * @param originLocal true if the event is generated from this + * node + */ + void entryDeleted(K key, String cacheName, boolean originLocal); +}