blob: a3986357623d6018ada14511827f40546acf5852 [file] [log] [blame]
Brian O'Connor119672d2014-08-03 21:36:58 -07001package net.onrc.onos.core.datagrid;
2
3import java.util.concurrent.BlockingQueue;
Yuta HIGUCHI285ec592014-08-19 23:00:27 -07004import com.hazelcast.core.IMap;
Brian O'Connor119672d2014-08-03 21:36:58 -07005
6import net.floodlightcontroller.core.module.IFloodlightService;
7
8/**
9 * Interface for providing shared maps and queues to other modules.
10 */
11public interface ISharedCollectionsService extends IFloodlightService {
Yuta HIGUCHI285ec592014-08-19 23:00:27 -070012
13 // FIXME Refactor and change IMap to interface defined by us later.
Brian O'Connor119672d2014-08-03 21:36:58 -070014 /**
15 * Create an shared, concurrent map.
16 *
17 * @param mapName the shared map name.
18 * @param typeK the type of the Key in the map.
19 * @param typeV the type of the Value in the map.
20 * @return the shared map for the channel name.
21 */
Yuta HIGUCHI285ec592014-08-19 23:00:27 -070022 <K, V> IMap<K, V> getConcurrentMap(String mapName,
Brian O'Connor119672d2014-08-03 21:36:58 -070023 Class<K> typeK, Class<V> typeV);
24
25 /**
26 * Create an shared, blocking queue.
27 *
28 * @param queueName the shared queue name.
29 * @param typeT the type of the queue.
30 * @return the shared queue for the queue name.
31 */
32 <T> BlockingQueue<T> getBlockingQueue(String queueName,
33 Class<T> typeT);
34}