X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fimpl%2FPceServiceRPCImpl.java;fp=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fimpl%2FPceServiceRPCImpl.java;h=13fd7684d842a0e27c2f85f5122c19eb31690fa7;hb=3906ef0d33783d4df0bd98a10686081bbcd26dd4;hp=af68f19ae9ac64dca35ddab3daa494c2752ef12d;hpb=26ae7f03806a3079dca25ec6e3285f2ba369c481;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/impl/PceServiceRPCImpl.java b/pce/src/main/java/org/opendaylight/transportpce/pce/impl/PceServiceRPCImpl.java index af68f19ae..13fd7684d 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/impl/PceServiceRPCImpl.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/impl/PceServiceRPCImpl.java @@ -39,13 +39,15 @@ public class PceServiceRPCImpl implements TransportpcePceService { public ListenableFuture> cancelResourceReserve(CancelResourceReserveInput input) { LOG.info("RPC cancelResourceReserve request received"); - CancelResourceReserveOutput output = null; try { - output = this.pathComputationService.cancelResourceReserve(input).get(); + return RpcResultBuilder + .success( + this.pathComputationService.cancelResourceReserve(input).get()) + .buildFuture(); } catch (InterruptedException | ExecutionException e) { LOG.error("RPC cancelResourceReserve failed !", e); + return RpcResultBuilder.success((CancelResourceReserveOutput) null).buildFuture(); } - return RpcResultBuilder.success(output).buildFuture(); } @Override @@ -53,20 +55,30 @@ public class PceServiceRPCImpl implements TransportpcePceService { pathComputationRequest(PathComputationRequestInput input) { LOG.info("RPC path computation request received"); LOG.debug("input parameters are : input = {}", input); - PathComputationRequestOutput output = null; try { - output = this.pathComputationService.pathComputationRequest(input).get(); + return RpcResultBuilder + .success( + this.pathComputationService.pathComputationRequest(input).get()) + .buildFuture(); } catch (InterruptedException | ExecutionException e) { LOG.error("RPC path computation request failed !", e); } - return RpcResultBuilder.success(output).buildFuture(); + return RpcResultBuilder.success((PathComputationRequestOutput) null).buildFuture(); } @Override - public ListenableFuture> - pathComputationRerouteRequest(PathComputationRerouteRequestInput input) { + public ListenableFuture> pathComputationRerouteRequest( + PathComputationRerouteRequestInput input) { LOG.info("RPC path computation reroute request received"); LOG.debug("input parameters are : input = {}", input); - return null; + try { + return RpcResultBuilder + .success( + this.pathComputationService.pathComputationRerouteRequest(input).get()) + .buildFuture(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("RPC path computation request failed !", e); + return RpcResultBuilder.success((PathComputationRerouteRequestOutput) null).buildFuture(); + } } }