Search in sources :

Example 26 with ILispDAO

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;
}
Also used : ILispDAO(org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)

Example 27 with ILispDAO

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));
}
Also used : ILispDAO(org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO) Test(org.junit.Test)

Aggregations

ILispDAO (org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)27 Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)19 SourceDestKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey)7 Test (org.junit.Test)4 XtrId (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId)1 MappingAuthkey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey)1