/* * Copyright © 2017 AT&T, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.transportpce.pce.impl; import com.google.common.util.concurrent.ListenableFuture; 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; import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput; import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput; import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.TransportpcePceService; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * PceService implementation. */ public class PceServiceRPCImpl implements TransportpcePceService { private static final Logger LOG = LoggerFactory.getLogger(PceServiceRPCImpl.class); private final PathComputationService pathComputationService; public PceServiceRPCImpl(PathComputationService pathComputationService) { this.pathComputationService = pathComputationService; } @Override public ListenableFuture> cancelResourceReserve(CancelResourceReserveInput input) { LOG.info("RPC cancelResourceReserve request received"); return RpcResultBuilder.success(this.pathComputationService.cancelResourceReserve(input)).buildFuture(); } @Override public ListenableFuture> pathComputationRequest(PathComputationRequestInput input) { LOG.info("RPC path computation request received"); return RpcResultBuilder.success(this.pathComputationService.pathComputationRequest(input)).buildFuture(); } }