Class AbstractPatchesSystemSetup
- Direct Known Subclasses:
PatchesDemoSystemSetup
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SystemSetupParametercreateBooleanSystemSetupParameter(String key, String label, boolean defaultValue) Helper method for creating a Boolean setup parameter.protected voidcreateEssentialData(SystemSetupContext setupContext) Method to create initial objects which will be called by system creator during initialization and system update.protected SystemSetupParametercreateFalseBooleanValueSystemSetupParameter(String key, String label) Helper method for creating a system setup parameter withfalseboolean value.protected voidcreateProjectData(SystemSetupContext setupContext) Method to create data that is used in your project.protected SystemSetupParametercreateSystemSetupParameterBasedOnExecutionInfo(Patch patch, boolean rerunableEnabled) Helper method for creating a system setup parameter for Update process type based on rerunable functionality.protected SystemSetupParameterHelper method for creating a Boolean system setup parameter based onprotected voidexecutePatchBasedOnConfiguration(SystemSetup.Type type, Patch patch, boolean isInit) Method executes Patches based on configuration from Properties.protected voidexecutePatchBasedOnDataType(SystemSetup.Type type, Patch patch) Method executes Patches based on data type (ESSENTIAL/PROJECT).protected voidexecutePatchBasedOnNotSelectedProperty(SystemSetup.Type type, Patch patch) Helper method for executing Patch based onprotected voidexecutePatches(SystemSetupContext setupContext, SystemSetup.Type type) Based on executionType kept in JaloSession different execution Patch method is called.protected voidexecutePatchesBasedOnConfiguration(SystemSetup.Type type, boolean isInit) Method iterates through list of Patches and for each executes checking Patch configuration based on properties.protected voidexecutePatchesBasedOnSetupContext(SystemSetupContext setupContext, SystemSetup.Type type) Method iterates through list of Patches and executes these which were setup inSystemSetupContext.protected voidexecuteVersionOnPatch(Patch patch) This method executes given Patch with given version.protected BooleangetBooleanValueForGivenKey(String propertyKey) Checks configuration specified in properties file for given propertyKey.Iterates through list of patches which is configured in spring.protected BooleangetSystemSetupParameter(SystemSetupContext context, String key) Checks setting of a Boolean setup parameter taken from context.protected booleanisPatchHidden(String patchId) Checks configuration for hidden Patch.protected booleanisPatchNotSelected(String patchId) Checks configuration for not selected Patch.protected booleanisPatchRerunable(Patch patch) Checks if specified patch is re runnable.protected booleanChecks configuration for rerunable Patches.protected booleanisPatchSelected(String patchId) Checks configuration for not selected Patch.voidsetPatches(List<Patch> patches) voidsetPatchExecutionService(PatchExecutionService patchExecutionService)
-
Field Details
-
BOOLEAN_TRUE
- See Also:
-
BOOLEAN_FALSE
- See Also:
-
-
Constructor Details
-
AbstractPatchesSystemSetup
public AbstractPatchesSystemSetup()
-
-
Method Details
-
getInitializationOptions
Iterates through list of patches which is configured in spring. Checks configuration for each Patch and based on it creates system setup parameter with default value.- Returns:
List<SystemSetupParameter>which should be visible in hac console
-
createEssentialData
Method to create initial objects which will be called by system creator during initialization and system update. It sets jsp context as a ThreadLocal variable (it is needed for logging data in hac console) and removes after all Patches are executed.- Parameters:
setupContext- the context provides the selected parameters and values
-
createProjectData
Method to create data that is used in your project. This method will be called during the system initialization and system update. It sets jsp context as a ThreadLocal variable (it is needed for logging data in hac console) and removes after all Patches are executed.- Parameters:
setupContext- the context provides the selected parameters and values
-
createFalseBooleanValueSystemSetupParameter
protected SystemSetupParameter createFalseBooleanValueSystemSetupParameter(String key, String label) Helper method for creating a system setup parameter withfalseboolean value.- Parameters:
key- key for system setup parameterlabel- label for system setup parameter- Returns:
SystemSetupParameterwith one value
-
createSystemSetupParameterBasedOnNotSelectedProperty
Helper method for creating a Boolean system setup parameter based onpatches.<patchId>.notSelected
property. If this property is set to true - parameter has default value
falsewith possibility to change it totrue, if property is not specified or hasfalsevalue assigned - parameter has default valuetruewith possibility to change it tofalse.- Parameters:
patch-Patch- Returns:
SystemSetupParameter
-
createBooleanSystemSetupParameter
protected SystemSetupParameter createBooleanSystemSetupParameter(String key, String label, boolean defaultValue) Helper method for creating a Boolean setup parameter.- Parameters:
key- key for system setup parameterlabel- label for system setup parameterdefaultValue- default true/false value for system setup parameter- Returns:
SystemSetupParameterwith one value
-
executePatchBasedOnNotSelectedProperty
Helper method for executing Patch based onpatches.<patchId>.notSelected
property. If this property is set to true - patch won't be executed, if property is not specified or has
falsevalue assigned - patch will be executed.- Parameters:
type-SystemSetup.Typepatch-Patch
-
getSystemSetupParameter
Checks setting of a Boolean setup parameter taken from context. If there is no information about Patch in context method returnsnull.- Parameters:
context-SystemSetupContextkey- key used as a parameter suffix- Returns:
trueif parameter is set to Yes,falseif parameter is set to No,nullif there is no information about Patch
-
createSystemSetupParameterBasedOnExecutionInfo
protected SystemSetupParameter createSystemSetupParameterBasedOnExecutionInfo(Patch patch, boolean rerunableEnabled) Helper method for creating a system setup parameter for Update process type based on rerunable functionality.- Parameters:
patch- for which setup should be createdrerunableEnabled- if rerunable functionality is enabled- Returns:
SystemSetupParameterwith proper value
-
isPatchHidden
Checks configuration for hidden Patch. Ifpatches.<patchId>.hide
property is not specified, value of property
patches.hideAll
is checked. If it's also not specified, default value is returned:
false.- Parameters:
patchId- id of the patch- Returns:
trueif patch should be hidden,falseotherwise
-
isPatchNotSelected
Checks configuration for not selected Patch. Ifpatches.<patchId>.notSelected
property is set to true returned is
true. If it's not specified, default value is taken:false.- Parameters:
patchId- id of the patch- Returns:
trueif patch should not be selected,falseotherwise
-
isPatchSelected
Checks configuration for not selected Patch. Ifpatches.<patchId>.notSelected
property is set to false returned is
true. If it's not specified, default value is taken:false.- Parameters:
patchId- id of the patch- Returns:
trueif patch should not be selected,falseotherwise
-
isPatchRerunableFunctionalityEnabled
protected boolean isPatchRerunableFunctionalityEnabled()Checks configuration for rerunable Patches. Ifpatches.allow.rerun.patches
property is set to true returned is
true. If it's not specified, default value is taken:false.- Returns:
trueif patches can be executed again,falseotherwise
-
isPatchRerunable
Checks if specified patch is re runnable. Checked ispatches.allow.rerun.patches
property or if Patch implements
Rerunnableinterface .- Parameters:
patch-Patch- Returns:
trueif patch can be executed again,falseotherwise
-
getBooleanValueForGivenKey
Checks configuration specified in properties file for given propertyKey.- Parameters:
propertyKey- property key used in configuration file- Returns:
trueif value for given propertyKey equalstrue,falseif value isfalse, otherwisenull
-
executePatches
Based on executionType kept in JaloSession different execution Patch method is called. For HAC execution depends on SystemSetupContext, for ANT: on Configuration from Properties. Handles major exceptions and logs them in patch execution and console. Handled exception is thrown further to stop init/update process. Stack trace is logged by platform mechanism.- Parameters:
setupContext-SystemSetupContexttype-SystemSetup.Type
-
executePatchesBasedOnSetupContext
protected void executePatchesBasedOnSetupContext(SystemSetupContext setupContext, SystemSetup.Type type) Method iterates through list of Patches and executes these which were setup inSystemSetupContext. If no information about Patch is in context and Patch is hidden checked is configuration based on properties.- Parameters:
setupContext-SystemSetupContexttype-SystemSetup.Type
-
executePatchesBasedOnConfiguration
Method iterates through list of Patches and for each executes checking Patch configuration based on properties.- Parameters:
type-SystemSetup.TypeisInit-trueif current processType is Init, otherwise (update)false
-
executePatchBasedOnConfiguration
Method executes Patches based on configuration from Properties.- Parameters:
type-SystemSetup.Typepatch-PatchisInit-trueif current processType is Init, otherwise (update)false
-
executePatchBasedOnDataType
Method executes Patches based on data type (ESSENTIAL/PROJECT).- Parameters:
type-SystemSetup.Typepatch-Patch
-
executeVersionOnPatch
This method executes given Patch with given version. It also means that if given Patch introduced new version comparing to previous one, all previous patches will be executed with this new version (or versions).- Parameters:
patch-Patch
-
setPatches
-
setPatchExecutionService
-