Brian O'Connor | 119672d | 2014-08-03 21:36:58 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.datagrid; |
| 2 | |
| 3 | import java.util.concurrent.BlockingQueue; |
Yuta HIGUCHI | 285ec59 | 2014-08-19 23:00:27 -0700 | [diff] [blame] | 4 | import com.hazelcast.core.IMap; |
Brian O'Connor | 119672d | 2014-08-03 21:36:58 -0700 | [diff] [blame] | 5 | |
| 6 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 7 | |
| 8 | /** |
| 9 | * Interface for providing shared maps and queues to other modules. |
| 10 | */ |
| 11 | public interface ISharedCollectionsService extends IFloodlightService { |
Yuta HIGUCHI | 285ec59 | 2014-08-19 23:00:27 -0700 | [diff] [blame] | 12 | |
| 13 | // FIXME Refactor and change IMap to interface defined by us later. |
Brian O'Connor | 119672d | 2014-08-03 21:36:58 -0700 | [diff] [blame] | 14 | /** |
| 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 HIGUCHI | 285ec59 | 2014-08-19 23:00:27 -0700 | [diff] [blame] | 22 | <K, V> IMap<K, V> getConcurrentMap(String mapName, |
Brian O'Connor | 119672d | 2014-08-03 21:36:58 -0700 | [diff] [blame] | 23 | 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 | } |