Search in sources :

Example 1 with NeutronRouterDpns

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.NeutronRouterDpns 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

HashSet (java.util.HashSet)1 NeutronRouterDpns (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.NeutronRouterDpns)1 RouterDpnList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList)1 DpnVpninterfacesList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList)1