use of org.opensmartgridplatform.dto.valueobjects.smartmetering.EncryptionKeyStatusTypeDto in project open-smart-grid-platform by OSGP.
the class GetMbusEncryptionKeyStatusByChannelCommandExecutor method execute.
@Override
public GetMbusEncryptionKeyStatusByChannelResponseDto execute(final DlmsConnectionManager conn, final DlmsDevice device, final GetMbusEncryptionKeyStatusByChannelRequestDataDto request, final MessageMetadata messageMetadata) throws OsgpException {
final GetMBusDeviceOnChannelRequestDataDto mbusDeviceOnChannelRequest = new GetMBusDeviceOnChannelRequestDataDto(device.getDeviceIdentification(), request.getChannel());
final ChannelElementValuesDto channelElementValues = this.getMBusDeviceOnChannelCommandExecutor.execute(conn, device, mbusDeviceOnChannelRequest, messageMetadata);
if (!channelElementValues.hasChannel() || !channelElementValues.hasDeviceTypeIdentification() || !channelElementValues.hasManufacturerIdentification()) {
throw new FunctionalException(FunctionalExceptionType.NO_DEVICE_FOUND_ON_CHANNEL, ComponentType.DOMAIN_SMART_METERING);
}
final EncryptionKeyStatusTypeDto encryptionKeyStatusType = this.getMbusEncryptionKeyStatusCommandExecutor.getEncryptionKeyStatusTypeDto(request.getChannel(), conn);
return new GetMbusEncryptionKeyStatusByChannelResponseDto(device.getDeviceIdentification(), encryptionKeyStatusType, request.getChannel());
}
Aggregations