Search in sources :

Example 1 with SetMbusUserKeyByChannelRequestDataDto

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());
}
Also used : SmartMeter(org.opensmartgridplatform.domain.core.entities.SmartMeter) SetMbusUserKeyByChannelRequestDataDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestDataDto)

Example 2 with SetMbusUserKeyByChannelRequestDataDto

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);
}
Also used : MethodResultCode(org.openmuc.jdlms.MethodResultCode) GMeterInfoDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GMeterInfoDto) SetMbusUserKeyByChannelRequestDataDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestDataDto)

Aggregations

SetMbusUserKeyByChannelRequestDataDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestDataDto)2 MethodResultCode (org.openmuc.jdlms.MethodResultCode)1 SmartMeter (org.opensmartgridplatform.domain.core.entities.SmartMeter)1 GMeterInfoDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.GMeterInfoDto)1