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.rev171017.CancelResourceReserveInput;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.TransportpcePceService;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
18 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
23 * PceService implementation.
25 public class PceServiceRPCImpl implements TransportpcePceService {
27 private static final Logger LOG = LoggerFactory.getLogger(PceServiceRPCImpl.class);
29 private final PathComputationService pathComputationService;
31 public PceServiceRPCImpl(PathComputationService pathComputationService) {
32 this.pathComputationService = pathComputationService;
36 public ListenableFuture<RpcResult<CancelResourceReserveOutput>>
37 cancelResourceReserve(CancelResourceReserveInput input) {
38 LOG.info("RPC cancelResourceReserve request received");
39 return RpcResultBuilder.success(this.pathComputationService.cancelResourceReserve(input)).buildFuture();
44 public ListenableFuture<RpcResult<PathComputationRequestOutput>>
45 pathComputationRequest(PathComputationRequestInput input) {
46 LOG.info("RPC path computation request received");
47 return RpcResultBuilder.success(this.pathComputationService.pathComputationRequest(input)).buildFuture();