Search in sources :

Example 1 with MappingKeepAlive

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAlive in project lispflowmapping by opendaylight.

the class LispSouthboundHandler method createMappingKeepAlive.

private MappingKeepAlive createMappingKeepAlive(final MapRegisterCacheValue value) {
    MappingKeepAliveBuilder mappingKeepAliveBuilder = new MappingKeepAliveBuilder();
    mappingKeepAliveBuilder.setMapRegisterCacheMetadata(value.getMapRegisterCacheMetadata());
    return mappingKeepAliveBuilder.build();
}
Also used : MappingKeepAliveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAliveBuilder)

Example 2 with MappingKeepAlive

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAlive in project lispflowmapping by opendaylight.

the class LispMappingServiceTest method onMappingKeepAliveTest.

/**
 * Tests {@link LispMappingService#onMappingKeepAlive} method.
 */
@Test
public void onMappingKeepAliveTest() {
    final MappingKeepAlive mappingKeepAlive = Mockito.mock(MappingKeepAlive.class);
    Mockito.when(mappingKeepAlive.getMapRegisterCacheMetadata()).thenReturn(getDefaultMapRegisterCacheMetadata());
    lispMappingService.onMappingKeepAlive(mappingKeepAlive);
    Mockito.verify(mappingService).refreshMappingRegistration(IPV4_EID_1, null, TIMESTAMP);
    Mockito.verify(mappingService).refreshMappingRegistration(IPV4_EID_2, null, TIMESTAMP);
}
Also used : MappingKeepAlive(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAlive) Test(org.junit.Test)

Example 3 with MappingKeepAlive

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAlive in project lispflowmapping by opendaylight.

the class LispMappingService method onMappingKeepAlive.

@Override
public void onMappingKeepAlive(MappingKeepAlive notification) {
    final MapRegisterCacheMetadata cacheMetadata = notification.getMapRegisterCacheMetadata();
    for (EidLispAddress eidLispAddress : cacheMetadata.getEidLispAddress()) {
        final Eid eid = eidLispAddress.getEid();
        final XtrId xtrId = cacheMetadata.getXtrId();
        final Long timestamp = cacheMetadata.getTimestamp();
        LOG.debug("Update map registration for eid {} with timestamp {}", LispAddressStringifier.getString(eid), timestamp);
        mapService.refreshMappingRegistration(eid, xtrId, timestamp);
    }
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) EidLispAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddress) MapRegisterCacheMetadata(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.MapRegisterCacheMetadata) XtrId(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId)

Aggregations

Test (org.junit.Test)1 MappingKeepAlive (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAlive)1 MappingKeepAliveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MappingKeepAliveBuilder)1 XtrId (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId)1 Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)1 MapRegisterCacheMetadata (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.MapRegisterCacheMetadata)1 EidLispAddress (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddress)1