NETVIRT-1062: refactor SubnetmapChangeListener 58/68558/18
authorValentina <valentina.krasnobaeva@6wind.com>
Thu, 15 Mar 2018 13:37:19 +0000 (14:37 +0100)
committerSam Hague <shague@redhat.com>
Fri, 23 Mar 2018 04:05:26 +0000 (04:05 +0000)
commitbe3d631b6d22472982b35c3350815c210ffc5d7f
tree96b58f417d82114a1d64ae248408c22d49d505dc
parent44b5e04a0517e0e33c88d7325d894b6a4386c4e2
NETVIRT-1062: refactor SubnetmapChangeListener

* SubnetmapChangeListener:

    don't need to call vpnSubnetRouteHandler.onSubnetAddedToVpn method
    second time if Subnetmap.getInternetVpnId attribute was set.
    According to initial design,
    vpnSubnetRouteHandler.onSubnetAddedToVpn method doesn't take in
    account InternetVpnId, when it creates/updates/removes
    SubnetOpDataEntry for the given Subnetmap.

* ExternalSubnetVpnInstanceListener:

    fix potential race condition. It is better at first to create an
    Internal VPN instance for the given provider subnet and only then
    try to update all corresponding objects.

* NeutronvpnManager:

  ** updateVpnInternetForSubnet:
    should always keep set VpnId attribute for updating Subnetmap.

  ** associateExtNetworkToVpn and disassociateExtNetworkFromVpn:
    to avoid race conditions it is better at first to update BgpVpnType
    of VPN instance and only then to update associated/disassociated
    SubnetMaps with a new InternetVpnId/null.

JIRA: NETVIRT-1062
Change-Id: Ia388b9112f2ca683864c2c15d8ac44ed0e0c25b8
Signed-off-by: Valentina <valentina.krasnobaeva@6wind.com>
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronExternalSubnetHandler.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnManager.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/SubnetmapChangeListener.java