2 * Copyright © 2017 Orange, 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
10 package org.opendaylight.transportpce.stubpce.impl;
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
14 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
15 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
16 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
17 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathListener;
18 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
19 import org.opendaylight.yangtools.concepts.ListenerRegistration;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
25 * Stubpce Service and Notification.
26 * @author <a href="mailto:martial.coulibaly@gfi.com">Martial Coulibaly</a> on behalf of Orange
29 public class StubpceProvider {
30 private static final Logger LOG = LoggerFactory.getLogger(StubpceProvider.class);
31 private final RpcProviderRegistry rpcRegistry;
32 private final NotificationPublishService notificationPublishService;
33 private final DataBroker dataBroker;
36 private BindingAwareBroker.RpcRegistration<TransportpceServicepathService> rpcRegistration;
37 private ListenerRegistration<TransportpceServicepathListener> stubPcelistenerRegistration;
39 public StubpceProvider(RpcProviderRegistry rpcProviderRegistry,final DataBroker dataBroker,
40 NotificationService notificationService, NotificationPublishService notificationPublishService) {
41 this.rpcRegistry = rpcProviderRegistry;
42 this.notificationPublishService = notificationPublishService;
43 this.dataBroker = dataBroker;
47 * Method called when the blueprint container is created.
50 LOG.info("StubpceProvider Session Initiated");
51 final StubpceImpl consumer = new StubpceImpl(notificationPublishService,dataBroker);
52 rpcRegistration = rpcRegistry.addRpcImplementation(TransportpceServicepathService.class, consumer);
56 * Method called when the blueprint container is destroyed.
59 LOG.info("StubpceProvider Closed");
60 rpcRegistration.close();
61 stubPcelistenerRegistration.close();