Package de.dlr.proseo.model
Klasse SimpleSelectionRule
java.lang.Object
de.dlr.proseo.model.PersistentObject
de.dlr.proseo.model.SimpleSelectionRule
A rule defining the required input ProductTypes for a certain output ProductType using an ordered list of SelectionPolicys.
 When selecting applicable Products for a JobStep the matching SelectionPolicy defines, whether a Product satisfies a ProductQuery.
- Autor:
- Dr. Thomas Bassler
- 
KonstruktorübersichtKonstruktoren
- 
MethodenübersichtModifizierer und TypMethodeBeschreibungFormat this rule as a JPQL (Java Persistence Query Language) query.asSqlQuery(Instant startTime, Instant stopTime, Map<String, Parameter> additionalFilterConditions, Map<String, String> productColumnMapping, String facilityQuerySql, String facilityQuerySqlSubselect) Format this rule as a native SQL query.booleanTest equality of selection rules based on source and target product classes and processing mode (i. e. there must be only one selection rule for the same source and target classes and the same processing mode).Gets the applicable processor configurationsGets the additional filtering conditionsGets the source product type with filter conditionsCheck whether the selected product is mandatoryGets the minimum percentage of coverage of the desired validity periodgetMode()Gets the applicable processing modeGets the simple selection policiesGets the source product classes (the input products selected by this rule)Gets the target product class (the one for which input products are selected by this rule)inthashCode()Check whether the selected product is mandatory (convenience alias for getIsMandatory())merge(SimpleSelectionRule anotherSimpleSelectionRule) Merge two simple rules creating a new simple ruleselectItems(Collection<SelectionItem> items, Instant startTime, Instant stopTime) Select all items from the given collection that fulfil this rule for the given time interval.voidsetConfiguredProcessors(Set<ConfiguredProcessor> configuredProcessors) Sets the applicable processor configurationsvoidsetFilterConditions(Map<String, Parameter> filterConditions) Sets the additional filtering conditionsvoidsetFilteredSourceProductType(String filteredSourceProductType) Sets the source product type with filter conditionsvoidsetIsMandatory(Boolean isMandatory) Indicate whether the selected product is mandatoryvoidsetMinimumCoverage(Short minimumCoverage) Sets the minimum percentage of coverage of the desired validity periodvoidSets the applicable processing modevoidsetSimplePolicies(List<SimplePolicy> simplePolicies) Sets the simple selection policiesvoidsetSourceProductClass(ProductClass sourceProductClass) Sets the source product classes (the input products selected by this rule)voidsetTargetProductClass(ProductClass targetProductClass) Sets the target product class (the one for which input products are selected by this rule)toString()Von Klasse geerbte Methoden de.dlr.proseo.model.PersistentObjectgetId, getVersion, incrementVersion, setId
- 
Konstruktordetails- 
SimpleSelectionRulepublic SimpleSelectionRule()
 
- 
- 
Methodendetails- 
getModeGets the applicable processing mode- Gibt zurück:
- the mode
 
- 
setModeSets the applicable processing mode- Parameter:
- mode- the mode to set
 
- 
getIsMandatoryCheck whether the selected product is mandatory- Gibt zurück:
- the isMandatory
 
- 
isMandatoryCheck whether the selected product is mandatory (convenience alias for getIsMandatory())- Gibt zurück:
- the isMandatory
 
- 
setIsMandatoryIndicate whether the selected product is mandatory- Parameter:
- isMandatory- the isMandatory to set
 
- 
getMinimumCoverageGets the minimum percentage of coverage of the desired validity period- Gibt zurück:
- the minimumCoverage
 
- 
setMinimumCoverageSets the minimum percentage of coverage of the desired validity period- Parameter:
- minimumCoverage- the minimumCoverage to set
 
- 
getFilterConditionsGets the additional filtering conditions- Gibt zurück:
- the filter conditions
 
- 
setFilterConditionsSets the additional filtering conditions- Parameter:
- filterConditions- the filter conditions to set
 
- 
getFilteredSourceProductTypeGets the source product type with filter conditions- Gibt zurück:
- the filteredSourceProductType
 
- 
setFilteredSourceProductTypeSets the source product type with filter conditions- Parameter:
- filteredSourceProductType- the filteredSourceProductType to set
 
- 
getTargetProductClassGets the target product class (the one for which input products are selected by this rule)- Gibt zurück:
- the targetProductClass
 
- 
setTargetProductClassSets the target product class (the one for which input products are selected by this rule)- Parameter:
- targetProductClass- the targetProductClass to set
 
