\r
import java.util.ArrayList;\r
import java.util.List;\r
-\r
import org.commscope.tr069adapter.acs.common.DeviceInform;\r
import org.commscope.tr069adapter.acs.common.DeviceRPCResponse;\r
import org.commscope.tr069adapter.acs.common.InformType;\r
@Override\r
public void handleOperationResponse(DeviceRPCResponse opResult) {\r
opResult.getOperationResponse().setParameterDTOs(\r
- filterUnsupportedParameters(opResult.getOperationResponse().getParameterDTOs()));\r
+ filterUnsupportedParameters(opResult.getOperationResponse().getParameterDTOs(),\r
+ opResult.getDeviceDetails().getSoftwareVersion(),\r
+ opResult.getDeviceDetails().getHardwareVersion()));\r
syncHandler.notifyResult(opResult);\r
}\r
\r
}\r
\r
private NetConfServerDetails createNtConfServer(BootstrapInform bootstrapNotification) {\r
- String eNodeBName = pnpPreProvisioningHandler\r
- .getEnodeBName(bootstrapNotification.getDeviceDetails().getDeviceId());\r
+ String eNodeBName = pnpPreProvisioningHandler.getEnodeBName(\r
+ bootstrapNotification.getDeviceDetails().getDeviceId(),\r
+ bootstrapNotification.getDeviceDetails().getSoftwareVersion(),\r
+ bootstrapNotification.getDeviceDetails().getHardwareVersion());\r
if (eNodeBName == null)\r
eNodeBName = bootstrapNotification.getDeviceDetails().getDeviceId();\r
- NetConfServerDetails serverInfo = netconfManager\r
- .createNetconfServer(bootstrapNotification.getDeviceDetails().getDeviceId(), eNodeBName);\r
+ NetConfServerDetails serverInfo =\r
+ netconfManager.createNetconfServer(bootstrapNotification.getDeviceDetails().getDeviceId(),\r
+ eNodeBName, bootstrapNotification.getDeviceDetails().getSoftwareVersion(),\r
+ bootstrapNotification.getDeviceDetails().getHardwareVersion());\r
if (serverInfo != null && !NetconfServerManagementError.SUCCESS.equals(serverInfo.getError())) {\r
logger.error("Failed to handle bootstrap notification. Server INFO: {}", serverInfo);\r
logger.error("Failed to create the netconf server for device ID: {} Error: {}",\r
return false;\r
}\r
\r
- public List<ParameterDTO> filterUnsupportedParameters(List<ParameterDTO> parameters) {\r
+ public List<ParameterDTO> filterUnsupportedParameters(List<ParameterDTO> parameters,\r
+ String swVersion, String hwVersion) {\r
List<ParameterDTO> result = new ArrayList<>();\r
if (null != parameters) {\r
for (ParameterDTO param : parameters) {\r
- MOMetaData metaData = metaDataUtil.getMetaDataByTR69Name(param.getParamName());\r
+ MOMetaData metaData =\r
+ metaDataUtil.getMetaDataByTR69Name(param.getParamName(), swVersion, hwVersion);\r
if (null != metaData) {\r
result.add(param);\r
}\r
deviceOperDAO.save(fwDetails);\r
\r
logger.debug("sending download-event notification to netconfserver");\r
- NetConfNotificationDTO netConfNotifDTO =\r
- new NetConfNotificationDTO(notification.getDeviceDetails().getDeviceId(), null, true);\r
- netConfNotifDTO.setParameters(paramList);\r
- netConfNotifDTO.setUri(SOFT_MGMT_NS_URI);\r
\r
- if (notiSender.sendCustomNotification(netConfNotifDTO).getStatusCode().is2xxSuccessful()) {\r
+ if (notiSender.sendCustomNotification(notification.getDeviceDetails().getDeviceId(),\r
+ paramList, SOFT_MGMT_NS_URI).getStatusCode().is2xxSuccessful()) {\r
logger.debug("sending download-event notification to netconfserver sucess");\r
} else {\r
logger.error("sending download-event notification to netconfserver failed");\r
if (notification.getDeviceDetails().getSoftwareVersion()\r
.equalsIgnoreCase(devDetails.getSwVersion())) {\r
paramList.add(new ParameterDTO("activation-event.status", "APPLICATION_ERROR"));\r
- paramList.add(new ParameterDTO("activation-event.error-message", "Same Software Version is reported after upgrade"));\r
+ paramList.add(new ParameterDTO("activation-event.error-message",\r
+ "Same Software Version is reported after upgrade"));\r
devDetails.setDownLoadStatus(FirwareUpgradeStatus.ACTIVATION_ERROR.getStatus());\r
} else {\r
devDetails.setSwVersion(notification.getDeviceDetails().getSoftwareVersion());\r
deviceOperDAO.save(devDetails);\r
\r
logger.debug("sending activation-event notification to netconfserver");\r
- NetConfNotificationDTO netConfNotifDTO =\r
- new NetConfNotificationDTO(notification.getDeviceDetails().getDeviceId(), null, true);\r
- netConfNotifDTO.setParameters(paramList);\r
- netConfNotifDTO.setUri(SOFT_MGMT_NS_URI);\r
\r
- if (notiSender.sendCustomNotification(netConfNotifDTO).getStatusCode().is2xxSuccessful()) {\r
+ if (notiSender.sendCustomNotification(notification.getDeviceDetails().getDeviceId(),\r
+ paramList, SOFT_MGMT_NS_URI).getStatusCode().is2xxSuccessful()) {\r
logger.debug("sending activation-event notification to netconfserver sucess");\r
} else {\r
logger.error("sending activation-event notification to netconfserver failed");\r