Priyanka B

[ONOS-4794] [ONOS-4793] [ONOS-4669]TE_COST and bandwidth information on update flow was not correct

Change-Id: Ib91b7c47c95e005a0ace1fdaa7e82fbdb7f02533
......@@ -27,9 +27,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.onlab.packet.Ethernet;
import org.onlab.packet.IPv4;
......@@ -263,9 +261,6 @@ public class PceManager implements PceService {
packetService.addProcessor(processor, PacketProcessor.director(4));
topologyService.addListener(topologyListener);
executor = Executors.newSingleThreadScheduledExecutor();
//Start a timer when the component is up, with initial delay of 30min and periodic delays at 30min
executor.scheduleAtFixedRate(new GlobalOptimizationTimer(), INITIAL_DELAY, PERIODIC_DELAY, TimeUnit.MINUTES);
// Reserve global node pool
if (!srTeHandler.reserveGlobalPool(GLOBAL_LABEL_SPACE_MIN, GLOBAL_LABEL_SPACE_MAX)) {
......@@ -283,8 +278,6 @@ public class PceManager implements PceService {
netCfgService.removeListener(cfgListener);
packetService.removeProcessor(processor);
topologyService.removeListener(topologyListener);
// Shutdown the thread when component is deactivated
executor.shutdown();
log.info("Stopped");
}
......
......@@ -495,7 +495,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
log.info("[exceptionCaught]: " + e.toString());
log.error("[exceptionCaught]: " + e.toString());
if (e.getCause() instanceof ReadTimeoutException) {
// device timeout
......
......@@ -1531,7 +1531,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
bandwidth = attributes.getBandwidthObject().getBandwidth();
}
}
List<Object> eroSubObjList = buildPathFromEroObj(eroObj, providerId);
List<Link> links = new ArrayList<>();
List<LabelResourceId> labels = new ArrayList<>();
......@@ -1542,10 +1541,8 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
labels.add(LabelResourceId.labelResourceId(((Integer) linkOrLabel).longValue()));
}
}
Path path = new DefaultPath(providerId, links, cost, EMPTY);
NetworkResource labelStack = new DefaultLabelStack(labels);
// To carry PST TLV, SRP object can be present with value 0 even when PCRpt is not in response to any action
// from PCE.
PcepSrpObject srpObj = stateRpt.getSrpObject();
......@@ -1577,7 +1574,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
log.error("Stateful IPv4 identifier TLV is null in PCRpt msg.");
return;
}
IpTunnelEndPoint tunnelEndPointSrc = IpTunnelEndPoint
.ipTunnelPoint(IpAddress.valueOf(ipv4LspIdenTlv.getIpv4IngressAddress()));
IpTunnelEndPoint tunnelEndPointDst = IpTunnelEndPoint
......@@ -1591,7 +1587,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
pcepClientController.getClient(pccId).setLspAndDelegationInfo(
new LspKey(lspObj.getPlspId(), ipv4LspIdenTlv.getLspId()), lspObj.getDFlag());
}
Tunnel tunnel = null;
// Asynchronous status change message from PCC for LSP reported earlier.
for (Tunnel tunnelObj : tunnelQueryResult) {
......@@ -1684,7 +1679,13 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
//delegated owner will update can be a master or non-master
if (lspObj.getDFlag()) {
annotations = getAnnotations(lspObj, ipv4LspIdenTlv, bandwidth, lspType, costType);
if (tunnel.annotations().value(BANDWIDTH) != null) {
bandwidth = Float.parseFloat(tunnel.annotations().value(BANDWIDTH));
}
annotations = getAnnotations(lspObj, ipv4LspIdenTlv,
bandwidth, lspType,
tunnel.annotations().value(COST_TYPE));
td = new DefaultTunnelDescription(null, tunnelEndPointSrc, tunnelEndPointDst, MPLS, new DefaultGroupId(
0), providerId, TunnelName.tunnelName(new String(pathNameTlv.getValue())),
tunnel.path(), labelStack, annotations);
......