use of org.opensmartgridplatform.dto.valueobjects.microgrids.SystemFilterDto in project open-smart-grid-platform by OSGP.
the class CommunicationRecoveryService method createRequest.
private GetDataRequestDto createRequest(final RtuDevice rtu) {
LOGGER.debug("Creating data request for rtu {}.", rtu.getDeviceIdentification());
final List<MeasurementFilterDto> measurementFilters = new ArrayList<>();
measurementFilters.add(new MeasurementFilterDto(MEASUREMENT_ID, MEASUREMENT_NODE, false));
final List<SystemFilterDto> systemFilters = new ArrayList<>();
systemFilters.add(new SystemFilterDto(SYSTEM_ID, SYSTEM_TYPE, measurementFilters, false));
return new GetDataRequestDto(systemFilters);
}
use of org.opensmartgridplatform.dto.valueobjects.microgrids.SystemFilterDto in project open-smart-grid-platform 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 Function<GetDataResponseDto> function = new Function<GetDataResponseDto>() {
@Override
public GetDataResponseDto apply(final DeviceMessageLog deviceMessageLog) throws ProtocolAdapterException {
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