Search in sources :

Example 1 with GetMbusEncryptionKeyStatusByChannelResponseDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelResponseDto in project open-smart-grid-platform by OSGP.

the class GetMbusEncryptionKeyStatusByChannelResponseMessageProcessor method handleMessage.

@Override
protected void handleMessage(final MessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) {
    final GetMbusEncryptionKeyStatusByChannelResponseDto getMbusEncryptionKeyStatusByChannelResponseDto = (GetMbusEncryptionKeyStatusByChannelResponseDto) responseMessage.getDataObject();
    this.configurationService.handleGetMbusEncryptionKeyStatusByChannelResponse(deviceMessageMetadata, responseMessage.getResult(), osgpException, getMbusEncryptionKeyStatusByChannelResponseDto);
}
Also used : GetMbusEncryptionKeyStatusByChannelResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelResponseDto)

Example 2 with GetMbusEncryptionKeyStatusByChannelResponseDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelResponseDto 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());
}
Also used : ChannelElementValuesDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ChannelElementValuesDto) EncryptionKeyStatusTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.EncryptionKeyStatusTypeDto) GetMbusEncryptionKeyStatusByChannelResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelResponseDto) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) GetMBusDeviceOnChannelRequestDataDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMBusDeviceOnChannelRequestDataDto)

Aggregations

GetMbusEncryptionKeyStatusByChannelResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelResponseDto)2 ChannelElementValuesDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ChannelElementValuesDto)1 EncryptionKeyStatusTypeDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.EncryptionKeyStatusTypeDto)1 GetMBusDeviceOnChannelRequestDataDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMBusDeviceOnChannelRequestDataDto)1 FunctionalException (org.opensmartgridplatform.shared.exceptionhandling.FunctionalException)1