Class ExecutionLimitBaseProcess

    • Field Detail

      • log4j

        protected static final org.apache.log4j.Logger log4j
    • Constructor Detail

      • ExecutionLimitBaseProcess

        public ExecutionLimitBaseProcess()
    • Method Detail

      • doExecute

        protected abstract void doExecute()
        Override this method to implement the actions to be executed by the process.
      • preExecute

        public void preExecute​(Map<String,​OpenbravoVersion> modulesVersionMap)
        This method checks whether the doExecute() method should be executed or not according to the execution limits and the executeOnInstall() method when it applies. If eventually the doExecute() method should be executed, it is invoked in this very same method.
        Parameters:
        modulesVersionMap - A data structure that contains module versions mapped by module id
      • getTypeName

        protected abstract String getTypeName()
        This method is overridden to retrieve the name of the process type which is extending this class.
        Returns:
        Name of the process type.
      • getExecutionLimits

        protected abstract 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.
        Returns:
        a ExecutionLimits object which contains the dependent module id and the first and last versions of the module that define the execution logic.
      • executeOnInstall

        protected boolean executeOnInstall()
        This method can be overridden by the subclasses of this class, to specify if they should be executed when installing the dependent module.
        Returns:
        a boolean that indicates if they should be executed when installing the dependent module.
      • getConnectionProvider

        protected ConnectionProvider getConnectionProvider()
        This method returns a connection provider, which can be used to execute statements in the database
        Returns:
        a ConnectionProvider
      • getPropertiesFile

        protected File getPropertiesFile()
      • getSourcePath

        protected String getSourcePath()
                                throws NoSuchFileException
        Get the source path using the user.dir System Property. Navigates two folders backwards and checks the config directory is available to ensure the directory is an Openbravo instance, throwing an exception otherwise
        Returns:
        String the source path
        Throws:
        NoSuchFileException - when the source path directory is not valid