Package de.xima.fc.setup
Class XFSetup
- java.lang.Object
-
- de.xima.fc.setup.XFSetup
-
- All Implemented Interfaces:
Serializable
public class XFSetup extends Object implements Serializable
Central class for managing the creating of clients and system-updates- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XFSetup()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static FCMessage
createMandant(IEntityContext ec, Mandant client, MandantMailData mailData, MandantLdapData ldapData, Benutzer user)
Creats an client with the currentIClientCreator
and currentIClientCreateData
static IClientCreateData
getDefaultMandantData()
static String
getMacAddress()
static Mandant
getMandantByFilterCriterion(IEntityContext ec, String filterCriterion, String filterValue)
Method to read an client with the given filter-criterionstatic IClientCreator
getMandantCreator()
static Boolean
isDbConfigured(UserContext uc)
Checks if the database is configured and accessiblestatic boolean
migrateProperties(File backupDir, boolean isOverwrite)
Method to migrate the location and layout of old property-files to the new onestatic void
setCustomMandantCreator(IClientCreator customCreator)
static void
setDefaultMandantData(IClientCreateData defaultData)
static void
setMandantCreator(IClientCreator mandantCreator)
static void
storeDBSettings(DBConnectionData data, boolean supressAllListener)
Method to store the db-settings in the correct properties-filestatic void
storeDBSettings(DBConnectionData data, boolean suppressOpenListener, boolean suppressCloseListener)
Method to store the db-settings in the correct properties-filestatic void
uploadLicense(InputStream input)
Deprecated.The new license management does not store the license file into the file system
{will be removed in next major version}
-
-
-
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 storesuppressOpenListener
-true
if the entity-manager-factory open-listener should be suppressed,false
otherwisesuppressCloseListener
-true
if the entity-manager-factory close-listener should be suppressed,false
otherwise- Throws:
IOException
- on i/o-errorsorg.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 storesupressAllListener
-true
if the entity-manager-factory listeners should be suppressed,false
otherwise- Throws:
IOException
- on i/o-errorsorg.apache.commons.configuration.ConfigurationException
- on errors while saving the configuration
-
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
-InputStream
the source-stream of the license-file- Throws:
IOException
- on i/o-errorsFileNotFoundException
- if the file could not be foundException
- on errors
-
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-transationsfilterCriterion
-String
the key to filter forfilterValue
-String
the value to filter for- Returns:
Mandant
the found client ornull
-
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
-
createMandant
public static FCMessage createMandant(IEntityContext ec, Mandant client, MandantMailData mailData, MandantLdapData ldapData, Benutzer user)
Creats an client with the currentIClientCreator
and currentIClientCreateData
- Parameters:
ec
-IEntityContext
for database-transactionsclient
-Mandant
the client to createuser
-Benutzer
the admin-user for the client- Returns:
FCMessage
as result of the creation
-
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 fromisOverwrite
-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.
-
getMandantCreator
public static IClientCreator getMandantCreator()
- Returns:
IClientCreator
the current client-creator. If not set, a newDefaultClientCreator
-instance will be returned.
-
getDefaultMandantData
public static IClientCreateData getDefaultMandantData()
- Returns:
- the current
IClientCreateData
.null
will be ignored. If not set, a newDefaultClientData
-instance will be returned.
-
setDefaultMandantData
public static void setDefaultMandantData(IClientCreateData defaultData)
- Parameters:
defaultData
-IClientCreateData
the client-create-date to set.null
will not be ignored.
-
-