Package de.xima.fc.setup
Class XFSetup
java.lang.Object
de.xima.fc.setup.XFSetup
- All Implemented Interfaces:
Serializable
Central class for managing the creating of clients and system-updates
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FCMessagecreateClient(IEntityContext ec, Mandant client, MandantMailData mailData, String adminMail, IUser creator) Creates a client with the currentIClientCreatorand currentIClientCreateDatastatic FCMessagecreateMandant(IEntityContext ec, Mandant client, MandantMailData mailData, MandantLdapData ldapData, Benutzer user) Deprecated.static IClientCreateDatastatic Stringstatic MandantgetMandantByFilterCriterion(IEntityContext ec, String filterCriterion, String filterValue) Method to read an client with the given filter-criterionstatic IClientCreatorstatic BooleanChecks if the database is configured and accessiblestatic booleanmigrateProperties(File backupDir, boolean isOverwrite) Method to migrate the location and layout of old property-files to the new onestatic voidsetCustomMandantCreator(IClientCreator customCreator) static voidsetDefaultMandantData(IClientCreateData defaultData) static voidsetMandantCreator(IClientCreator mandantCreator) static voidstoreDBSettings(DBConnectionData data, boolean supressAllListener) Method to store the db-settings in the correct properties-filestatic voidstoreDBSettings(DBConnectionData data, boolean suppressOpenListener, boolean suppressCloseListener) Method to store the db-settings in the correct properties-filestatic voiduploadLicense(InputStream input) Deprecated.The new license management does not store the license file into the file system (will be removed in next major version).
-
Constructor Details
-
XFSetup
public XFSetup()
-
-
Method Details
-
storeDBSettings
public static void storeDBSettings(DBConnectionData data, boolean suppressOpenListener, boolean suppressCloseListener) throws IOException, org.apache.commons.configuration2.ex.ConfigurationException Method to store the db-settings in the correct properties-file- Parameters:
data-DBConnectionDatathe data to storesuppressOpenListener-trueif the entity-manager-factory open-listener should be suppressed,falseotherwisesuppressCloseListener-trueif the entity-manager-factory close-listener should be suppressed,falseotherwise- Throws:
IOException- on i/o-errorsorg.apache.commons.configuration2.ex.ConfigurationException- on errors while saving the configuration
-
storeDBSettings
public static void storeDBSettings(DBConnectionData data, boolean supressAllListener) throws IOException, org.apache.commons.configuration2.ex.ConfigurationException Method to store the db-settings in the correct properties-file- Parameters:
data-DBConnectionDatathe data to storesupressAllListener-trueif the entity-manager-factory listeners should be suppressed,falseotherwise- Throws:
IOException- on i/o-errorsorg.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-IEntityContextfor db-transationsfilterCriterion-Stringthe key to filter forfilterValue-Stringthe value to filter for- Returns:
Mandantthe found client ornull
-
getMacAddress
- Returns:
- the mac-address of the current system
- Throws:
SocketException- on errors while reading the mac-address
-
isDbConfigured
Checks if the database is configured and accessible- Parameters:
uc-UserContext- Returns:
Booleanif the database is accessible
-
createClient
public static FCMessage createClient(IEntityContext ec, Mandant client, MandantMailData mailData, String adminMail, IUser creator) Creates a client with the currentIClientCreatorand currentIClientCreateData- Parameters:
ec-IEntityContextfor database-transactionsclient-Mandantthe client to createmailData- Mail server settings for the new client.adminMail- email address of the admin usercreator- the user that is creating the client (need for protocol purposes)- Returns:
FCMessageas result of the creation
-
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-Fileto backup-folder to migrate the property-files fromisOverwrite-trueif existing properties should be overridden,falseotherwise- Returns:
trueif the migration was successful,falseotherwise- Throws:
org.apache.commons.configuration2.ex.ConfigurationException- on errors while creating the configuration-files
-
setCustomMandantCreator
- Parameters:
customCreator-IClientCreatorthe client-creator to set.nullwill be ignored.
-
setMandantCreator
- Parameters:
mandantCreator-IClientCreatorthe client-creator to set.nullwill not be ignored.
-
getMandantCreator
- Returns:
IClientCreatorthe current client-creator. If not set, a newDefaultClientCreator-instance will be returned.
-
getDefaultMandantData
- Returns:
- the current
IClientCreateData.nullwill be ignored. If not set, a newDefaultClientData-instance will be returned.
-
setDefaultMandantData
- Parameters:
defaultData-IClientCreateDatathe client-create-date to set.nullwill not be ignored.
-
uploadLicense
@Deprecated public static void uploadLicense(InputStream input) throws IOException, FileNotFoundException, Exception Deprecated.The new license management does not store the license file into the file system (will be removed in next major version).Uploads the license-file to the correct path- Parameters:
input-InputStreamthe source-stream of the license-file- Throws:
IOException- on i/o-errorsFileNotFoundException- if the file could not be foundException- on errors
-
createMandant
@Deprecated public static FCMessage createMandant(IEntityContext ec, Mandant client, MandantMailData mailData, MandantLdapData ldapData, Benutzer user) Deprecated.Creates an client with the currentIClientCreatorand currentIClientCreateData- Parameters:
ec-IEntityContextfor database-transactionsclient-Mandantthe client to createmailData- Mail server settings for the new client.ldapData- LDAP settings for the new client.user-Benutzerthe admin-user for the client- Returns:
FCMessageas result of the creation
-
createClient(IEntityContext, Mandant, MandantMailData, String, IUser)instead.