use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class HashMapDb method putNestedTable.
@Override
public ILispDAO putNestedTable(Object key, String valueKey) {
ILispDAO nestedTable = (ILispDAO) getSpecific(key, valueKey);
if (nestedTable != null) {
LOG.warn("Trying to add nested table that already exists. Aborting!");
return nestedTable;
}
nestedTable = new HashMapDb();
put(key, new MappingEntry<>(valueKey, nestedTable));
return nestedTable;
}
use of org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO in project lispflowmapping by opendaylight.
the class HashMapDbTest method testPutNestedTable_entryExists.
@Test
public void testPutNestedTable_entryExists() throws Exception {
Object dbEntryKey = "dbEntryKey";
String mapKey1 = "mapKey1";
ILispDAO mapValue1 = new HashMapDb();
map.put(dbEntryKey, new MappingEntry<>(mapKey1, mapValue1));
Assert.assertEquals(mapValue1, map.putNestedTable(dbEntryKey, mapKey1));
Assert.assertEquals(mapValue1, map.getSpecific(dbEntryKey, mapKey1));
}
Aggregations