2 * Copyright © 2017 AT&T, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.transportpce.pce.impl;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.transportpce.pce.service.PathComputationService;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.CancelResourceReserveInput;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.CancelResourceReserveOutput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceService;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.service.path.rpc.result.PathDescriptionBuilder;
19 ///// check well PathDescriptionBuilder import
20 //---------------------------------------------
22 import org.opendaylight.yangtools.yang.common.RpcResult;
23 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
28 * PceService implementation.
30 public class PceServiceRPCImpl implements PceService {
32 private static final Logger LOG = LoggerFactory.getLogger(PceServiceRPCImpl.class);
34 private final PathComputationService pathComputationService;
36 public PceServiceRPCImpl(PathComputationService pathComputationService) {
37 this.pathComputationService = pathComputationService;
41 public ListenableFuture<RpcResult<CancelResourceReserveOutput>>
42 cancelResourceReserve(CancelResourceReserveInput input) {
43 LOG.info("RPC cancelResourceReserve request received");
44 return RpcResultBuilder.success(this.pathComputationService.cancelResourceReserve(input)).buildFuture();
49 public ListenableFuture<RpcResult<PathComputationRequestOutput>>
50 pathComputationRequest(PathComputationRequestInput input) {
51 LOG.info("RPC path computation request received");
52 return RpcResultBuilder.success(this.pathComputationService.pathComputationRequest(input)).buildFuture();