Source:
public void handleGetPowerUsageHistoryResponse( final PowerUsageHistoryResponseMessageDataContainerDto powerUsageHistoryResponseMessageDataContainerDto, final String organisationIdentification, final String deviceIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleResponse called for device: for organisation: for messageType: {}", deviceIdentification, organisationIdentification, messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; PowerUsageHistoryResponse powerUsageHistoryResponse = null; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } powerUsageHistoryResponse = new PowerUsageHistoryResponse(this.domainCoreMapper.mapAsList( powerUsageHistoryResponseMessageDataContainerDto.getPowerUsageData(), PowerUsageData.class)); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Exception occurred while getting device power usage history", e); } this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder().withCorrelationUid(correlationUid) .withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result) .withOsgpException(osgpException).withDataObject(powerUsageHistoryResponse).build(), this.getPowerUsageHistoryResponseTimeToLive); }

Target:
public void handleGetPowerUsageHistoryResponse( final PowerUsageHistoryResponseMessageDataContainerDto powerUsageHistoryResponseMessageDataContainerDto, final String organisationIdentification, final String deviceIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleResponse called for device: for organisation: for messageType: {}", deviceIdentification, organisationIdentification, messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; PowerUsageHistoryResponse powerUsageHistoryResponse = null; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } powerUsageHistoryResponse = new PowerUsageHistoryResponse(this.domainCoreMapper.mapAsList( powerUsageHistoryResponseMessageDataContainerDto.getPowerUsageData(), PowerUsageData.class)); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Exception occurred while getting device power usage history", e); } final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .withDataObject(powerUsageHistoryResponse).build(); this.webServiceResponseMessageSender.send(responseMessage, this.getPowerUsageHistoryResponseTimeToLive); }