Search in sources :

Example 1 with SetClockConfigurationRequestDto

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

the class ConfigurationService method setClockConfiguration.

public void setClockConfiguration(final MessageMetadata messageMetadata, final SetClockConfigurationRequestData setClockConfigurationRequest) throws FunctionalException {
    log.info("setClockConfiguration for organisationIdentification: {} for deviceIdentification: {}", messageMetadata.getOrganisationIdentification(), messageMetadata.getDeviceIdentification());
    final SmartMeter smartMeter = this.domainHelperService.findSmartMeter(messageMetadata.getDeviceIdentification());
    final SetClockConfigurationRequestDto requestDto = this.configurationMapper.map(setClockConfigurationRequest, SetClockConfigurationRequestDto.class);
    this.osgpCoreRequestMessageSender.send(requestDto, messageMetadata.builder().withIpAddress(smartMeter.getIpAddress()).withNetworkSegmentIds(smartMeter.getBtsId(), smartMeter.getCellId()).build());
}
Also used : SetClockConfigurationRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetClockConfigurationRequestDto) SmartMeter(org.opensmartgridplatform.domain.core.entities.SmartMeter)

Example 2 with SetClockConfigurationRequestDto

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

the class SetClockConfigurationRequestMessageProcessor method handleMessage.

@Override
protected Serializable handleMessage(final DlmsConnectionManager conn, final DlmsDevice device, final Serializable requestObject, final MessageMetadata messageMetadata) throws OsgpException {
    this.assertRequestObjectType(SetClockConfigurationRequestDto.class, requestObject);
    final SetClockConfigurationRequestDto clockConfiguration = (SetClockConfigurationRequestDto) requestObject;
    this.configurationService.setClockConfiguration(conn, device, clockConfiguration, messageMetadata);
    return null;
}
Also used : SetClockConfigurationRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetClockConfigurationRequestDto)

Aggregations

SetClockConfigurationRequestDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.SetClockConfigurationRequestDto)2 SmartMeter (org.opensmartgridplatform.domain.core.entities.SmartMeter)1