Don't use NotificationListener (NodeRegistration)
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / listeners / TcaListener710.java
1 /*
2  * Copyright © 2021 AT&T and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.transportpce.networkmodel.listeners;
10
11 import java.util.Set;
12 import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
13 import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev200327.TcaNotification;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 public class TcaListener710 {
18
19     private static final Logger LOG = LoggerFactory.getLogger(TcaListener710.class);
20
21     public CompositeListener getCompositeListener() {
22         return new CompositeListener(Set.of(
23             new CompositeListener.Component<>(TcaNotification.class, this::onTcaNotification)));
24     }
25
26     /**
27      * Callback for tca-notification.
28      * @param notification TcaNotification object
29      */
30     private void onTcaNotification(TcaNotification notification) {
31         LOG.info("Notification {} received {}", TcaNotification.QNAME, notification);
32     }
33
34 }