Class XFSetup

    • Constructor Detail

      • XFSetup

        public XFSetup()
    • Method Detail

      • storeDBSettings

        @Deprecated(forRemoval=true)
        public static void storeDBSettings​(DBConnectionData data,
                                           boolean suppressOpenListener,
                                           boolean suppressCloseListener)
                                    throws IOException,
                                           org.apache.commons.configuration2.ex.ConfigurationException
        Deprecated, for removal: This API element is subject to removal in a future version.
        The database configuration is now managed via the SystemPersistenceManager and its related configuration classes. This method will be removed in the next major version.
        Method to store the db-settings in the correct properties-file
        Parameters:
        data - DBConnectionData the data to store
        suppressOpenListener - true if the entity-manager-factory open-listener should be suppressed, false otherwise
        suppressCloseListener - true if the entity-manager-factory close-listener should be suppressed, false otherwise
        Throws:
        IOException - on i/o-errors
        org.apache.commons.configuration2.ex.ConfigurationException - on errors while saving the configuration
      • storeDBSettings

        public static void storeDBSettings​(DBConnectionData data,
                                           boolean suppressAllListener)
                                    throws IOException,
                                           org.apache.commons.configuration2.ex.ConfigurationException
        Method to store the db-settings in the correct properties-file
        Parameters:
        data - DBConnectionData the data to store
        suppressAllListener - true if the entity-manager-factory listeners should be suppressed, false otherwise
        Throws:
        IOException - on i/o-errors
        org.apache.commons.configuration2.ex.ConfigurationException - on errors while saving the configuration
      • getMandantByFilterCriterion

        public static Mandant getMandantByFilterCriterion​(IEntityContext ec,
                                                          String filterCriterion,
                                                          String filterValue)
        Method to read an client with the given filter-criterion
        Parameters:
        ec - IEntityContext for db-transations
        filterCriterion - String the key to filter for
        filterValue - String the value to filter for
        Returns:
        Mandant the found client or null
      • getMacAddress

        public static String getMacAddress()
                                    throws SocketException
        Returns:
        the mac-address of the current system
        Throws:
        SocketException - on errors while reading the mac-address
      • isDbConfigured

        public static Boolean isDbConfigured​(UserContext uc)
        Checks if the database is configured and accessible
        Parameters:
        uc - UserContext
        Returns:
        Boolean if the database is accessible
      • migrateProperties

        public static boolean migrateProperties​(File backupDir,
                                                boolean isOverwrite)
                                         throws org.apache.commons.configuration2.ex.ConfigurationException
        Method to migrate the location and layout of old property-files to the new one
        Parameters:
        backupDir - File to backup-folder to migrate the property-files from
        isOverwrite - true if existing properties should be overridden, false otherwise
        Returns:
        true if the migration was successful, false otherwise
        Throws:
        org.apache.commons.configuration2.ex.ConfigurationException - on errors while creating the configuration-files
      • setCustomMandantCreator

        public static void setCustomMandantCreator​(IClientCreator customCreator)
        Parameters:
        customCreator - IClientCreator the client-creator to set. null will be ignored.
      • setMandantCreator

        public static void setMandantCreator​(IClientCreator mandantCreator)
        Parameters:
        mandantCreator - IClientCreator the client-creator to set. null will not be ignored.
      • setDefaultMandantData

        public static void setDefaultMandantData​(IClientCreateData defaultData)
        Parameters:
        defaultData - IClientCreateData the client-create-date to set. null will not be ignored.