Search in sources :

Example 1 with FloatingIpIdToPortMappingBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingBuilder in project netvirt by opendaylight.

the class NeutronPortChangeListener method addToFloatingIpPortInfo.

// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
private void addToFloatingIpPortInfo(Uuid floatingIpId, Uuid floatingIpPortId, Uuid floatingIpPortSubnetId, String floatingIpPortMacAddress) {
    InstanceIdentifier id = buildfloatingIpIdToPortMappingIdentifier(floatingIpId);
    try {
        FloatingIpIdToPortMappingBuilder floatingipIdToPortMacMappingBuilder = new FloatingIpIdToPortMappingBuilder().setKey(new FloatingIpIdToPortMappingKey(floatingIpId)).setFloatingIpId(floatingIpId).setFloatingIpPortId(floatingIpPortId).setFloatingIpPortSubnetId(floatingIpPortSubnetId).setFloatingIpPortMacAddress(floatingIpPortMacAddress);
        LOG.debug("Creating floating IP UUID {} to Floating IP neutron port {} mapping in Floating IP" + " Port Info Config DS", floatingIpId.getValue(), floatingIpPortId.getValue());
        MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, id, floatingipIdToPortMacMappingBuilder.build());
    } catch (Exception e) {
        LOG.error("Creating floating IP UUID {} to Floating IP neutron port {} mapping in Floating IP" + " Port Info Config DS failed", floatingIpId.getValue(), floatingIpPortId.getValue(), e);
    }
}
Also used : FloatingIpIdToPortMappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingBuilder) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) FloatingIpIdToPortMappingKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingKey) ReadFailedException(org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)

Example 2 with FloatingIpIdToPortMappingBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingBuilder in project netvirt by opendaylight.

the class NeutronFloatingToFixedIpMappingChangeListener method updateFloatingIpPortInfo.

// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
private // updates FloatingIPPortInfo to have isFloatingIPDeleted set to true on a floating IP delete
void updateFloatingIpPortInfo(Uuid floatingIpId, Uuid floatingIpPortId) {
    InstanceIdentifier<FloatingIpIdToPortMapping> id = buildfloatingIpIdToPortMappingIdentifier(floatingIpId);
    try {
        FloatingIpIdToPortMappingBuilder floatingIpIdToPortMappingBuilder = new FloatingIpIdToPortMappingBuilder().setFloatingIpId(floatingIpId).setFloatingIpDeleted(true);
        LOG.debug("Updating floating IP UUID {} to Floating IP neutron port {} mapping in Floating IP" + " Port Info Config DS to set isFloatingIpDeleted flag as true", floatingIpId.getValue(), floatingIpPortId.getValue());
        MDSALUtil.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, id, floatingIpIdToPortMappingBuilder.build());
    } catch (Exception e) {
        LOG.error("Updating floating IP UUID {} to Floating IP neutron port {} mapping in Floating IP" + " Port Info Config DS to set isFloatingIpDeleted flag as true failed", floatingIpId.getValue(), floatingIpPortId.getValue(), e);
    }
}
Also used : FloatingIpIdToPortMappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingBuilder) FloatingIpIdToPortMapping(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMapping) ReadFailedException(org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)

Aggregations

ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)2 FloatingIpIdToPortMappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingBuilder)2 FloatingIpIdToPortMapping (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMapping)1 FloatingIpIdToPortMappingKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.port.info.FloatingIpIdToPortMappingKey)1 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)1