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 java.util.concurrent.Future;
12 import org.opendaylight.transportpce.pce.service.PathComputationService;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.CancelResourceReserveInput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.CancelResourceReserveOutput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
17 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceService;
20 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.service.path.rpc.result.PathDescriptionBuilder;
21 ///// check well PathDescriptionBuilder import
22 //---------------------------------------------
24 import org.opendaylight.yangtools.yang.common.RpcResult;
25 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory;
30 * PceService implementation.
32 public class PceServiceRPCImpl implements PceService {
34 private static final Logger LOG = LoggerFactory.getLogger(PceServiceRPCImpl.class);
36 private final PathComputationService pathComputationService;
38 public PceServiceRPCImpl(PathComputationService pathComputationService) {
39 this.pathComputationService = pathComputationService;
43 public Future<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
44 LOG.info("RPC cancelResourceReserve request received");
45 return RpcResultBuilder.success(pathComputationService.cancelResourceReserve(input)).buildFuture();
50 public Future<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
51 LOG.info("RPC path computation request received");
52 return RpcResultBuilder.success(pathComputationService.pathComputationRequest(input)).buildFuture();