use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.neutron.vpn.portip.port.data.VpnPortipToPortBuilder in project netvirt by opendaylight.
the class NeutronvpnUtils method createVpnPortFixedIpToPort.
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
protected void createVpnPortFixedIpToPort(String vpnName, String fixedIp, String portName, String macAddress, boolean isSubnetIp, WriteTransaction writeConfigTxn) {
InstanceIdentifier<VpnPortipToPort> id = NeutronvpnUtils.buildVpnPortipToPortIdentifier(vpnName, fixedIp);
VpnPortipToPortBuilder builder = new VpnPortipToPortBuilder().setKey(new VpnPortipToPortKey(fixedIp, vpnName)).setVpnName(vpnName).setPortFixedip(fixedIp).setPortName(portName).setMacAddress(macAddress).setSubnetIp(isSubnetIp);
try {
if (writeConfigTxn != null) {
writeConfigTxn.put(LogicalDatastoreType.CONFIGURATION, id, builder.build());
} else {
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, id, builder.build());
}
LOG.trace("Neutron port with fixedIp: {}, vpn {}, interface {}, mac {}, isSubnetIp {} added to " + "VpnPortipToPort DS", fixedIp, vpnName, portName, macAddress, isSubnetIp);
} catch (Exception e) {
LOG.error("Failure while creating VPNPortFixedIpToPort map for vpn {} - fixedIP {}", vpnName, fixedIp, e);
}
}
Aggregations