Search in sources :

Example 1 with SetDataSystemIdentifierDto

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

the class Iec61850RtuDeviceService method handleSetData.

private void handleSetData(final DeviceConnection connection, final SetDataDeviceRequest deviceRequest) throws ProtocolAdapterException {
    final SetDataRequestDto setDataRequest = deviceRequest.getSetDataRequest();
    final Function<Void> function = new Function<Void>() {

        @Override
        public Void apply(final DeviceMessageLog deviceMessageLog) throws ProtocolAdapterException {
            for (final SetDataSystemIdentifierDto identifier : setDataRequest.getSetDataSystemIdentifiers()) {
                final SystemService systemService = Iec61850RtuDeviceService.this.systemServiceFactory.getSystemService(identifier.getSystemType());
                systemService.setData(identifier, Iec61850RtuDeviceService.this.iec61850Client, connection);
            }
            return null;
        }
    };
    this.iec61850Client.sendCommandWithRetry(function, deviceRequest.getDeviceIdentification());
}
Also used : Function(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.Function) DeviceMessageLog(org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog) SystemService(org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.SystemService) SetDataRequestDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetDataRequestDto) SetDataSystemIdentifierDto(org.opensmartgridplatform.dto.valueobjects.microgrids.SetDataSystemIdentifierDto)

Aggregations

DeviceMessageLog (org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog)1 SystemService (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.SystemService)1 Function (org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.helper.Function)1 SetDataRequestDto (org.opensmartgridplatform.dto.valueobjects.microgrids.SetDataRequestDto)1 SetDataSystemIdentifierDto (org.opensmartgridplatform.dto.valueobjects.microgrids.SetDataSystemIdentifierDto)1