Search in sources :

Example 11 with DpnVpninterfacesList

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList in project netvirt by opendaylight.

the class NeutronvpnUtils method getAllRouterDpnList.

public Set<RouterDpnList> getAllRouterDpnList(BigInteger dpid) {
    Set<RouterDpnList> ret = new HashSet<>();
    InstanceIdentifier<NeutronRouterDpns> routerDpnId = InstanceIdentifier.create(NeutronRouterDpns.class);
    Optional<NeutronRouterDpns> neutronRouterDpnsOpt = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, routerDpnId);
    if (neutronRouterDpnsOpt.isPresent()) {
        NeutronRouterDpns neutronRouterDpns = neutronRouterDpnsOpt.get();
        List<RouterDpnList> routerDpnLists = neutronRouterDpns.getRouterDpnList();
        for (RouterDpnList routerDpnList : routerDpnLists) {
            if (routerDpnList.getDpnVpninterfacesList() != null) {
                for (DpnVpninterfacesList dpnInterfaceList : routerDpnList.getDpnVpninterfacesList()) {
                    if (dpnInterfaceList.getDpnId().equals(dpid)) {
                        ret.add(routerDpnList);
                    }
                }
            }
        }
    }
    return ret;
}
Also used : DpnVpninterfacesList(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList) RouterDpnList(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList) NeutronRouterDpns(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.NeutronRouterDpns) HashSet(java.util.HashSet)

Aggregations

DpnVpninterfacesList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList)9 BigInteger (java.math.BigInteger)7 RouterInterfacesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfacesBuilder)6 RouterInterfacesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfacesKey)6 ArrayList (java.util.ArrayList)5 RouterDpnList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList)5 RouterInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfaces)3 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 Nonnull (javax.annotation.Nonnull)2 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)2 RouterDpnListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListBuilder)2 RouterDpnListKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey)2 DpnVpninterfacesListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesListBuilder)2 Routers (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.Routers)2 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)2 HashSet (java.util.HashSet)1 NeutronRouterDpns (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.NeutronRouterDpns)1 ProviderTypes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes)1