Service-notification handling for PCE 91/78291/12
authorMartial COULIBALY <martial.coulibaly@gfi.fr>
Thu, 29 Nov 2018 08:20:48 +0000 (09:20 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Thu, 7 Feb 2019 13:53:47 +0000 (14:53 +0100)
- Modify PCE to send notifications to ServiceHandler
- Modify PCE to implement RPCs ListenableFuture

JIRA: TRNSPRTPCE-50
Change-Id: Ibc74ea8141284e545c44e87926acf49a150eac27
Signed-off-by: Martial COULIBALY <martial.coulibaly@gfi.fr>
pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java
pce/src/main/java/org/opendaylight/transportpce/pce/impl/PceServiceRPCImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationService.java
pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java
pce/src/test/java/org/opendaylight/transportpce/pce/PceManyTests.java
pce/src/test/java/org/opendaylight/transportpce/pce/PceSingleTests.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/PCEServiceWrapper.java

index 67e9b02cf21efa9a571fdea79a4899c7ae0300fd..a0e81e9bf3acf26dfdabbc7bfdd10c9bb91f94f5 100644 (file)
@@ -152,7 +152,7 @@ public class PceCalculation {
         for (Node node : this.allNodes) {
             validateNode(node);
         }
-        LOG.info("analyzeNw: allPceNodes size {} : {}", this.allPceNodes.size(), this.allPceNodes.toString());
+        LOG.debug("analyzeNw: allPceNodes size {} : {}", this.allPceNodes.size(), this.allPceNodes.toString());
         if ((this.aendPceNode == null) || (this.zendPceNode == null)) {
             LOG.error("analyzeNw: Error in reading nodes: A or Z do not present in the network");
             return false;
@@ -188,7 +188,7 @@ public class PceCalculation {
         }
         // remove the SRG from PceNodes, as it is not directly connected to A/Z
         this.allPceNodes.remove(nodeId);
-        LOG.info("analyzeNw: SRG removed {}", nodeId.getValue());
+        LOG.debug("analyzeNw: SRG removed {}", nodeId.getValue());
         return false;
     }
 
@@ -202,7 +202,7 @@ public class PceCalculation {
         }
         // remove the SRG from PceNodes, as it is not directly connected to A/Z
         this.allPceNodes.remove(pcelink.getDestId());
-        LOG.info("analyzeNw: SRG removed {}", nodeId.getValue());
+        LOG.debug("analyzeNw: SRG removed {}", nodeId.getValue());
         return false;
     }
 
@@ -362,7 +362,7 @@ public class PceCalculation {
             return false;
         }
         this.allPceNodes.put(nodeId, pceNode);
-        LOG.info("validateNode: node is saved {}", nodeId.getValue());
+        LOG.debug("validateNode: node is saved {}", nodeId.getValue());
         return true;
     }
 
index 091ed56763590e617ed9821f03b90582cda1a547..6fb7ac8cae206334b8ecdc62e4f03fd33f245b7a 100755 (executable)
@@ -8,6 +8,9 @@
 package org.opendaylight.transportpce.pce.impl;
 
 import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.concurrent.ExecutionException;
+
 import org.opendaylight.transportpce.pce.service.PathComputationService;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutput;
