@Test public void testSetFailureState() { link12.setFailureState(false); assertTrue (link12.isDown()); assertTrue (!upperLink12.isDown()); link12.setFailureState(true); assertTrue (!link12.isDown()); upperLink12.setFailureState(false); assertTrue (upperLink12.isDown()); upperLink12.setFailureState(true); assertTrue (!upperLink12.isDown()); }
public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.isUp == setAsUp) return this.isUp; List<Link> aux = new LinkedList<Link> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (aux , null , null , null); else netPlan.setLinksAndNodesFailureState (null, aux , null , null); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; }
Link extends NetworkElement implements IMonitorizableElement { public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.isUp == setAsUp) return this.isUp; List<Link> aux = new LinkedList<Link> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (aux , null , null , null); else netPlan.setLinksAndNodesFailureState (null, aux , null , null); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; } }
Link extends NetworkElement implements IMonitorizableElement { public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.isUp == setAsUp) return this.isUp; List<Link> aux = new LinkedList<Link> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (aux , null , null , null); else netPlan.setLinksAndNodesFailureState (null, aux , null , null); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; } protected  Link(NetPlan netPlan , long id , int index , NetworkLayer layer , Node originNode , Node destinationNode , double lengthInKm , double propagationSpeedInKmPerSecond , double capacity , AttributeMap attributes); }
Link extends NetworkElement implements IMonitorizableElement { public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.isUp == setAsUp) return this.isUp; List<Link> aux = new LinkedList<Link> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (aux , null , null , null); else netPlan.setLinksAndNodesFailureState (null, aux , null , null); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; } protected  Link(NetPlan netPlan , long id , int index , NetworkLayer layer , Node originNode , Node destinationNode , double lengthInKm , double propagationSpeedInKmPerSecond , double capacity , AttributeMap attributes); Color getNominalColor(); void setNominalColor(Color nominalColor); double getOccupiedCapacityFromDemand(Demand d); Pair<Double,Double> getQosOccupationAndQosViolation(String qosType); Pair<Integer,Double> getQosTypePriorityAndMaxLinkUtilization(String qosType); SortedMap<String,Pair<Integer,Double>> getQosTypePriorityAndMaxLinkUtilizationMap(); void setQosTypePriorityAndMaxLinkUtilization(String qosType , int priority , double maxLinkUtilization); void removeQosTypePriorityAndMaxLinkUtilization(String qosType); SortedMap<String,Pair<Double,Double>> getPerQoSOccupationAndQosViolationMap(); SortedSet<Demand> getDemandsWithNonZeroForwardingRules(); Node getOriginNode(); Node getDestinationNode(); NetworkLayer getLayer(); Demand getCoupledDemand(); MulticastDemand getCoupledMulticastDemand(); boolean isCoupled(); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(); double getCapacity(); void setCapacity(double newLinkCapacity); double getCarriedTraffic(); SortedSet<Route> getTraversingBackupRoutes(); int getNumberOfTraversingBackupRoutes(); double getUtilization(); double getOccupiedCapacity(); double getOccupiedCapacityOnlyBackupRoutes(); double getLengthInKm(); void setLengthInKm(double lengthInKm); double getPropagationSpeedInKmPerSecond(); double getMulticastCarriedTraffic(); double getMulticastOccupiedLinkCapacity(); void setPropagationSpeedInKmPerSecond(double speed); double getPropagationDelayInMs(); boolean isUp(); boolean isDown(); boolean isOversubscribed(); double getOversubscribedTraffic(); SortedSet<SharedRiskGroup> getSRGs(); SortedSet<Route> getTraversingRoutes(); SortedMap<Route,Integer> getTraversingRoutesAndMultiplicity(); int getNumberOfTraversingRoutes(); SortedSet<MulticastTree> getTraversingTrees(); int getNumberOfTraversingTrees(); int getNumberOfForwardingRules(); void coupleToLowerLayerDemand(Demand demand); Demand coupleToNewDemandCreated(NetworkLayer newDemandLayer , RoutingType routingTypeDemand); void removeAllForwardingRules(); Link getBidirectionalPair(); void setBidirectionalPair(Link e); boolean isBidirectional(); Link createBidirectionalPair(); void remove(); boolean setFailureState(boolean setAsUp); @Override String toString(); SortedSet<String> getQosViolated(); boolean isQoSViolated(String qosType); Triple<SortedSet<Demand>,SortedSet<Demand>,SortedSet<MulticastDemand>> getDemandsPotentiallyTraversingThisLink(); Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> getLinksThisLayerPotentiallyCarryingTrafficTraversingThisLink(); Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> getLinksDownPropagationPotentiallyCarryingTrafficTraversingThisLink(); boolean isCoupledInSameLayer(); boolean isCoupledInDifferentLayer(); void decouple(); @Override TrafficSeries getMonitoredOrForecastedCarriedTraffic(); @Override void setMonitoredOrForecastedCarriedTraffic(TrafficSeries newTimeSeries); @Override double getCurrentTrafficToAddMonitSample(); @Override boolean isPossibleToSetCurrentTrafficAsGivenMonitSample(); @Override void setCurrentTrafficToGivenMonitSample(double traffic); @Override Optional<TrafficPredictor> getTrafficPredictor(); @Override void setTrafficPredictor(TrafficPredictor tp); @Override void removeTrafficPredictor(); }
Link extends NetworkElement implements IMonitorizableElement { public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.isUp == setAsUp) return this.isUp; List<Link> aux = new LinkedList<Link> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (aux , null , null , null); else netPlan.setLinksAndNodesFailureState (null, aux , null , null); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; } protected  Link(NetPlan netPlan , long id , int index , NetworkLayer layer , Node originNode , Node destinationNode , double lengthInKm , double propagationSpeedInKmPerSecond , double capacity , AttributeMap attributes); Color getNominalColor(); void setNominalColor(Color nominalColor); double getOccupiedCapacityFromDemand(Demand d); Pair<Double,Double> getQosOccupationAndQosViolation(String qosType); Pair<Integer,Double> getQosTypePriorityAndMaxLinkUtilization(String qosType); SortedMap<String,Pair<Integer,Double>> getQosTypePriorityAndMaxLinkUtilizationMap(); void setQosTypePriorityAndMaxLinkUtilization(String qosType , int priority , double maxLinkUtilization); void removeQosTypePriorityAndMaxLinkUtilization(String qosType); SortedMap<String,Pair<Double,Double>> getPerQoSOccupationAndQosViolationMap(); SortedSet<Demand> getDemandsWithNonZeroForwardingRules(); Node getOriginNode(); Node getDestinationNode(); NetworkLayer getLayer(); Demand getCoupledDemand(); MulticastDemand getCoupledMulticastDemand(); boolean isCoupled(); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(); double getCapacity(); void setCapacity(double newLinkCapacity); double getCarriedTraffic(); SortedSet<Route> getTraversingBackupRoutes(); int getNumberOfTraversingBackupRoutes(); double getUtilization(); double getOccupiedCapacity(); double getOccupiedCapacityOnlyBackupRoutes(); double getLengthInKm(); void setLengthInKm(double lengthInKm); double getPropagationSpeedInKmPerSecond(); double getMulticastCarriedTraffic(); double getMulticastOccupiedLinkCapacity(); void setPropagationSpeedInKmPerSecond(double speed); double getPropagationDelayInMs(); boolean isUp(); boolean isDown(); boolean isOversubscribed(); double getOversubscribedTraffic(); SortedSet<SharedRiskGroup> getSRGs(); SortedSet<Route> getTraversingRoutes(); SortedMap<Route,Integer> getTraversingRoutesAndMultiplicity(); int getNumberOfTraversingRoutes(); SortedSet<MulticastTree> getTraversingTrees(); int getNumberOfTraversingTrees(); int getNumberOfForwardingRules(); void coupleToLowerLayerDemand(Demand demand); Demand coupleToNewDemandCreated(NetworkLayer newDemandLayer , RoutingType routingTypeDemand); void removeAllForwardingRules(); Link getBidirectionalPair(); void setBidirectionalPair(Link e); boolean isBidirectional(); Link createBidirectionalPair(); void remove(); boolean setFailureState(boolean setAsUp); @Override String toString(); SortedSet<String> getQosViolated(); boolean isQoSViolated(String qosType); Triple<SortedSet<Demand>,SortedSet<Demand>,SortedSet<MulticastDemand>> getDemandsPotentiallyTraversingThisLink(); Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> getLinksThisLayerPotentiallyCarryingTrafficTraversingThisLink(); Triple<SortedMap<Demand,SortedSet<Link>>,SortedMap<Demand,SortedSet<Link>>,SortedMap<Pair<MulticastDemand,Node>,SortedSet<Link>>> getLinksDownPropagationPotentiallyCarryingTrafficTraversingThisLink(); boolean isCoupledInSameLayer(); boolean isCoupledInDifferentLayer(); void decouple(); @Override TrafficSeries getMonitoredOrForecastedCarriedTraffic(); @Override void setMonitoredOrForecastedCarriedTraffic(TrafficSeries newTimeSeries); @Override double getCurrentTrafficToAddMonitSample(); @Override boolean isPossibleToSetCurrentTrafficAsGivenMonitSample(); @Override void setCurrentTrafficToGivenMonitSample(double traffic); @Override Optional<TrafficPredictor> getTrafficPredictor(); @Override void setTrafficPredictor(TrafficPredictor tp); @Override void removeTrafficPredictor();  }