if (!Objects.equals(_dpnVpninterfacesList, other.getDpnVpninterfacesList())) { return false; if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_routerId, other.getRouterId())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
public RouterDpnListBuilder(RouterDpnList base) { if (base.getKey() == null) { this._key = new RouterDpnListKey( base.getRouterId() ); this._routerId = base.getRouterId(); } else { this._key = base.getKey(); this._routerId = _key.getRouterId(); } this._dpnVpninterfacesList = base.getDpnVpninterfacesList(); if (base instanceof RouterDpnListImpl) { RouterDpnListImpl impl = (RouterDpnListImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
public void updateTrasportZone(RouterDpnList routerDpnList) { try{ InstanceIdentifier<TransportZone> inst = InstanceIdentifier.create(TransportZones.class). child(TransportZone.class, new TransportZoneKey(routerDpnList.getRouterId())); TransportZone zone = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, inst); String subnetIp = ALL_SUBNETS; if (zone == null) { zone = createZone(subnetIp, routerDpnList.getRouterId()); } int addedTeps = 0; for (DpnVpninterfacesList dpnVpninterfacesList : routerDpnList.getDpnVpninterfacesList()) { BigInteger dpnId = dpnVpninterfacesList.getDpnId(); addedTeps += addVtep(zone, subnetIp, dpnId); } if (addedTeps > 0) { addTransportZone(zone, "router " + routerDpnList.getRouterId()); } } catch (Exception e) { LOG.warn("failed to add tunnels on router added of routerDpnList {} due to {}", routerDpnList, e.getMessage()); } }
public static Set<RouterDpnList> getAllRouterDpnList(DataBroker broker, BigInteger dpid) { Set<RouterDpnList> ret = new HashSet<>(); InstanceIdentifier<NeutronRouterDpns> routerDpnId = InstanceIdentifier.create(NeutronRouterDpns.class); Optional<NeutronRouterDpns> neutronRouterDpnsOpt = MDSALUtil.read(broker, 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; }
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 = read(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; } return null; }