- 
getSourceProductClassGets the source product classes (the input products selected by this rule)- Gibt zurück:
- the sourceProductClass
 
- 
setSourceProductClassSets the source product classes (the input products selected by this rule)- Parameter:
- sourceProductClass- the sourceProductClass to set
 
- 
getConfiguredProcessorsGets the applicable processor configurations- Gibt zurück:
- the configuredProcessors
 
- 
setConfiguredProcessorsSets the applicable processor configurations- Parameter:
- configuredProcessors- the configuredProcessors to set
 
- 
getSimplePoliciesGets the simple selection policies- Gibt zurück:
- the simplePolicies
 
- 
setSimplePoliciesSets the simple selection policies- Parameter:
- simplePolicies- the simplePolicies to set
 
- 
mergepublic SimpleSelectionRule merge(SimpleSelectionRule anotherSimpleSelectionRule) throws IllegalArgumentException Merge two simple rules creating a new simple ruleFor selection rules containing the policy 'LatestValidityClosest' a merge is possible, if and only if all occurrences of this policy in both rules have the same delta times (this policy actually refers to a point in time and not to a time interval, therefore a merge can only be done between policies referring to the same point in time). - Parameter:
- anotherSimpleSelectionRule- the simple rule to merge this rule with
- Gibt zurück:
- a new SimpleRule object whose policies reflect the merged validity periods
- Löst aus:
- IllegalArgumentException- if a merge of simple rules with different product types or with different delta times for a 'LatestValidityClosest' policy is attempted
 
- 
selectItemspublic List<Object> selectItems(Collection<SelectionItem> items, Instant startTime, Instant stopTime) throws NoSuchElementException, IllegalArgumentException Select all items from the given collection that fulfil this rule for the given time interval. For all items the item type must match the targetProductClass of the rule.- Parameter:
- items- the collection of items to be searched
- startTime- the start time of the time interval to check against
- stopTime- the end time of the time interval to check against
- Gibt zurück:
- a list of all item objects fulfilling the selection rule, or null, if no such qualifying item exists and the selection rule is marked as 'OPTIONAL'
- Löst aus:
- NoSuchElementException- if no item fulfils the selection rule, and the selection rule is marked as 'MANDATORY'
- IllegalArgumentException- if any of the items is not of the correct type
 
- 
asJpqlQuerypublic String asJpqlQuery(Instant startTime, Instant stopTime, Map<String, Parameter> additionalFilterConditions) Format this rule as a JPQL (Java Persistence Query Language) query. The condition in the "where" clause is set in parentheses, so further conditions/filters can be appended to the resulting query.Limitation: For LatestValidityClosest the query may return two products, one to each side of the centre of the given time interval. It is up to the calling program to select the applicable product. - Parameter:
- startTime- the start time to use in the database query
- stopTime- the stop time to use in the database query
- additionalFilterConditions- filter conditions to apply in addition to the rule's own filters (optional)
- Gibt zurück:
- a JPQL string representing this rule
 
- 
asSqlQuerypublic String asSqlQuery(Instant startTime, Instant stopTime, Map<String, Parameter> additionalFilterConditions, Map<String, String> productColumnMapping, String facilityQuerySql, String facilityQuerySqlSubselect) Format this rule as a native SQL query. The condition in the "where" clause is set in parentheses, so further conditions/filters can be appended to the resulting query.Limitation: For LatestValidityClosest the query may return two products, one to each side of the centre of the given time interval. It is up to the calling program to select the applicable product. - Parameter:
- startTime- the start time to use in the database query
- stopTime- the stop time to use in the database query
- additionalFilterConditions- filter conditions to apply in addition to the rule's own filters (optional)
- productColumnMapping- a mapping from attribute names of the Product class to the corresponding SQL column names
- facilityQuerySql- an SQL selection string to add to the selection rule SQL query
- facilityQuerySqlSubselect- an SQL selection string to add to sub-SELECTs in selection policy SQL query conditions
- Gibt zurück:
- an SQL string representing this rule
 
- 
toString
- 
hashCodepublic int hashCode()- Setzt außer Kraft:
- hashCodein Klasse- PersistentObject
 
- 
equalsTest equality of selection rules based on source and target product classes and processing mode (i. e. there must be only one selection rule for the same source and target classes and the same processing mode).- Setzt außer Kraft:
- equalsin Klasse- PersistentObject
- Parameter:
- obj- the reference object with which to compare
- Gibt zurück:
- true if this object is the same as the obj argument according to the definition above; false otherwise
- Siehe auch:
 
 
-