Class XFSetup

    • Constructor Detail

      • XFSetup

        public XFSetup()
    • Method Detail

      • storeDBSettings

        public static void storeDBSettings​(DBConnectionData data,
                                           boolean suppressOpenListener,
                                           boolean suppressCloseListener)
                                    throws IOException,
                                           org.apache.commons.configuration.ConfigurationException
        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.configuration.ConfigurationException - on errors while saving the configuration
      • storeDBSettings

        public static void storeDBSettings​(DBConnectionData data,
                                           boolean supressAllListener)
                                    throws IOException,
                                           org.apache.commons.configuration.ConfigurationException
        Method to store the db-settings in the correct properties-file
        Parameters:
        data - DBConnectionData the data to store
        supressAllListener - true if the entity-manager-factory listeners should be suppressed, false otherwise
        Throws:
        IOException - on i/o-errors
        org.apache.commons.configuration.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.configuration.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.configuration.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.