Package org.openbravo.buildvalidation
Class BuildValidation
- java.lang.Object
-
- org.openbravo.base.ExecutionLimitBaseProcess
-
- org.openbravo.buildvalidation.BuildValidation
-
- Direct Known Subclasses:
ExecutionLimitsTest.FakeBuildValidation
public abstract class BuildValidation extends ExecutionLimitBaseProcess
A class extending the BuildValidation class can be used to implement a validation which will be executed before applying a module, or even Openbravo Core.
-
-
Field Summary
-
Fields inherited from class org.openbravo.base.ExecutionLimitBaseProcess
log4j
-
-
Constructor Summary
Constructors Constructor Description BuildValidation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
doExecute()
This method prints some log information before calling the execute() methodabstract List<String>
execute()
This method must be implemented by the BuildValidations, and is used to define the actions that the script itself will take.protected ExecutionLimits
getBuildValidationLimits()
This method can be overridden by the BuildValidation subclasses, to specify the module and the limit versions to define whether the BuildValidation should be executed or not.List<String>
getErrors()
This method retrieves a list with the errors generated by the execution of the BuildValidation.protected ExecutionLimits
getExecutionLimits()
This method can be overridden by the subclasses of this class, to specify the module and the limit versions to define whether they should be executed or not.protected String
getTypeName()
This method returns the name of the class.protected List<String>
handleError(Throwable t)
-
Methods inherited from class org.openbravo.base.ExecutionLimitBaseProcess
executeOnInstall, getConnectionProvider, getPropertiesFile, getSourcePath, preExecute
-
-
-
-
Method Detail
-
execute
public abstract List<String> execute()
This method must be implemented by the BuildValidations, and is used to define the actions that the script itself will take. This method will be automatically called by the BuildValidationHandler when the validation process is run (at the beginning of a rebuild, before the update.database task). This method needs to return a list of error messages. If one or more error messages are provided, the build will stop, and the messages will be shown to the user. If an empty list is provided, the validation will be considered successful, and the build will continue- Returns:
- A list of error Strings
-
doExecute
protected void doExecute()
This method prints some log information before calling the execute() method- Specified by:
doExecute
in classExecutionLimitBaseProcess
-
getTypeName
protected String getTypeName()
This method returns the name of the class.- Specified by:
getTypeName
in classExecutionLimitBaseProcess
- Returns:
- Name of the process type.
-
getBuildValidationLimits
protected ExecutionLimits getBuildValidationLimits()
This method can be overridden by the BuildValidation subclasses, to specify the module and the limit versions to define whether the BuildValidation should be executed or not.- Returns:
- a ExecutionLimits object which contains the dependent module id and the first and last versions of the module that define the execution logic.
-
getExecutionLimits
protected ExecutionLimits getExecutionLimits()
Description copied from class:ExecutionLimitBaseProcess
This method can be overridden by the subclasses of this class, to specify the module and the limit versions to define whether they should be executed or not.- Specified by:
getExecutionLimits
in classExecutionLimitBaseProcess
- Returns:
- a ExecutionLimits object which contains the dependent module id and the first and last versions of the module that define the execution logic.
-
getErrors
public List<String> getErrors()
This method retrieves a list with the errors generated by the execution of the BuildValidation.- Returns:
- A list of errors
-
-