Search in sources :

Example 1 with RouterDpnListKey

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

the class NatUtil method getDpnsForRouter.

@Nonnull
public static List<BigInteger> getDpnsForRouter(DataBroker dataBroker, String routerUuid) {
    InstanceIdentifier id = InstanceIdentifier.builder(NeutronRouterDpns.class).child(RouterDpnList.class, new RouterDpnListKey(routerUuid)).build();
    Optional<RouterDpnList> routerDpnListData = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
    List<BigInteger> dpns = new ArrayList<>();
    if (routerDpnListData.isPresent()) {
        List<DpnVpninterfacesList> dpnVpninterfacesList = routerDpnListData.get().getDpnVpninterfacesList();
        for (DpnVpninterfacesList dpnVpnInterface : dpnVpninterfacesList) {
            dpns.add(dpnVpnInterface.getDpnId());
        }
    }
    return dpns;
}
Also used : RouterDpnListKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey) ArrayList(java.util.ArrayList) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) BigInteger(java.math.BigInteger) 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) Nonnull(javax.annotation.Nonnull)

Example 2 with RouterDpnListKey

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

the class NeutronvpnUtils method getDpnsForRouter.

@Nonnull
public List<BigInteger> getDpnsForRouter(String routerUuid) {
    InstanceIdentifier id = InstanceIdentifier.builder(NeutronRouterDpns.class).child(RouterDpnList.class, new RouterDpnListKey(routerUuid)).build();
    Optional<RouterDpnList> routerDpnListData = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
    List<BigInteger> dpns = new ArrayList<>();
    if (routerDpnListData.isPresent()) {
        List<DpnVpninterfacesList> dpnVpninterfacesList = routerDpnListData.get().getDpnVpninterfacesList();
        for (DpnVpninterfacesList dpnVpnInterface : dpnVpninterfacesList) {
            dpns.add(dpnVpnInterface.getDpnId());
        }
    }
    return dpns;
}
Also used : RouterDpnListKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey) ArrayList(java.util.ArrayList) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) BigInteger(java.math.BigInteger) 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) Nonnull(javax.annotation.Nonnull)

Aggregations

BigInteger (java.math.BigInteger)2 ArrayList (java.util.ArrayList)2 Nonnull (javax.annotation.Nonnull)2 RouterDpnList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList)2 RouterDpnListKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey)2 DpnVpninterfacesList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList)2 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)2