2 * Copyright © 2021 Nokia, 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.tapi.listeners;
11 import org.opendaylight.mdsal.binding.api.DataBroker;
12 import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.ServiceRpcResultSh;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
17 public class TapiServiceNotificationHandler {
19 private static final Logger LOG = LoggerFactory.getLogger(TapiServiceNotificationHandler.class);
20 private final DataBroker dataBroker;
22 public TapiServiceNotificationHandler(DataBroker dataBroker) {
23 this.dataBroker = dataBroker;
26 public CompositeListener getCompositeListener() {
27 return new CompositeListener(Set.of(
28 new CompositeListener.Component<>(ServiceRpcResultSh.class, this::onServiceRpcResultSh)));
31 private void onServiceRpcResultSh(ServiceRpcResultSh notification) {
32 LOG.info("Avoid dataBroker error {}", dataBroker.getClass().getCanonicalName());