-/*\r
- * ============LICENSE_START========================================================================\r
- * ONAP : tr-069-adapter\r
- * =================================================================================================\r
- * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
- * =================================================================================================\r
- * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
- * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
- * may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
- * either express or implied. See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ===============LICENSE_END=======================================================================\r
- */\r
-\r
-package org.commscope.tr069adapter.netconf.notification;\r
-\r
-import org.commscope.tr069adapter.mapper.model.NetConfNotificationDTO;\r
-import org.commscope.tr069adapter.netconf.server.utils.NetConfServerConstants;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.slf4j.MDC;\r
-import org.springframework.beans.factory.annotation.Autowired;\r
-import org.springframework.jms.core.JmsTemplate;\r
-import org.springframework.stereotype.Component;\r
-\r
-@Component\r
-public class NotificationHandler {\r
-\r
- private static final Logger logger = LoggerFactory.getLogger(NotificationHandler.class);\r
- private static final String CLIENT_STR = "client";\r
-\r
- @Autowired\r
- NetConfSessionUtil netConfSessionUtil;\r
-\r
- @Autowired\r
- private JmsTemplate jmsTemplate;\r
-\r
- public void handleNetConfNotification(NetConfNotificationDTO netConNotifDTO) {\r
- logger.debug("processing netconf notification {}", netConNotifDTO);\r
- try {\r
- MDC.put(CLIENT_STR, netConNotifDTO.getDeviceID());\r
-\r
- logger.debug("NetConf notificaiton reviced for {}", netConNotifDTO.getDeviceID());\r
- jmsTemplate.convertAndSend(NetConfServerConstants.NETCONF_NOTIFICATION_Q, netConNotifDTO);\r
- logger.debug("Successfully posted the notiticaiton to JMS to forward to SDNR");\r
- } catch (Exception e) {\r
- logger.error("Posting notification failed; Reason: {}", e.getMessage());\r
- } finally {\r
- MDC.remove(CLIENT_STR);\r
- }\r
- }\r
-}\r
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : tr-069-adapter
+ * =================================================================================================
+ * Copyright (C) 2020 CommScope Inc Intellectual Property.
+ * =================================================================================================
+ * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ===============LICENSE_END=======================================================================
+ */
+
+package org.commscope.tr069adapter.netconf.notification;
+
+import org.commscope.tr069adapter.mapper.model.NetConfNotificationDTO;
+import org.commscope.tr069adapter.netconf.server.utils.NetConfServerConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jms.core.JmsTemplate;
+import org.springframework.stereotype.Component;
+
+@Component
+public class NotificationHandler {
+
+ private static final Logger logger = LoggerFactory.getLogger(NotificationHandler.class);
+ private static final String CLIENT_STR = "client";
+
+ @Autowired
+ NetConfSessionUtil netConfSessionUtil;
+
+ @Autowired
+ private JmsTemplate jmsTemplate;
+
+ public void handleNetConfNotification(NetConfNotificationDTO netConNotifDTO) {
+ logger.debug("processing netconf notification {}", netConNotifDTO);
+ try {
+ MDC.put(CLIENT_STR, netConNotifDTO.getDeviceID());
+
+ logger.debug("NetConf notificaiton reviced for {}", netConNotifDTO.getDeviceID());
+ jmsTemplate.convertAndSend(NetConfServerConstants.NETCONF_NOTIFICATION_Q, netConNotifDTO);
+ logger.debug("Successfully posted the notiticaiton to JMS to forward to SDNR");
+ } catch (Exception e) {
+ logger.error("Posting notification failed; Reason: {}", e.getMessage());
+ } finally {
+ MDC.remove(CLIENT_STR);
+ }
+ }
+}