use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestDataDto in project open-smart-grid-platform by OSGP.
the class ConfigurationService method setMbusUserKeyByChannel.
public void setMbusUserKeyByChannel(final MessageMetadata messageMetadata, final SetMbusUserKeyByChannelRequestData setMbusUserKeyByChannelRequestData) throws FunctionalException {
log.info("Set M-Bus User Key By Channel for organisationIdentification: {} for deviceIdentification: {}", messageMetadata.getOrganisationIdentification(), messageMetadata.getDeviceIdentification());
final SmartMeter gatewayDevice = this.domainHelperService.findSmartMeter(messageMetadata.getDeviceIdentification());
final SetMbusUserKeyByChannelRequestDataDto requestDto = new SetMbusUserKeyByChannelRequestDataDto(setMbusUserKeyByChannelRequestData.getChannel());
this.osgpCoreRequestMessageSender.send(requestDto, messageMetadata.builder().withIpAddress(gatewayDevice.getIpAddress()).withNetworkSegmentIds(gatewayDevice.getBtsId(), gatewayDevice.getCellId()).build());
}
use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestDataDto in project open-smart-grid-platform by OSGP.
the class SetMbusUserKeyByChannelCommandExecutor method executeBundleAction.
@Override
public ActionResponseDto executeBundleAction(final DlmsConnectionManager conn, final DlmsDevice device, final ActionRequestDto actionRequestDto, final MessageMetadata messageMetadata) throws OsgpException {
this.checkActionRequestType(actionRequestDto);
final SetMbusUserKeyByChannelRequestDataDto setMbusUserKeyByChannelRequestData = (SetMbusUserKeyByChannelRequestDataDto) actionRequestDto;
final GMeterInfoDto gMeterInfo = this.configurationService.getMbusKeyExchangeData(conn, device, setMbusUserKeyByChannelRequestData, messageMetadata);
final MethodResultCode executionResult = this.execute(conn, device, gMeterInfo, messageMetadata);
return this.asBundleResponse(executionResult);
}
Aggregations