Search in sources :

Example 1 with EventTypeDto

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

the class EventService method enrichEvents.

public void enrichEvents(final MessageMetadata deviceMessageMetadata, final EventMessageDataResponseDto responseDto) throws FunctionalException {
    LOGGER.info("Enrich EventMessageDataResponse with EventTypes for device: {}", deviceMessageMetadata.getDeviceIdentification());
    final SmartMeter smartMeter = this.domainHelperService.findSmartMeter(deviceMessageMetadata.getDeviceIdentification());
    for (final EventDto eventDto : responseDto.getEvents()) {
        final String protocolName = smartMeter.getProtocolInfo() != null ? smartMeter.getProtocolInfo().getProtocol() : null;
        final EventTypeDto eventTypeDto = this.determineEventType(eventDto, protocolName);
        eventDto.setEventTypeDto(eventTypeDto);
    }
}
Also used : EventDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.EventDto) SmartMeter(org.opensmartgridplatform.domain.core.entities.SmartMeter) EventTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.EventTypeDto)

Aggregations

SmartMeter (org.opensmartgridplatform.domain.core.entities.SmartMeter)1 EventDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.EventDto)1 EventTypeDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.EventTypeDto)1