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 org.opendaylight.mdsal.binding.api.RpcProviderService;
11 import org.opendaylight.transportpce.pce.service.PathComputationService;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev190624.TransportpcePceService;
13 import org.opendaylight.yangtools.concepts.ObjectRegistration;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
19 * Pce Service & Notification.
21 public class PceProvider {
23 private static final Logger LOG = LoggerFactory.getLogger(PceProvider.class);
25 private final RpcProviderService rpcService;
26 private final PathComputationService pathComputationService;
27 private ObjectRegistration<PceServiceRPCImpl> rpcRegistration;
29 public PceProvider(RpcProviderService rpcProviderService, PathComputationService pathComputationService) {
30 this.rpcService = rpcProviderService;
31 this.pathComputationService = pathComputationService;
35 * Method called when the blueprint container is created.
38 LOG.info("PceProvider Session Initiated");
39 final PceServiceRPCImpl consumer = new PceServiceRPCImpl(pathComputationService);
40 rpcRegistration = rpcService.registerRpcImplementation(TransportpcePceService.class, consumer);
44 * Method called when the blueprint container is destroyed.
47 LOG.info("PceProvider Closed");
48 rpcRegistration.close();