Class SourceRuleModelHistoricalContentCreator
java.lang.Object
de.hybris.platform.ruleengineservices.versioning.impl.SourceRuleModelHistoricalContentCreator
- All Implemented Interfaces:
RuleModelHistoricalContentCreator
- Direct Known Subclasses:
CampaignSourceRuleModelHistoricalContentCreator
public class SourceRuleModelHistoricalContentCreator
extends Object
implements RuleModelHistoricalContentCreator
Helper class, that manages the historical version of the SourceRule object creation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanassociatedTypesChanged(AbstractRuleModel ruleModel, InterceptorContext ctx) protected voidcopyField(ItemModelContext modelContext, SourceRuleModel sourceRule, Map.Entry<String, Set<Locale>> attribute) voidcreateHistoricalVersion(SourceRuleModel sourceRule, InterceptorContext context) creates the historical version of the modelprotected voidcreateHistoricalVersionIfNeeded(SourceRuleModel sourceRule, InterceptorContext ctx) protected SourceRuleModeldoCreateHistoricalVersion(SourceRuleModel sourceRule, InterceptorContext context) protected booleanessentialFieldsAreModified(AbstractRuleModel ruleModel, InterceptorContext ctx) protected List<HistoricalRuleContentProvider>protected String[]protected <T> TgetOriginal(SourceRuleModel sourceRule, InterceptorContext context, String attributeQualifier) protected RuleDaoprotected booleanhasStatus(InterceptorContext ctx, SourceRuleModel sourceRule, RuleStatus ruleStatus) protected booleanhistoricalVersionMustBeCreated(SourceRuleModel sourceRule, InterceptorContext context) protected voidincrementRuleModelVersion(SourceRuleModel ruleModel) protected booleanisUnpublished(SourceRuleModel sourceRule, InterceptorContext context) protected booleanmatchAnyOf(String sample, String... probes) protected booleanmodelIsBeingModified(AbstractRuleModel ruleModel, InterceptorContext ctx) protected booleanmodelIsValid(SourceRuleModel sourceRule) protected voidputOriginalValuesIntoHistoricalVersion(SourceRuleModel sourceRule, SourceRuleModel historicalSourceRule, InterceptorContext ctx) protected voidresetModifiedFields(SourceRuleModel toSourceRule, InterceptorContext ctx) protected booleanruleStatusChangedToPublished(SourceRuleModel model, InterceptorContext context) voidsetHistoricalRuleContentProviders(List<HistoricalRuleContentProvider> historicalRuleContentProviders) voidsetRuleDao(RuleDao ruleDao)
-
Constructor Details
-
SourceRuleModelHistoricalContentCreator
public SourceRuleModelHistoricalContentCreator()
-
-
Method Details
-
createHistoricalVersion
public void createHistoricalVersion(@Nonnull SourceRuleModel sourceRule, @Nonnull InterceptorContext context) throws InterceptorException Description copied from interface:RuleModelHistoricalContentCreatorcreates the historical version of the model- Specified by:
createHistoricalVersionin interfaceRuleModelHistoricalContentCreator- Parameters:
sourceRule- - the model to be versionedcontext- - the InterceptorContext instance, where the versioned copy is registered- Throws:
InterceptorException
-
isUnpublished
-
createHistoricalVersionIfNeeded
protected void createHistoricalVersionIfNeeded(SourceRuleModel sourceRule, InterceptorContext ctx) throws InterceptorException - Throws:
InterceptorException
-
resetModifiedFields
-
copyField
protected void copyField(ItemModelContext modelContext, SourceRuleModel sourceRule, Map.Entry<String, Set<Locale>> attribute) -
incrementRuleModelVersion
-
historicalVersionMustBeCreated
protected boolean historicalVersionMustBeCreated(SourceRuleModel sourceRule, InterceptorContext context) -
ruleStatusChangedToPublished
-
doCreateHistoricalVersion
protected SourceRuleModel doCreateHistoricalVersion(SourceRuleModel sourceRule, InterceptorContext context) -
putOriginalValuesIntoHistoricalVersion
protected void putOriginalValuesIntoHistoricalVersion(SourceRuleModel sourceRule, SourceRuleModel historicalSourceRule, InterceptorContext ctx) -
modelIsValid
-
modelIsBeingModified
-
essentialFieldsAreModified
-
associatedTypesChanged
-
getNonEssentialAttributes
-
matchAnyOf
-
hasStatus
protected boolean hasStatus(InterceptorContext ctx, SourceRuleModel sourceRule, RuleStatus ruleStatus) -
getOriginal
protected <T> T getOriginal(SourceRuleModel sourceRule, InterceptorContext context, String attributeQualifier) -
getRuleDao
-
setRuleDao
-
getHistoricalRuleContentProviders
-
setHistoricalRuleContentProviders
public void setHistoricalRuleContentProviders(List<HistoricalRuleContentProvider> historicalRuleContentProviders)
-