use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.
the class DSBEInputUtil method toAuthenticationKey.
public static AuthenticationKey toAuthenticationKey(Eid key, MappingAuthkey authKey) {
AuthenticationKeyBuilder akb = new AuthenticationKeyBuilder();
akb.setEidUri(new EidUri(LispAddressStringifier.getURIString(key)));
akb.setEid(key);
akb.setMappingAuthkey(authKey);
return akb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.
the class LispNotificationHelper method getMapping.
public static List<Mapping> getMapping(AddMapping mapRegisterNotification) {
List<Mapping> mappings = new ArrayList<Mapping>();
for (int i = 0; i < mapRegisterNotification.getMapRegister().getMappingRecordItem().size(); i++) {
MappingRecord record = mapRegisterNotification.getMapRegister().getMappingRecordItem().get(i).getMappingRecord();
MappingBuilder mb = new MappingBuilder();
mb.setEidUri(new EidUri(LispAddressStringifier.getURIString(record.getEid())));
mb.setOrigin(MappingOrigin.Southbound);
mb.setSiteId(getSiteId(mapRegisterNotification.getMapRegister()));
mb.setMappingRecord(record);
mappings.add(mb.build());
}
return mappings;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.
the class RPCInputConvertorUtil method toAuthenticationKey.
private static AuthenticationKey toAuthenticationKey(Eid address, MappingAuthkey key) {
AuthenticationKeyBuilder akb = new AuthenticationKeyBuilder();
akb.setEidUri(new EidUri(LispAddressStringifier.getURIString(address)));
akb.setEid(address);
if (key != null) {
akb.setMappingAuthkey(key);
}
return akb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.
the class RPCInputConvertorUtil method toMapping.
private static Mapping toMapping(MappingRecord mapping) {
MappingBuilder mb = new MappingBuilder();
mb.setEidUri(new EidUri(LispAddressStringifier.getURIString(mapping.getEid())));
mb.setOrigin(MappingOrigin.Northbound);
mb.setMappingRecord(mapping);
return mb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getMappingTest.
/**
* Tests {@link LispNotificationHelper#getMapping} method with invalid address.
*/
@Test
public void getMappingTest() {
final MappingBuilder mappingBuilder_1 = new MappingBuilder().setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV4).build()).setEidUri(new EidUri("ipv4:" + IPV4_STRING)).setOrigin(MappingOrigin.Southbound).setSiteId(Lists.newArrayList(SITE_ID));
final MappingBuilder mappingBuilder_2 = new MappingBuilder().setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV6).build()).setEidUri(new EidUri("ipv6:" + IPV6_STRING)).setOrigin(MappingOrigin.Southbound).setSiteId(Lists.newArrayList(SITE_ID));
assertEquals(Lists.newArrayList(mappingBuilder_1.build(), mappingBuilder_2.build()), LispNotificationHelper.getMapping(getDefaultAddMapping(true)));
}
Aggregations