use of com.alliander.osgp.dto.valueobjects.microgrids.SystemFilterDto in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850RtuDeviceService method handleGetData.
// ========================
// PRIVATE HELPER METHODS =
// ========================
private GetDataResponseDto handleGetData(final DeviceConnection connection, final GetDataDeviceRequest deviceRequest) throws ProtocolAdapterException {
final GetDataRequestDto requestedData = deviceRequest.getDataRequest();
final String serverName = this.getServerName(deviceRequest);
final Function<GetDataResponseDto> function = new Function<GetDataResponseDto>() {
@Override
public GetDataResponseDto apply(final DeviceMessageLog deviceMessageLog) throws Exception {
final Iec61850RtuDeviceReportingService reportingService = new Iec61850RtuDeviceReportingService(serverName);
reportingService.enableReportingOnDevice(connection, deviceRequest.getDeviceIdentification());
final List<GetDataSystemIdentifierDto> identifiers = new ArrayList<>();
for (final SystemFilterDto systemFilter : requestedData.getSystemFilters()) {
final SystemService systemService = Iec61850RtuDeviceService.this.systemServiceFactory.getSystemService(systemFilter);
final GetDataSystemIdentifierDto getDataSystemIdentifier = systemService.getData(systemFilter, Iec61850RtuDeviceService.this.iec61850Client, connection);
identifiers.add(getDataSystemIdentifier);
}
return new GetDataResponseDto(identifiers, null);
}
};
return this.iec61850Client.sendCommandWithRetry(function, deviceRequest.getDeviceIdentification());
}
Aggregations