Class SystemService

    • Constructor Detail

      • SystemService

        public SystemService()
    • Method Detail

      • setInstance

        public static void setInstance​(SystemService instance)
      • hasChanged

        public boolean hasChanged​(Class<?>[] clzs,
                                  Date afterDate)
        Returns true if for a certain class there are objects which have changed.
        Parameters:
        clzs - the type of objects which are checked
        afterDate - the timestamp to check
        Returns:
        true if there is an object in the database which changed since afterDate, false otherwise
      • validateModule

        public SystemValidationResult validateModule​(Module module,
                                                     org.apache.ddlutils.model.Database database)
        Validates a specific module, checks the javapackage, dependency on core etc. The database changes of the module are not checked. This is a separate task.
        Parameters:
        module - the module to validate
        database - the database to read the dbschema from
        Returns:
        the validation result
      • validateDatabase

        public SystemValidationResult validateDatabase​(Module module,
                                                       org.apache.ddlutils.model.Database database)
        Validates the database for a specific module.
        Parameters:
        module - the module to validate
        database - the database to read the dbschema from
        Returns:
        the validation result
      • validateDatabase

        public SystemValidationResult validateDatabase​(Module module,
                                                       org.apache.ddlutils.model.Database database,
                                                       boolean validateAD)
        Validates the database for a specific module.
        Parameters:
        module - the module to validate
        database - the database to read the dbschema from
        validateAD - a flag that determines if Application Dictionary checks should be done
        Returns:
        the validation result
      • logValidationResult

        public String logValidationResult​(org.apache.logging.log4j.Logger log,
                                          SystemValidationResult result)
        Prints the validation result grouped by validation type to the log.
        Parameters:
        log - the log to which the validation result is printed
        result - the validation result containing both errors and warning
        Returns:
        the errors are returned as a string
      • deleteClient

        public void deleteClient​(Client client)
        This process deletes a client from the database. During its execution, the Scheduler is stopped, and all sessions active for other users are cancelled
        Parameters:
        client - The client to be deleted
      • resetSafeMode

        public void resetSafeMode​(Connection con)
        Callend after killConnectionsAndSafeMode, it disables the restriction to log only with the System Administrator role
        Parameters:
        con - Connection used to make the queries
      • killConnectionsAndSafeMode

        public void killConnectionsAndSafeMode​(Connection con)
        Kills the active sessions for the current user and sets the System Admin role as the only one available
        Parameters:
        con - the Connection used to execute the queries
      • getPlatform

        public org.apache.ddlutils.Platform getPlatform()
        Returns a dbsourcemanager Platform object
        Returns:
        A Platform object built following the configuration set in the Openbravo.properties file
      • getModelFromDatabase

        public org.apache.ddlutils.model.Database getModelFromDatabase​(org.apache.ddlutils.Platform platform)
        Given a org.apache.ddlutils.Platform, builds a org.apache.ddlutils.model.Database after applying the exclude filters
      • getModelFromDatabase

        public org.apache.ddlutils.model.Database getModelFromDatabase​(org.apache.ddlutils.Platform platform,
                                                                       boolean doPlSqlStandardization)
        Given a org.apache.ddlutils.Platform, builds a org.apache.ddlutils.model.Database after applying the exclude filters. It is possible to specify whether the PLSQL code standardization should be done