Development of NETCONF RPCs for tr-069 adapter to
[oam/tr069-adapter.git] / acs / requestprocessor / src / main / java / org / commscope / tr069adapter / acs / requestprocessor / handler / DeviceRPCRequestHandler.java
index 0f98e60..ddd41b7 100644 (file)
@@ -1,68 +1,69 @@
-/*\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
-\r
-package org.commscope.tr069adapter.acs.requestprocessor.handler;\r
-\r
-import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_CF;\r
-import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_Q;\r
-import org.commscope.tr069adapter.acs.common.DeviceRPCRequest;\r
-import org.commscope.tr069adapter.acs.common.exception.SessionConcurrentAccessException;\r
-import org.commscope.tr069adapter.acs.common.exception.TR069EventProcessingException;\r
-import org.commscope.tr069adapter.acs.requestprocessor.impl.TR069RequestProcessEngine;\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.annotation.JmsListener;\r
-import org.springframework.stereotype.Component;\r
-import org.springframework.transaction.annotation.Transactional;\r
-\r
-@Component\r
-public class DeviceRPCRequestHandler {\r
-\r
-  private static final Logger logger = LoggerFactory.getLogger(DeviceRPCRequestHandler.class);\r
-\r
-  private static final String CLIENT_STR = "client";\r
-\r
-  @Autowired\r
-  private TR069RequestProcessEngine tr069RequestProcessEngine;\r
-\r
-  @JmsListener(destination = TR069_NBI_REQUEST_Q, containerFactory = TR069_NBI_REQUEST_CF)\r
-  @Transactional(rollbackFor = Exception.class)\r
-  public void onMessage(DeviceRPCRequest mapperDeviceOperationRequest)\r
-      throws SessionConcurrentAccessException, TR069EventProcessingException {\r
-    logger.debug("Received a JMS message from Mapper for TR069 Device RPC operation");\r
-    try {\r
-      if (mapperDeviceOperationRequest != null) {\r
-        MDC.put(CLIENT_STR, mapperDeviceOperationRequest.getDeviceDetails().getDeviceId());\r
-        logger.debug("Received a TR069 operation request from Mapper with operation ID: {} ",\r
-            mapperDeviceOperationRequest.getOperationId());\r
-        tr069RequestProcessEngine.processDeviceRPCRequest(mapperDeviceOperationRequest);\r
-        logger.debug("Processed a TR069 operation request from Mapper with operation ID: {} ",\r
-            mapperDeviceOperationRequest.getOperationId());\r
-\r
-      }\r
-    } finally {\r
-      MDC.remove(CLIENT_STR);\r
-    }\r
-    logger.debug("Processed JMS message from Mapper for TR069 Device RPC operation");\r
-\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.acs.requestprocessor.handler;
+
+import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_CF;
+import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_Q;
+
+import org.commscope.tr069adapter.acs.common.DeviceRPCRequest;
+import org.commscope.tr069adapter.acs.common.exception.SessionConcurrentAccessException;
+import org.commscope.tr069adapter.acs.common.exception.TR069EventProcessingException;
+import org.commscope.tr069adapter.acs.requestprocessor.impl.TR069RequestProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jms.annotation.JmsListener;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+public class DeviceRPCRequestHandler {
+
+  private static final Logger logger = LoggerFactory.getLogger(DeviceRPCRequestHandler.class);
+
+  private static final String CLIENT_STR = "client";
+
+  @Autowired
+  private TR069RequestProcessEngine tr069RequestProcessEngine;
+
+  @JmsListener(destination = TR069_NBI_REQUEST_Q, containerFactory = TR069_NBI_REQUEST_CF)
+  @Transactional(rollbackFor = Exception.class)
+  public void onMessage(DeviceRPCRequest mapperDeviceOperationRequest)
+      throws SessionConcurrentAccessException, TR069EventProcessingException {
+    logger.debug("Received a JMS message from Mapper for TR069 Device RPC operation");
+    try {
+      if (mapperDeviceOperationRequest != null) {
+        MDC.put(CLIENT_STR, mapperDeviceOperationRequest.getDeviceDetails().getDeviceId());
+        logger.debug("Received a TR069 operation request from Mapper with operation ID: {} ",
+            mapperDeviceOperationRequest.getOperationId());
+        tr069RequestProcessEngine.processDeviceRPCRequest(mapperDeviceOperationRequest);
+        logger.debug("Processed a TR069 operation request from Mapper with operation ID: {} ",
+            mapperDeviceOperationRequest.getOperationId());
+
+      }
+    } finally {
+      MDC.remove(CLIENT_STR);
+    }
+    logger.debug("Processed JMS message from Mapper for TR069 Device RPC operation");
+
+  }
+
+}