VES Heartbeat and Software Management Feature
[oam/tr069-adapter.git] / acs / requestprocessor / src / main / java / org / commscope / tr069adapter / acs / requestprocessor / impl / TR069EventNotificationService.java
index b6025f0..634f9df 100644 (file)
@@ -23,6 +23,7 @@ import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.NBI_OP_RE
 \r
 import org.commscope.tr069adapter.acs.common.DeviceInform;\r
 import org.commscope.tr069adapter.acs.common.DeviceRPCResponse;\r
+import org.commscope.tr069adapter.acs.common.dto.CustomOperationCode;\r
 import org.commscope.tr069adapter.acs.common.dto.TR069InformType;\r
 import org.commscope.tr069adapter.acs.common.dto.TR069OperationCode;\r
 import org.slf4j.Logger;\r
@@ -68,11 +69,19 @@ public class TR069EventNotificationService {
     String deviceId = deviceRPCResponse.getDeviceDetails().getDeviceId();\r
     try {\r
       MDC.put(CLIENT_STR, deviceId);\r
-      TR069OperationCode operCode =\r
-          (TR069OperationCode) deviceRPCResponse.getOperationResponse().getOperationCode();\r
-      String opCodeName = operCode.name();\r
-      logger.debug("Device RPC Response received for operation: '{}' with operation ID: {}",\r
-          opCodeName, deviceRPCResponse.getOperationId());\r
+      if (deviceRPCResponse.getOperationResponse()\r
+          .getOperationCode() instanceof TR069OperationCode) {\r
+        TR069OperationCode operCode =\r
+            (TR069OperationCode) deviceRPCResponse.getOperationResponse().getOperationCode();\r
+        logger.debug("Device RPC Response received for operation: '" + operCode.name()\r
+            + "' with operation ID:" + deviceRPCResponse.getOperationId());\r
+      } else if (deviceRPCResponse.getOperationResponse()\r
+          .getOperationCode() instanceof CustomOperationCode) {\r
+        CustomOperationCode operCode =\r
+            (CustomOperationCode) deviceRPCResponse.getOperationResponse().getOperationCode();\r
+        logger.debug("Device RPC Response received for operation: '" + operCode.getJndiName()\r
+            + "' with operation ID:" + deviceRPCResponse.getOperationId());\r
+      }\r
       jmsTemplate.convertAndSend(NBI_OP_RESULT_Q, deviceRPCResponse);\r
       logger.debug("Successfully posted the operation result event to DM to forward to NBI");\r
     } catch (Exception e) {\r