use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey in project netvirt by opendaylight.
the class FibDSWriter method removeMacEntryFromDS.
public void removeMacEntryFromDS(String rd, String macAddress) {
if (StringUtils.isEmpty(rd)) {
LOG.error("Mac {} not associated with vpn", macAddress);
return;
}
LOG.debug("Removing Mac fib entry with Mac {} from vrf table for rd {}", macAddress, rd);
InstanceIdentifierBuilder<MacVrfEntry> idBuilder = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress));
InstanceIdentifier<MacVrfEntry> macEntryId = idBuilder.build();
bgpUtil.delete(macEntryId);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey in project netvirt by opendaylight.
the class FibDSWriter method addMacEntryToDS.
public void addMacEntryToDS(String rd, String macAddress, String prefix, List<String> nextHopList, VrfEntry.EncapType encapType, long l2vni, String gatewayMacAddress, RouteOrigin origin) {
if (StringUtils.isEmpty(rd)) {
LOG.error("Mac {} not associated with vpn", macAddress);
return;
}
Preconditions.checkNotNull(nextHopList, "NextHopList can't be null");
for (String nextHop : nextHopList) {
if (StringUtils.isEmpty(nextHop)) {
LOG.error("nextHop list contains null element for macVrf");
return;
}
}
MacVrfEntryBuilder macEntryBuilder = new MacVrfEntryBuilder().setOrigin(origin.getValue());
buildVpnEncapSpecificInfo(macEntryBuilder, encapType, l2vni, gatewayMacAddress, nextHopList);
macEntryBuilder.setMac(macAddress);
macEntryBuilder.setDestPrefix(prefix);
InstanceIdentifier<MacVrfEntry> macEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress)).build();
bgpUtil.update(macEntryId, macEntryBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey in project netvirt by opendaylight.
the class EvpnTestHelper method deleteMacVrfEntryToDS.
public void deleteMacVrfEntryToDS(String rd, String macAddress) throws TransactionCommitFailedException {
InstanceIdentifier<MacVrfEntry> macEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress)).build();
singleTxdataBroker.syncDelete(LogicalDatastoreType.CONFIGURATION, macEntryId);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey in project netvirt by opendaylight.
the class EvpnTestHelper method addMacVrfEntryToDS.
public void addMacVrfEntryToDS(String rd, String macAddress, String prefix, List<String> nextHopList, VrfEntry.EncapType encapType, long l2vni, String gatewayMacAddress, RouteOrigin origin) throws TransactionCommitFailedException {
MacVrfEntryBuilder macEntryBuilder = new MacVrfEntryBuilder().setOrigin(origin.getValue());
buildVpnEncapSpecificInfo(macEntryBuilder, encapType, l2vni, macAddress, gatewayMacAddress, nextHopList);
macEntryBuilder.setMac(macAddress);
macEntryBuilder.setDestPrefix(prefix);
InstanceIdentifier<MacVrfEntry> macEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress)).build();
singleTxdataBroker.syncWrite(LogicalDatastoreType.CONFIGURATION, macEntryId, macEntryBuilder.build());
}
Aggregations