@@ -36,7 +39,13 @@ public class PceServiceRPCImpl implements TransportpcePceService {
     public ListenableFuture<RpcResult<CancelResourceReserveOutput>>
             cancelResourceReserve(CancelResourceReserveInput input) {
         LOG.info("RPC cancelResourceReserve request received");
-        return RpcResultBuilder.success(this.pathComputationService.cancelResourceReserve(input)).buildFuture();
+        CancelResourceReserveOutput output = null;
+        try {
+            output = this.pathComputationService.cancelResourceReserve(input).get();
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("RPC cancelResourceReserve failed !", e);
+        }
+        return RpcResultBuilder.success(output).buildFuture();
     }
 
 
@@ -44,7 +53,13 @@ public class PceServiceRPCImpl implements TransportpcePceService {
     public ListenableFuture<RpcResult<PathComputationRequestOutput>>
             pathComputationRequest(PathComputationRequestInput input) {
         LOG.info("RPC path computation request received");
-        return RpcResultBuilder.success(this.pathComputationService.pathComputationRequest(input)).buildFuture();
+        PathComputationRequestOutput output = null;
+        try {
+            output = this.pathComputationService.pathComputationRequest(input).get();
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("RPC cancelResourceReserve failed !", e);
+        }
+        return RpcResultBuilder.success(output).buildFuture();
     }
 
 }
index 88f372a40951c4411561e5f13376913c94fa966a..0776dd4d9731bed80e0c3a6a623081ded93f31fb 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.transportpce.pce.service;
 
+import com.google.common.util.concurrent.ListenableFuture;
+
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
@@ -23,7 +25,7 @@ public interface PathComputationService {
      * @param input CancelResourceReserveInput data
      * @return output CancelResourceReserveOutput data
      */
-    CancelResourceReserveOutput cancelResourceReserve(CancelResourceReserveInput input);
+    ListenableFuture<CancelResourceReserveOutput> cancelResourceReserve(CancelResourceReserveInput input);
 
     /**
      * Requests a path compuation.
@@ -31,6 +33,6 @@ public interface PathComputationService {
      * @param input PathComputationRequestInput data
      * @return output PathComputationRequestOutput data
      */
-    PathComputationRequestOutput pathComputationRequest(PathComputationRequestInput input);
+    ListenableFuture<PathComputationRequestOutput> pathComputationRequest(PathComputationRequestInput input);
 
 }
index e93ea094ba9625ecfe8b0054dcdfa34f2a75a2f7..b6da829b55e9676968cd0e8e2110fdfaf848f596 100644 (file)
@@ -7,6 +7,13 @@
  */
 package org.opendaylight.transportpce.pce.service;
 
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.transportpce.pce.PceComplianceCheck;
@@ -34,14 +41,15 @@ import org.slf4j.LoggerFactory;
 public class PathComputationServiceImpl implements PathComputationService {
 
     private static final Logger LOG = LoggerFactory.getLogger(PathComputationServiceImpl.class);
-
     private final NotificationPublishService notificationPublishService;
     private final DataBroker dataBroker;
+    private final ListeningExecutorService executor;
+    ServicePathRpcResult notification = null;
 
-    public PathComputationServiceImpl(DataBroker dataBroker,
-                                      NotificationPublishService notificationPublishService) {
+    public PathComputationServiceImpl(DataBroker dataBroker, NotificationPublishService notificationPublishService) {
         this.notificationPublishService = notificationPublishService;
         this.dataBroker = dataBroker;
+        this.executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(5));
     }
 
     public void init() {
@@ -52,154 +60,132 @@ public class PathComputationServiceImpl implements PathComputationService {
         LOG.info("close.");
     }
 
-    @Override
-    public CancelResourceReserveOutput cancelResourceReserve(CancelResourceReserveInput input) {
-        LOG.info("cancelResourceReserve");
-        String message = "";
-
-        ServicePathRpcResult notification = new ServicePathRpcResultBuilder()
-                .setNotificationType(ServicePathNotificationTypes.CancelResourceReserve)
-                .setServiceName(input.getServiceName())
-                .setStatus(RpcStatusEx.Pending)
-                .setStatusMessage("Service compliant, submitting cancelResourceReserve Request ...")
-                .build();
+    private void sendNotifications(ServicePathNotificationTypes servicePathNotificationTypes, String serviceName,
+            RpcStatusEx rpcStatusEx, String message, PathDescription pathDescription) {
+        ServicePathRpcResultBuilder servicePathRpcResultBuilder =
+                new ServicePathRpcResultBuilder().setNotificationType(servicePathNotificationTypes)
+                        .setServiceName(serviceName).setStatus(rpcStatusEx).setStatusMessage(message);
+        if (pathDescription != null) {
+            servicePathRpcResultBuilder.setPathDescription(pathDescription);
+        }
+        this.notification = servicePathRpcResultBuilder.build();
         try {
-            notificationPublishService.putNotification(notification);
+            notificationPublishService.putNotification(this.notification);
         } catch (InterruptedException e) {
             LOG.info("notification offer rejected : ", e.getMessage());
         }
+    }
 
-        PceSendingPceRPCs sendingPCE = new PceSendingPceRPCs();
-        sendingPCE.cancelResourceReserve();
-        if (sendingPCE.getSuccess()) {
-            message = "ResourceReserve cancelled !";
-        } else {
-            message = "Cancelling ResourceReserve failed !";
-        }
-        LOG.info(message);
-        ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder();
-        configurationResponseCommon
-                .setAckFinalIndicator("Yes")
-                .setRequestId(input.getServiceHandlerHeader().getRequestId())
-                .setResponseCode("200")
-                .setResponseMessage("")
-                .setResponseMessage(message);
-        CancelResourceReserveOutputBuilder output  = new CancelResourceReserveOutputBuilder();
-        output.setConfigurationResponseCommon(configurationResponseCommon.build());
-        return output.build();
+    @Override
+    public ListenableFuture<CancelResourceReserveOutput> cancelResourceReserve(CancelResourceReserveInput input) {
+        LOG.info("cancelResourceReserve");
+        return executor.submit(new Callable<CancelResourceReserveOutput>() {
+
+            @Override
+            public CancelResourceReserveOutput call() throws Exception {
+                String message = "";
+                sendNotifications(ServicePathNotificationTypes.CancelResourceReserve, input.getServiceName(),
+                        RpcStatusEx.Pending, "Service compliant, submitting cancelResourceReserve Request ...", null);
+                PceSendingPceRPCs sendingPCE = new PceSendingPceRPCs();
+                sendingPCE.cancelResourceReserve();
+                if (sendingPCE.getSuccess()) {
+                    message = "ResourceReserve cancelled !";
+                } else {
+                    message = "Cancelling ResourceReserve failed !";
+                }
+                LOG.info(message);
+                sendNotifications(ServicePathNotificationTypes.CancelResourceReserve, input.getServiceName(),
+                        RpcStatusEx.Successful, "cancel Resource Reserve successful!", null);
+                ConfigurationResponseCommonBuilder configurationResponseCommon =
+                        new ConfigurationResponseCommonBuilder();
+                configurationResponseCommon.setAckFinalIndicator("Yes")
+                        .setRequestId(input.getServiceHandlerHeader().getRequestId()).setResponseCode("200")
+                        .setResponseMessage("");
+                CancelResourceReserveOutputBuilder output = new CancelResourceReserveOutputBuilder();
+                output.setConfigurationResponseCommon(configurationResponseCommon.build());
+                return output.build();
+            }
+        });
     }
 
     @Override
-    public PathComputationRequestOutput pathComputationRequest(PathComputationRequestInput input) {
+    public ListenableFuture<PathComputationRequestOutput> pathComputationRequest(PathComputationRequestInput input) {
         LOG.info("pathComputationRequest");
-
-        PathComputationRequestOutputBuilder output = new PathComputationRequestOutputBuilder();
-        ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder();
-
-        PceComplianceCheckResult check = PceComplianceCheck.check(input);
-        if (!check.hasPassed()) {
-            configurationResponseCommon
-                    .setAckFinalIndicator("Yes")
-                    .setRequestId(input.getServiceHandlerHeader().getRequestId())
-                    .setResponseCode("Path not calculated")
-                    .setResponseMessage(check.getMessage());
-
-
-            output.setConfigurationResponseCommon(configurationResponseCommon.build())
-                    .setResponseParameters(null);
-
-            return output.build();
-        }
-        ServicePathRpcResult notification = new ServicePathRpcResultBuilder()
-                .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
-                .setServiceName(input.getServiceName())
-                .setStatus(RpcStatusEx.Pending)
-                .setStatusMessage("Service compliant, submitting pathComputation Request ...")
-                .build();
-        try {
-            notificationPublishService.putNotification(notification);
-        } catch (InterruptedException e) {
-            LOG.info("notification offer rejected : ", e.getMessage());
-        }
-
-        String message = "";
-        String responseCode = "";
-        PceSendingPceRPCs sendingPCE = new PceSendingPceRPCs(input, dataBroker);
-        sendingPCE.pathComputation();
-        message = sendingPCE.getMessage();
-        responseCode = sendingPCE.getResponseCode();
-        PathDescriptionBuilder path = null;
-        path = sendingPCE.getPathDescription();
-
-
-        LOG.info("PCE response: {} {}", message, responseCode);
-        if ((sendingPCE.getSuccess() == false) || (path == null)) {
-            configurationResponseCommon
-                    .setAckFinalIndicator("Yes")
-                    .setRequestId(input.getServiceHandlerHeader().getRequestId())
-                    .setResponseCode(responseCode)
-                    .setResponseMessage(message);
-
-            output.setConfigurationResponseCommon(configurationResponseCommon.build());
-            return output.build();
-        }
-
-        // Path calculator returned Success
-        configurationResponseCommon
-                .setAckFinalIndicator("Yes")
-                .setRequestId(input.getServiceHandlerHeader().getRequestId())
-                .setResponseCode(responseCode)
-                .setResponseMessage(message);
-
-        ServicePathRpcResultBuilder tmp = new ServicePathRpcResultBuilder()
-                .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
-                .setServiceName(input.getServiceName())
-                .setStatus(RpcStatusEx.Successful)
-                .setStatusMessage(message);
-        PathDescription pathDescription = new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce
-                .pce.rev171017.service.path.rpc.result.PathDescriptionBuilder()
-                .setAToZDirection(path.getAToZDirection())
-                .setZToADirection(path.getZToADirection())
-                .build();
-        tmp.setPathDescription(pathDescription);
-
-        notification = tmp.build();
-        try {
-            notificationPublishService.putNotification(notification);
-        } catch (InterruptedException e) {
-            LOG.error("notification offer rejected : {}", e.getMessage());
-        }
-
-        org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
-                .rev171016.response.parameters.sp.response.parameters.PathDescription pathDescription1
-                = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
-                .rev171016.response.parameters.sp.response.parameters.PathDescriptionBuilder()
-                .setAToZDirection(path.getAToZDirection())
-                .setZToADirection(path.getZToADirection())
-                .build();
-        ResponseParametersBuilder rpb  = new ResponseParametersBuilder()
-                .setPathDescription(pathDescription1);
-
-        output.setConfigurationResponseCommon(configurationResponseCommon.build())
-              .setResponseParameters(rpb.build());
-
-        //debug prints
-        AToZDirection atoz = pathDescription.getAToZDirection();
-        if ((atoz != null) && (atoz.getAToZ() != null)) {
-            LOG.info("Impl AtoZ Notification: [{}] elements in description", atoz.getAToZ().size());
-            for (int i = 0; i < atoz.getAToZ().size(); i++) {
-                LOG.info("Impl AtoZ Notification: [{}] {}", i, atoz.getAToZ().get(i));
-            }
-        }
-        ZToADirection ztoa = pathDescription.getZToADirection();
-        if ((ztoa != null) && (ztoa.getZToA() != null)) {
-            LOG.info("Impl ZtoA Notification: [{}] elements in description", ztoa.getZToA().size());
-            for (int i = 0; i < ztoa.getZToA().size(); i++) {
-                LOG.info("Impl ZtoA Notification: [{}] {}", i, ztoa.getZToA().get(i));
+        return executor.submit(new Callable<PathComputationRequestOutput>() {
+
+            @Override
+            public PathComputationRequestOutput call() throws Exception {
+                PathComputationRequestOutputBuilder output = new PathComputationRequestOutputBuilder();
+                ConfigurationResponseCommonBuilder configurationResponseCommon =
+                        new ConfigurationResponseCommonBuilder();
+                PceComplianceCheckResult check = PceComplianceCheck.check(input);
+                if (!check.hasPassed()) {
+                    LOG.error("Path not calculated, service not compliant : {}", check.getMessage());
+                    sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+                            RpcStatusEx.Failed, "Path not calculated, service not compliant", null);
+                    configurationResponseCommon.setAckFinalIndicator("Yes")
+                            .setRequestId(input.getServiceHandlerHeader().getRequestId())
+                            .setResponseCode("Path not calculated").setResponseMessage(check.getMessage());
+                    output.setConfigurationResponseCommon(configurationResponseCommon.build())
+                            .setResponseParameters(null);
+                    return output.build();
+                }
+                sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+                        RpcStatusEx.Pending, "Service compliant, submitting pathComputation Request ...", null);
+                String message = "";
+                String responseCode = "";
+                PceSendingPceRPCs sendingPCE = new PceSendingPceRPCs(input, dataBroker);
+                sendingPCE.pathComputation();
+                message = sendingPCE.getMessage();
+                responseCode = sendingPCE.getResponseCode();
+                PathDescriptionBuilder path = null;
+                path = sendingPCE.getPathDescription();
+                LOG.info("PCE response: {} {}", message, responseCode);
+                if ((sendingPCE.getSuccess() == false) || (path == null)) {
+                    configurationResponseCommon.setAckFinalIndicator("Yes")
+                            .setRequestId(input.getServiceHandlerHeader().getRequestId()).setResponseCode(responseCode)
+                            .setResponseMessage(message);
+                    output.setConfigurationResponseCommon(configurationResponseCommon.build());
+                    sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+                            RpcStatusEx.Failed, "Path not calculated", null);
+                    return output.build();
+                }
+                // Path calculator returned Success
+                configurationResponseCommon.setAckFinalIndicator("Yes")
+                        .setRequestId(input.getServiceHandlerHeader().getRequestId()).setResponseCode(responseCode)
+                        .setResponseMessage(message);
+                PathDescription pathDescription = new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce
+                        .pce.rev171017.service.path.rpc.result.PathDescriptionBuilder()
+                                .setAToZDirection(path.getAToZDirection()).setZToADirection(path.getZToADirection())
+                                .build();
+                sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+                        RpcStatusEx.Successful, message, pathDescription);
+                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.response
+                    .parameters.sp.response.parameters.PathDescription pathDescription1 = new org.opendaylight.yang.gen
+                        .v1.http.org.transportpce.b.c._interface.service.types.rev171016.response.parameters.sp
+                        .response.parameters.PathDescriptionBuilder()
+                                .setAToZDirection(path.getAToZDirection()).setZToADirection(path.getZToADirection())
+                                .build();
+                ResponseParametersBuilder rpb = new ResponseParametersBuilder().setPathDescription(pathDescription1);
+                output.setConfigurationResponseCommon(configurationResponseCommon.build())
+                        .setResponseParameters(rpb.build());
+                // debug prints
+                AToZDirection atoz = pathDescription.getAToZDirection();
+                if ((atoz != null) && (atoz.getAToZ() != null)) {
+                    LOG.debug("Impl AtoZ Notification: [{}] elements in description", atoz.getAToZ().size());
+                    for (int i = 0; i < atoz.getAToZ().size(); i++) {
+                        LOG.debug("Impl AtoZ Notification: [{}] {}", i, atoz.getAToZ().get(i));
+                    }
+                }
+                ZToADirection ztoa = pathDescription.getZToADirection();
+                if ((ztoa != null) && (ztoa.getZToA() != null)) {
+                    LOG.debug("Impl ZtoA Notification: [{}] elements in description", ztoa.getZToA().size());
+                    for (int i = 0; i < ztoa.getZToA().size(); i++) {
+                        LOG.debug("Impl ZtoA Notification: [{}] {}", i, ztoa.getZToA().get(i));
+                    }
+                }
+                return output.build();
             }
-        }
-        //debug prints
-        return output.build();
+        });
     }
-
 }
index 846210fa95e3d63bbfc9381189b7e982a7355222..c531c69b3d626a1d5061620df082c48bd18524f0 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.transportpce.pce;
 
 import java.util.Arrays;
 import java.util.Collection;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -76,7 +77,7 @@ public class PceManyTests extends AbstractTest {
 
         PathComputationService pathComputationService =
             new PathComputationServiceImpl(getDataBroker(), notificationPublishService);
-        PathComputationRequestOutput output = pathComputationService.pathComputationRequest(input);
+        PathComputationRequestOutput output = pathComputationService.pathComputationRequest(input).get();
 
         PceTestUtils.checkConfigurationResponse(output, expectedOutput);
 
index bcf40e3860e3a36368196bbbe7f0db8e4a1f8932..82a8bd0d2951f2a5dd65ec68a2ff630abf4ac779 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.transportpce.pce;
 
 import java.util.Arrays;
 import java.util.Collection;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -85,7 +86,7 @@ public class PceSingleTests extends AbstractTest {
 
         PathComputationService pathComputationService =
             new PathComputationServiceImpl(getDataBroker(), this.notificationPublishService);
-        PathComputationRequestOutput output = pathComputationService.pathComputationRequest(this.input);
+        PathComputationRequestOutput output = pathComputationService.pathComputationRequest(this.input).get();
 
         PceTestUtils.checkConfigurationResponse(output, this.expectedOutput);
         if (ResponseCodes.RESPONSE_OK.equals(output.getConfigurationResponseCommon().getResponseCode())) {
index 8fc869ef0d74ccc2fac20081fe1193045fedf2b2..19fc931fba3401717c2c454d4d26e88d70d734ff 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.transportpce.servicehandler.service;
 
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.concurrent.ExecutionException;
+
 import org.opendaylight.transportpce.pce.service.PathComputationService;
 import org.opendaylight.transportpce.servicehandler.MappingConstraints;
 import org.opendaylight.transportpce.servicehandler.ModelMappingUtils;
@@ -61,10 +65,16 @@ public class PCEServiceWrapper {
                         mappingConstraints.getServicePathSoftConstraints(), reserveResource, serviceAEnd,
                         serviceZEnd);
         LOG.debug("Calling path computation.");
-        PathComputationRequestOutput pathComputationRequestOutput
+        ListenableFuture<PathComputationRequestOutput> pathComputationRequestOutput
                 = this.pathComputationService.pathComputationRequest(pathComputationRequestInput);
         LOG.debug("Path computation done.");
-        return pathComputationRequestOutput;
+        PathComputationRequestOutput output = null;
+        try {
+            output = pathComputationRequestOutput.get();
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("PCE RPC path computation failed !");
+        }
+        return output;
     }
 
     private PathComputationRequestInput createPceRequestInput(String serviceName,