/** * <p>Couples the link to a unicast {@link com.net2plan.interfaces.networkDesign.Demand} in the lower layer.</p> * @param demand The demand to be coupled to */ public void coupleToLowerLayerDemand (Demand demand) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); demand.coupleToUpperOrSameLayerLink(this); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); }
/** * <p>Creates a new {@link com.net2plan.interfaces.networkDesign.Demand Demand} in the given layer, with same end nodes as the link, and then couples the link to the new created demand.</p> * @param newDemandLayer The layer where the demand will be created (and coupled to the link) * @param routingTypeDemand Routing type * @return The created demand */ public Demand coupleToNewDemandCreated (NetworkLayer newDemandLayer , RoutingType routingTypeDemand) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); newDemandLayer.checkAttachedToNetPlanObject(this.netPlan); Demand newDemand = netPlan.addDemand(originNode , destinationNode , capacity , routingTypeDemand , null , newDemandLayer); try { newDemand.coupleToUpperOrSameLayerLink(this); } catch (RuntimeException e) { newDemand.remove (); throw e; } if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return newDemand; }
selectedDemand.coupleToUpperOrSameLayerLink(link); break;
long upperLayerLinkId = xmlStreamReader.getAttributeAsLong(xmlStreamReader.getAttributeIndex(null, "upperLayerLinkId")); long lowerLayerDemandId = xmlStreamReader.getAttributeAsLong(xmlStreamReader.getAttributeIndex(null, "lowerLayerDemandId")); mapOldId2Demand.get(lowerLayerDemandId).coupleToUpperOrSameLayerLink(mapOldId2Link.get(upperLayerLinkId)); break;
final Demand demand = np.getDemandFromId(demandId); final Link link = getSelectedElements().first(); demand.coupleToUpperOrSameLayerLink(link); break;
final Link otherUpperLink = otherDemand.getCoupledLink(); final Link thisUpperLink = (Link) thatToThisTranslation.get(otherUpperLink); thisDemand.coupleToUpperOrSameLayerLink(thisUpperLink);
/** * <p>Creates a new link in the given layer with same end nodes, and couples it to this demand.</p> * @param newLinkLayer Layer where the link will be created. * @return The new created link */ public Link coupleToNewLinkCreated (NetworkLayer newLinkLayer) { netPlan.checkIsModifiable(); checkAttachedToNetPlanObject(); newLinkLayer.checkAttachedToNetPlanObject(this.netPlan); if (isCoupled()) throw new Net2PlanException ("The demand is already coupled"); Link newLink = null; try { newLink = netPlan.addLink(ingressNode , egressNode , carriedTraffic , netPlan.getNodePairEuclideanDistance(ingressNode , egressNode) , 200000 , null , newLinkLayer); coupleToUpperOrSameLayerLink(newLink); } catch (Exception e) { if (newLink != null) newLink.remove (); throw e; } if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return newLink; }
long lowerLayerDemandId = xmlStreamReader.getAttributeAsLong(xmlStreamReader.getAttributeIndex(null, "lowerLayerDemandId")); long lowerLayerId = xmlStreamReader.getAttributeAsLong(xmlStreamReader.getAttributeIndex(null, "lowerLayerId")); mapOldId2Demand.get(Pair.of(lowerLayerId, lowerLayerDemandId)).coupleToUpperOrSameLayerLink(mapOldId2Link.get(Pair.of (upperLayerId, upperLayerLinkId))); break;
final long upperLayerLinkId = getLong ("upperLayerLinkId"); final long lowerLayerDemandId = getLong ("lowerLayerDemandId"); netPlan.getDemandFromId(lowerLayerDemandId).coupleToUpperOrSameLayerLink(netPlan.getLinkFromId(upperLayerLinkId)); break; final long coupledDemandId = getLong ("layerDemandId"); final long bundleId = getLong ("layerLinkId"); netPlan.getDemandFromId(coupledDemandId).coupleToUpperOrSameLayerLink(netPlan.getLinkFromId(bundleId)); break;
wdmLayerDemand.coupleToUpperOrSameLayerLink(ipLayerLightpath); wdmLayerDemand.coupleToUpperOrSameLayerLink(ipLayerLightpath);
IPUtils.setLinkWeight(evIp.linkAddedToFillByProcessor , (double) 1); final Demand lpWdmDemand = addedLp.getDemand(); if (lpWdmDemand.getRoutes().size() != 1) throw new Net2PlanException ("Each lightpath must be hosted in its own WDM demand"); lpWdmDemand.coupleToUpperOrSameLayerLink(evIp.linkAddedToFillByProcessor);
final long upperLayerLinkId = getLong ("upperLayerLinkId"); final long lowerLayerDemandId = getLong ("lowerLayerDemandId"); netPlan.getDemandFromId(lowerLayerDemandId).coupleToUpperOrSameLayerLink(netPlan.getLinkFromId(upperLayerLinkId)); break;