Search in sources :

Example 6 with RouterDpnList

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList 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)4 ArrayList (java.util.ArrayList)3 RouterDpnList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList)3 BigInteger (java.math.BigInteger)2 Nonnull (javax.annotation.Nonnull)2 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)2 DpnRoutersList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.dpn.routers.DpnRoutersList)2 RoutersList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.dpn.routers.dpn.routers.list.RoutersList)2 RouterDpnListKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey)2 ProviderTypes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes)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 RouterDpnListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListBuilder)1 DpnVpninterfacesListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesListBuilder)1 RouterInterfacesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfacesBuilder)1 RouterInterfacesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfacesKey)1