@@ -0,0 +1,1031 @@
+package net.floodlightcontroller.odinmaster;%0A%0Aimport java.net.InetAddress;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0Apublic class PoolManager %7B%0A%09%0A%09static public final String GLOBAL_POOL = %22global%22;%0A%09private final Map%3CInetAddress, List%3CString%3E%3E agentToPoolListMap = new ConcurrentHashMap%3CInetAddress, List%3CString%3E%3E();%0A%09%0A%09public List%3CString%3E getPoolsForAgent(InetAddress agentInetAddr) %7B%0A%09%09if (agentToPoolListMap.containsKey(agentInetAddr))%0A%09%09%09return Collections.unmodifiableList(agentToPoolListMap.get(agentInetAddr));%0A%09%09else%0A%09%09%09return new ArrayList%3CString%3E();%0A%09%7D%0A%09%0A%09public void addPoolForAgent(InetAddress agentInetAddr, String pool) %7B%0A%09%09if (agentToPoolListMap.containsKey(agentInetAddr)) %7B%0A%09%09%09agentToPoolListMap.get(agentInetAddr).add(pool);%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09List%3CString%3E poolList = new ArrayList%3CString%3E();%0A%09%09%09poolList.add(GLOBAL_POOL);%0A%09%09%09poolList.add(pool);%0A%09%09%09agentToPoolListMap.put(agentInetAddr, poolList);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add PoolManager source file