Class DataNeedCalculationServiceImpl
java.lang.Object
energy.eddie.regionconnector.shared.services.data.needs.DataNeedCalculationServiceImpl
- All Implemented Interfaces:
DataNeedCalculationService<DataNeed>
public class DataNeedCalculationServiceImpl
extends Object
implements DataNeedCalculationService<DataNeed>
Implementation of the
DataNeedCalculationService that can be customized to fit the requirements of the region connector.-
Constructor Summary
ConstructorsConstructorDescriptionDataNeedCalculationServiceImpl(DataNeedsService dataNeedsService, RegionConnectorMetadata regionConnectorMetadata) DataNeedCalculationServiceImpl(DataNeedsService dataNeedsService, RegionConnectorMetadata regionConnectorMetadata, PermissionTimeframeStrategy strategy, EnergyDataTimeframeStrategy energyDataTimeframeStrategy, List<Predicate<DataNeed>> additionalChecks) Constructs an instance with customPermissionTimeframeStrategyandEnergyDataTimeframeStrategy. -
Method Summary
Modifier and TypeMethodDescriptionCalculates relevant information for a data needcalculate(DataNeed dataNeed, ZonedDateTime referenceDateTime) Calculates relevant information for a data need, using the reference datetimeCalculate relevant information for a given data need IDcalculate(String dataNeedId, ZonedDateTime referenceDateTime) Calculates relevant information for given data need ID, using the reference datetimeThe id of the region-connector that provides the implementation of this service.
-
Constructor Details
-
DataNeedCalculationServiceImpl
public DataNeedCalculationServiceImpl(DataNeedsService dataNeedsService, RegionConnectorMetadata regionConnectorMetadata) UsesPermissionEndIsEnergyDataEndStrategyfor thePermissionTimeframeStrategyandDefaultEnergyDataTimeframeStrategyfor theEnergyDataTimeframeStrategy. These are used to calculate the start and end of a permission request and the start and end of the metered data, if needed.- Parameters:
dataNeedsService- service to get the data needregionConnectorMetadata- metadata of the region connector
-
-
Method Details
-
calculate
Description copied from interface:DataNeedCalculationServiceCalculates relevant information for a data need- Specified by:
calculatein interfaceDataNeedCalculationService<DataNeed>- Parameters:
dataNeed- the data need- Returns:
- the calculation results for the data need
-
calculate
Description copied from interface:DataNeedCalculationServiceCalculates relevant information for a data need, using the reference datetime- Specified by:
calculatein interfaceDataNeedCalculationService<DataNeed>- Parameters:
dataNeed- the data needreferenceDateTime- the reference datetime the calculations are based on- Returns:
- the calculation results for the data need
-
calculate
Description copied from interface:DataNeedCalculationServiceCalculate relevant information for a given data need ID- Specified by:
calculatein interfaceDataNeedCalculationService<DataNeed>- Parameters:
dataNeedId- the ID of the data need- Returns:
- the calculation results for the data need
-
calculate
Description copied from interface:DataNeedCalculationServiceCalculates relevant information for given data need ID, using the reference datetime- Specified by:
calculatein interfaceDataNeedCalculationService<DataNeed>- Parameters:
dataNeedId- the ID of the data needreferenceDateTime- the reference datetime the calculations are based on- Returns:
- the calculation results for the data need
-
regionConnectorId
Description copied from interface:DataNeedCalculationServiceThe id of the region-connector that provides the implementation of this service.- Specified by:
regionConnectorIdin interfaceDataNeedCalculationService<DataNeed>- Returns:
- region-connector id
-