Source:
public void handleUpdateKeyResponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleUpdateKeyResponse called for device: for organisation: {}", deviceIdentification, organisationIdentification); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } Ssld device = this.ssldRepository.findByDeviceIdentification(deviceIdentification); if (device == null) { LOGGER.debug("Device does not exist, creating new device", deviceIdentification); device = new Ssld(deviceIdentification); } device.setPublicKeyPresent(true); this.ssldRepository.save(device); LOGGER.info("publicKey has been set for device: for organisation: {}", deviceIdentification, organisationIdentification); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Exception occurred while updating key", e); } final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(exception).build(); this.webServiceResponseMessageSender.send(responseMessage); }

Target:
public void handleUpdateKeyResponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleUpdateKeyResponse called for device: for organisation: {}", deviceIdentification, organisationIdentification); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } Ssld device = this.ssldRepository.findByDeviceIdentification(deviceIdentification); if (device == null) { LOGGER.debug("Device does not exist, creating new device", deviceIdentification); device = new Ssld(deviceIdentification); } device.setPublicKeyPresent(true); this.ssldRepository.save(device); LOGGER.info("publicKey has been set for device: for organisation: {}", deviceIdentification, organisationIdentification); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Exception occurred while updating key", e); } final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .build(); this.webServiceResponseMessageSender.send(responseMessage); }