Class FXRatePostProcessor
- java.lang.Object
-
- com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor<OutputType>
-
- com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<Double>
-
- com.activeviam.risk.core.postprocessor.fxconversion.impl.FXRatePostProcessor
-
- All Implemented Interfaces:
IFXRatesAware
,com.quartetfs.biz.pivot.postprocessing.IAggregatedMeasureAware
,com.quartetfs.biz.pivot.postprocessing.IBasicPostProcessor<Double>
,com.quartetfs.biz.pivot.postprocessing.IEvaluator<Double>
,com.quartetfs.biz.pivot.postprocessing.IPartitionedPostProcessor<Double>
,com.quartetfs.biz.pivot.postprocessing.IPostProcessor<Double>
,com.quartetfs.fwk.types.IExtendedPluginValue
,Serializable
@QuartetExtendedPluginValue(intf=com.quartetfs.biz.pivot.postprocessing.IPostProcessor.class, key="FXRatePostProcessor") public class FXRatePostProcessor extends com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<Double> implements IFXRatesAware
Provides dynamic aggregation of values in multiple currencies, with conversion into a contextual reference currency.- Author:
- ActiveViam
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo
asOfDateLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo
currencyLevelInfo
protected IFXRates
fxRates
static String
KEY_LEAF_LEVELS
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo
marketDataSetLevelInfo
static String
PLUGIN_KEY
static String
PREFERRED_CURRENCY_PROPERTY
protected String
preferredCurrency
-
Fields inherited from class com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor
BASIC_POST_PROCESSOR_PREFETCHER, isPartitionedOnRangeLevels
-
Fields inherited from class com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor
aggregatedMeasureName, ANALYSIS_LEVELS_PROPERTY, analysisLevelsToExpand, continuousQueryHandlerKeys, derivedContextDependencies, evaluator, EVALUATOR, explicitContextDependencies, logger, measuresProvider, name, OUTPUT_TYPE, outputType, pivot, prefetchers, PRINT_TIMINGS, printTimings, properties, underlyingMeasures
-
Fields inherited from interface com.activeviam.risk.core.services.IFXRatesAware
PROPERTY_NAME
-
-
Constructor Summary
Constructors Constructor Description FXRatePostProcessor(String name, com.quartetfs.biz.pivot.cube.hierarchy.measures.IPostProcessorCreationContext creationContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
evaluate(com.quartetfs.biz.pivot.ILocation location, Object[] underlyingMeasures)
static Function<com.activeviam.desc.build.ICanStartBuildingMeasures,com.activeviam.desc.build.IHasAtLeastOneMeasure>
getPostProcessorDescription(String measureName, String asOfDateLevel, String marketDataSetLevel, String currencyLevel, String formatter, String folder)
static Double
getRate(com.quartetfs.biz.pivot.query.IQueryCache queryCache, com.qfs.store.IDatastoreVersion datastore, IFXRates fxRates, LocalDate date, String currency, String refCurrency, com.quartetfs.biz.pivot.IActivePivot activePivot, List<Object> leafCoordinates, String marketDataSet)
protected Double
getRate(LocalDate date, String currency, String refCurrency, List<Object> leafCoordinates, String marketDataSet)
String
getType()
void
init(Properties properties)
This post-processor requires one property to be specified in its definition: The leafLevels property ofABaseDynamicAggregationPostProcessor
specifying the leaf levels at which this post-processor will be evaluated, in this case the AsOfDate and Currency levels. The optional preferredCurrency property can be used fix the output of this post-processor to a specific currency, overriding the currency specified by theIReferenceCurrency
context value.static com.activeviam.copper.api.CopperMeasure
measure(String asOfDateLevel, String marketDataSetLevel, String currencyLevel)
This postprocessor returns the current fx rate for a foreign currencyvoid
setFxRates(IFXRates fxRates)
-
Methods inherited from class com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor
checkPrefetchers, compute, computePrefetchFilter, createPrefetchers, createProcedure, evaluate, initializeUnderlyingMeasures, reduce, setPartitioningLevels, supportsAnalysisLevels
-
Methods inherited from class com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor
addContextDependency, checkInterruption, checkOutputType, computeNamePath, computeOutputType, createEvaluator, expandResult, getActivePivot, getContext, getContextDependencies, getContinuousQueryHandlerKeys, getCurrentMeasure, getDatastoreVersion, getDerivedContextDependencies, getExpansionProcedure, getGenericOutputType, getMeasuresProvider, getName, getOutputType, getOutputTypeFromGenericClassParameter, getOutputTypeFromProperties, getPrefetchers, getProperties, getQueryCache, getTypeFromClass, handleCircularDependency, handleNotSupportedAnalysisLevels, handleUnknownUnderlyingMeasure, hideEvaluator, initializeContinuousQueryHandlerKeys, removeAnalysisLevelsFromFilter, restrictLocationAnalysisLevels, retrieveAnalysisLevelsToExpand, retrieveNamedPrefetchAggregatesWithAnalysisLevels, retrievePrefetchAggregates, retrievePrefetchAggregatesWithAnalysisLevels, setAggregatedMeasureName, toString
-
-
-
-
Field Detail
-
PLUGIN_KEY
public static final String PLUGIN_KEY
- See Also:
- Constant Field Values
-
KEY_LEAF_LEVELS
public static final String KEY_LEAF_LEVELS
- See Also:
- Constant Field Values
-
PREFERRED_CURRENCY_PROPERTY
public static final String PREFERRED_CURRENCY_PROPERTY
- See Also:
- Constant Field Values
-
asOfDateLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo asOfDateLevelInfo
-
currencyLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo currencyLevelInfo
-
marketDataSetLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo marketDataSetLevelInfo
-
preferredCurrency
protected String preferredCurrency
-
fxRates
protected IFXRates fxRates
-
-
Constructor Detail
-
FXRatePostProcessor
public FXRatePostProcessor(String name, com.quartetfs.biz.pivot.cube.hierarchy.measures.IPostProcessorCreationContext creationContext)
-
-
Method Detail
-
getPostProcessorDescription
public static Function<com.activeviam.desc.build.ICanStartBuildingMeasures,com.activeviam.desc.build.IHasAtLeastOneMeasure> getPostProcessorDescription(String measureName, String asOfDateLevel, String marketDataSetLevel, String currencyLevel, String formatter, String folder)
-
measure
public static com.activeviam.copper.api.CopperMeasure measure(String asOfDateLevel, String marketDataSetLevel, String currencyLevel)
This postprocessor returns the current fx rate for a foreign currency- Parameters:
asOfDateLevel
- The current datemarketDataSetLevel
- The market data set levelcurrencyLevel
- The foreign currency- Returns:
- The fx rate to the local currency
-
init
public void init(Properties properties) throws com.quartetfs.fwk.QuartetException
This post-processor requires one property to be specified in its definition:- The leafLevels property of
ABaseDynamicAggregationPostProcessor
specifying the leaf levels at which this post-processor will be evaluated, in this case the AsOfDate and Currency levels.
IReferenceCurrency
context value.- Specified by:
init
in interfacecom.quartetfs.biz.pivot.postprocessing.IEvaluator<Double>
- Specified by:
init
in interfacecom.quartetfs.biz.pivot.postprocessing.IPostProcessor<Double>
- Overrides:
init
in classcom.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<Double>
- Throws:
com.quartetfs.fwk.QuartetException
- The leafLevels property of
-
getType
public String getType()
- Specified by:
getType
in interfacecom.quartetfs.fwk.types.IExtendedPluginValue
-
evaluate
public Double evaluate(com.quartetfs.biz.pivot.ILocation location, Object[] underlyingMeasures)
-
getRate
protected Double getRate(LocalDate date, String currency, String refCurrency, List<Object> leafCoordinates, String marketDataSet)
-
getRate
public static Double getRate(com.quartetfs.biz.pivot.query.IQueryCache queryCache, com.qfs.store.IDatastoreVersion datastore, IFXRates fxRates, LocalDate date, String currency, String refCurrency, com.quartetfs.biz.pivot.IActivePivot activePivot, List<Object> leafCoordinates, String marketDataSet)
-
setFxRates
public void setFxRates(IFXRates fxRates)
- Specified by:
setFxRates
in interfaceIFXRatesAware
-
-