use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping in project lispflowmapping by opendaylight.
the class FlatMapCache method addMapping.
@Override
public void addMapping(Eid eid, Object value) {
Eid key = MaskUtil.normalize(eid);
dao.put(key, new MappingEntry<>(SubKeys.RECORD, value));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping in project lispflowmapping by opendaylight.
the class MultiTableMapCache method addMapping.
public void addMapping(Eid key, Object value) {
Eid eid = MaskUtil.normalize(key);
ILispDAO table = getOrInstantiateVniTable(key);
if (eid.getAddress() instanceof SourceDestKey) {
Eid srcKey = SourceDestKeyHelper.getSrcBinary(eid);
ILispDAO srcDstDao = getOrInstantiateSDInnerDao(eid, table);
srcDstDao.put(srcKey, new MappingEntry<>(SubKeys.RECORD, value));
} else {
table.put(eid, new MappingEntry<>(SubKeys.RECORD, value));
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping in project lispflowmapping by opendaylight.
the class SimpleMapCache method addMapping.
@Override
public void addMapping(Eid key, Object value, Set<IpAddressBinary> sourceRlocs) {
Eid eid = MaskUtil.normalize(key);
ILispDAO table = getOrInstantiateVniTable(key);
table.put(eid, new MappingEntry<>(SubKeys.RECORD, value));
if (sourceRlocs != null) {
table.put(eid, new MappingEntry<>(SubKeys.SRC_RLOCS, sourceRlocs));
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping in project lispflowmapping by opendaylight.
the class MultiTableMapCacheTest method addMappingTest_withSourceDestKey.
/**
* Tests {@link MultiTableMapCache#addMapping} with SourceDestKey address type.
*/
@Test
public void addMappingTest_withSourceDestKey() {
final Eid normalized_Eid = MaskUtil.normalize(EID_SOURCE_DEST_KEY_TYPE);
final Eid dstKey = SourceDestKeyHelper.getDstBinary(normalized_Eid);
final Eid srcKey = SourceDestKeyHelper.getSrcBinary(normalized_Eid);
when(daoMock.getSpecific(VNI, SubKeys.VNI)).thenReturn(tableDaoMock);
when(tableDaoMock.getSpecific(dstKey, SubKeys.LCAF_SRCDST)).thenReturn(srcDstDaoMock);
multiTableMapCache.addMapping(EID_SOURCE_DEST_KEY_TYPE, DUMMY_OBJECT);
verify(srcDstDaoMock).put(srcKey, new MappingEntry<>(SubKeys.RECORD, DUMMY_OBJECT));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping in project lispflowmapping by opendaylight.
the class LispSouthboundHandlerTest method cacheTest.
/**
* It tests whether map register message is stored to local cache.
*/
public void cacheTest(byte[] eidPrefixAfi, byte[] eidPrefix, byte[] authenticationData) throws InterruptedException {
final MapRegisterCacheKey mapRegisterCacheKey = MapRegisterCacheTestUtil.createMapRegisterCacheKey(eidPrefix);
MapRegisterCacheTestUtil.beforeMapRegisterInvocationValidation(mapRegisterCacheKey, mapRegisterCache);
ArgumentCaptor<AddMapping> captor = ArgumentCaptor.forClass(AddMapping.class);
mapRegisterInvocationForCacheTest(eidPrefixAfi, eidPrefix, authenticationData);
Mockito.verify(mockLispSouthboundPlugin).sendNotificationIfPossible(captor.capture());
MapRegisterCacheTestUtil.afterMapRegisterInvocationValidation(mapRegisterCacheKey, mapRegisterCache, eidPrefixAfi, eidPrefix);
}
Aggregations