class FirmwareManagementService extends AbstractService {

    public void handleGetFirmwareVersionResponse(final List<FirmwareVersionDto> firmwareVersionsDto,
            final CorrelationIds ids, final String messageType, final int messagePriority,
            final ResponseMessageResultType deviceResult, final OsgpException exception) {

        LOGGER.info("handleResponse for MessageType: {}", messageType);

        ResponseMessageResultType result = ResponseMessageResultType.OK;
        OsgpException osgpException = exception;

        try {
            if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) {
                LOGGER.error("Device Response not ok.", osgpException);
                throw osgpException;
            }
        } catch (final Exception e) {
            LOGGER.error("Unexpected Exception", e);
            result = ResponseMessageResultType.NOT_OK;
            osgpException = new TechnicalException(ComponentType.UNKNOWN,
                    "Exception occurred while getting device firmware version", e);
        }
        final List<FirmwareVersion> firmwareVersions = this.domainCoreMapper.mapAsList(firmwareVersionsDto,
                FirmwareVersion.class);

        this.checkFirmwareHistory(ids.getDeviceIdentification(), firmwareVersions);

        final boolean hasPendingFirmwareUpdate = this.checkSsldPendingFirmwareUpdate(ids, firmwareVersions);

        if (!hasPendingFirmwareUpdate) {
            final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder()
                    .withIds(ids)
                    .withResult(result)
                    .withOsgpException(osgpException)
                    .withDataObject((Serializable) firmwareVersions)
                    .withMessagePriority(messagePriority)
                    .build();
            this.webServiceResponseMessageSender.send(responseMessage);
        }
    }

    public  FirmwareManagementService();

}