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.collect.ImmutableClassToInstanceMap;
11 import org.opendaylight.mdsal.binding.api.RpcProviderService;
12 import org.opendaylight.transportpce.pce.service.PathComputationService;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.CancelResourceReserve;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.PathComputationRequest;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.PathComputationRerouteRequest;
16 import org.opendaylight.yangtools.concepts.Registration;
17 import org.opendaylight.yangtools.yang.binding.Rpc;
18 import org.osgi.service.component.annotations.Activate;
19 import org.osgi.service.component.annotations.Component;
20 import org.osgi.service.component.annotations.Deactivate;
21 import org.osgi.service.component.annotations.Reference;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
26 * PceService implementation.
28 @Component(immediate = true)
29 public class PceServiceRPCImpl {
30 private static final Logger LOG = LoggerFactory.getLogger(PceServiceRPCImpl.class);
31 private Registration reg;
34 public PceServiceRPCImpl(@Reference RpcProviderService rpcProviderService,
35 @Reference PathComputationService pathComputationService) {
36 this.reg = rpcProviderService.registerRpcImplementations(ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
37 .put(CancelResourceReserve.class, new CancelResourceReserveImpl(pathComputationService))
38 .put(PathComputationRequest.class, new PathComputationRequestImpl(pathComputationService))
39 .put(PathComputationRerouteRequest.class, new PathComputationRerouteRequestImpl(pathComputationService))
41 LOG.info("PceServiceRPCImpl instantiated");
47 LOG.info("PceServiceRPCImpl Closed");
50 public Registration getRegisteredRpc() {