X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fservice%2FPathComputationServiceImpl.java;h=bd706b278ae89af8079dab08f09711c362b49e20;hb=bc9a08be9d7cdeb30ecffd3c82ddd656a3a23043;hp=c9fd310dfe551dd06a92657db7427a1d30774269;hpb=a01f4032cd7dc71e3f047db5b3e2db77c4733b2c;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java b/pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java index c9fd310df..bd706b278 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Executors; +import java.util.stream.Collectors; import org.opendaylight.mdsal.binding.api.NotificationPublishService; import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices; import org.opendaylight.transportpce.common.network.NetworkTransactionService; @@ -177,7 +178,8 @@ public class PathComputationServiceImpl implements PathComputationService { GnpyResponse respZtoA = generateGnpyResponse(gnpyZtoA.getResponse(),"Z-to-A"); listResponse.add(respZtoA); } - output.setGnpyResponse(listResponse); + output.setGnpyResponse(listResponse.stream() + .collect(Collectors.toMap(GnpyResponse::key, gnpyResponse -> gnpyResponse))); if (Boolean.FALSE.equals(sendingPCE.getSuccess()) || (path == null)) { configurationResponseCommon.setAckFinalIndicator("Yes") @@ -259,7 +261,10 @@ public class PathComputationServiceImpl implements PathComputationService { .setAccumulativeValue(pathMetricGnpy.getAccumulativeValue()).build(); gnpyPathMetricList.add(pathMetric); } - PathProperties pathProperties = new PathPropertiesBuilder().setPathMetric(gnpyPathMetricList).build(); + PathProperties pathProperties = new PathPropertiesBuilder() + .setPathMetric(gnpyPathMetricList.stream() + .collect(Collectors.toMap(PathMetric::key, pathMetric -> pathMetric))) + .build(); PathCase gnpyPathCase = new PathCaseBuilder().setPathProperties(pathProperties).build(); respType = gnpyPathCase; feasible = true;