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
9 package org.opendaylight.transportpce.servicehandler.impl;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
13 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
14 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
15 import org.opendaylight.transportpce.pce.service.PathComputationService;
16 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
17 import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.TransportpcePceListener;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.OrgOpenroadmServiceService;
20 import org.opendaylight.yangtools.concepts.ListenerRegistration;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
26 * Servicehandler Service and Notification.
27 * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
30 public class ServicehandlerProvider {
32 private static final Logger LOG = LoggerFactory.getLogger(ServicehandlerProvider.class);
34 private final DataBroker dataBroker;
35 private final RpcProviderRegistry rpcRegistry;
36 private final NotificationService notificationService;
37 private ListenerRegistration<TransportpcePceListener> pcelistenerRegistration;
38 private RpcRegistration<OrgOpenroadmServiceService> rpcRegistration;
39 private PathComputationService pathComputationService;
40 private RendererServiceOperations rendererServiceOperations;
42 public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry,
43 NotificationService notificationService, PathComputationService pathComputationService,
44 RendererServiceOperations rendererServiceOperations) {
45 this.dataBroker = dataBroker;
46 this.rpcRegistry = rpcProviderRegistry;
47 this.notificationService = notificationService;
48 this.pathComputationService = pathComputationService;
49 this.rendererServiceOperations = rendererServiceOperations;
53 * Method called when the blueprint container is created.
56 LOG.info("ServicehandlerProvider Session Initiated");
57 final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService,
58 rendererServiceOperations);
59 final PceListenerImpl pceListener = new PceListenerImpl();
60 rpcRegistration = rpcRegistry.addRpcImplementation(OrgOpenroadmServiceService.class, servicehandler);
64 * Method called when the blueprint container is destroyed.
67 LOG.info("ServicehandlerProvider Closed");
68 pcelistenerRegistration.close();
69 rpcRegistration.close();