public DpnVpninterfacesListBuilder(DpnVpninterfacesList base) { if (base.getKey() == null) { this._key = new DpnVpninterfacesListKey( base.getDpnId() ); this._dpnId = base.getDpnId(); } else { this._key = base.getKey(); this._dpnId = _key.getDpnId(); } this._routerInterfaces = base.getRouterInterfaces(); if (base instanceof DpnVpninterfacesListImpl) { DpnVpninterfacesListImpl impl = (DpnVpninterfacesListImpl) 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.router.dpn.list.DpnVpninterfacesList> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_dpnId, other.getDpnId())) { return false;
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; }
LOG.trace("Add event - key: {}, value: {}", identifier, dpnInfo); final String routerId = identifier.firstKeyOf(RouterDpnList.class).getRouterId(); BigInteger dpnId = dpnInfo.getDpnId();
LOG.trace("Remove event - key: {}, value: {}", identifier, dpnInfo); final String routerId = identifier.firstKeyOf(RouterDpnList.class).getRouterId(); BigInteger dpnId = dpnInfo.getDpnId();
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()); } }