1663f61fe7f567fd8b511b0fa98b6d1b617e8156
[ccsdk/features.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk feature sdnr wt
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
23
24 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
25 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
26 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.AirInterface20Listener;
27 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.AttributeValueChangedNotification;
28 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.ObjectCreationNotification;
29 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.ObjectDeletionNotification;
30 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.ProblemNotification;
31 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory;
33
34 public class Onf14AirInterfaceNotificationListener implements AirInterface20Listener {
35
36     private static final Logger log = LoggerFactory.getLogger(Onf14AirInterfaceNotificationListener.class);
37
38     private final NetconfAccessor netconfAccessor;
39     private final DeviceManagerServiceProvider serviceProvider;
40
41     public Onf14AirInterfaceNotificationListener(NetconfAccessor netconfAccessor,
42             DeviceManagerServiceProvider serviceProvider) {
43         this.netconfAccessor = netconfAccessor;
44         this.serviceProvider = serviceProvider;
45     }
46
47     @Override
48     public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
49         // TODO Auto-generated method stub
50         // this type of notification is not yet supported
51         log.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
52     }
53
54     @Override
55     public void onProblemNotification(ProblemNotification notification) {
56         log.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
57
58         serviceProvider.getFaultService().faultNotification(netconfAccessor.getNodeId(), notification.getCounter(),
59                 notification.getTimestamp(), notification.getObjectIdRef().getValue(), notification.getProblem(),
60                 Onf14NetworkElement.mapSeverity(notification.getSeverity()));
61
62     }
63
64     @Override
65     public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
66         // TODO Auto-generated method stub
67         // this type of notification is not yet supported
68         log.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
69     }
70
71     @Override
72     public void onObjectCreationNotification(ObjectCreationNotification notification) {
73         // TODO Auto-generated method stub
74         // this type of notification is not yet supported
75         log.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
76     }
77
78 }