e2863e13422fc0b62ed5cfa4bdfbc47d537cf7fd
[oam/tr069-adapter.git] / netconf-server / src / main / java / org / commscope / tr069adapter / netconf / restapi / NotificationReceiverService.java
1 package org.commscope.tr069adapter.netconf.restapi;\r
2 \r
3 import org.commscope.tr069adapter.mapper.model.NetConfNotificationDTO;\r
4 import org.commscope.tr069adapter.netconf.notification.NotificationHandler;\r
5 import org.slf4j.Logger;\r
6 import org.slf4j.LoggerFactory;\r
7 import org.springframework.beans.factory.annotation.Autowired;\r
8 import org.springframework.web.bind.annotation.PostMapping;\r
9 import org.springframework.web.bind.annotation.RequestBody;\r
10 import org.springframework.web.bind.annotation.RequestMapping;\r
11 import org.springframework.web.bind.annotation.RestController;\r
12 \r
13 @RestController\r
14 @RequestMapping("/netConfNotificationService")\r
15 public class NotificationReceiverService {\r
16 \r
17   private static final Logger LOG = LoggerFactory.getLogger(NotificationReceiverService.class);\r
18 \r
19   @Autowired\r
20   NotificationHandler handler;\r
21 \r
22   @PostMapping("/notification")\r
23   public void processNotification(@RequestBody NetConfNotificationDTO netConNotifDTO) {\r
24     System.out.println("Received NetConf Notification :" + netConNotifDTO);\r
25     LOG.debug("Received NetConf Notification :" + netConNotifDTO);\r
26     handler.handleNetConfNotification(netConNotifDTO);\r
27     LOG.debug("Processed NetConf Notification for :" + netConNotifDTO);\r
28     System.out.println("Processed NetConf Notification for :" + netConNotifDTO);\r
29   }\r
30 }\r