public class CommunoteInstallerImpl extends Object implements CommunoteInstaller
Constructor and Description |
---|
CommunoteInstallerImpl(ApplicationInitializer initializer)
Create an installer
|
Modifier and Type | Method and Description |
---|---|
boolean |
canConnectToDatabase() |
void |
createCommunoteAccount(String accountName,
String timezoneId)
Create the Communote account (aka the global client).
|
User |
getAdminAccount() |
ClientTO |
getCommunoteAccount() |
StartupProperties |
getDatabaseSettings() |
DatabaseType |
getDatabaseType() |
DatabaseType |
getSupportedDatabaseType(String identifier)
Get the database type for the given identifier
|
List<DatabaseType> |
getSupportedDatabaseTypes() |
void |
initializeApplicationAfterInstallation()
Initialize the application if all steps of the installation were completed.
|
void |
initializeCommunoteAccount(UserVO adminAccount,
Map<ApplicationProperty,String> params)
Initialize the Communote account (aka global client) that was previously created with
CommunoteInstaller.createCommunoteAccount(String, String) |
boolean |
initializeDatabase(DatabaseInitializationStatusCallback statusCallback)
Initialize the application database and inform the provided callback about the current
status.
|
boolean |
isDatabaseInitialized()
Returns whether the global database is initialized, which is the schema exists.
|
StartupProperties |
updateDatabaseSettings(DatabaseType dbType,
Map<CoreConfigurationPropertyConstant,String> settings)
Update the database settings and return the resulting configuration.
|
public CommunoteInstallerImpl(ApplicationInitializer initializer)
initializer
- the initializer that should be called after successfully initializing the
Communote databasepublic boolean canConnectToDatabase()
canConnectToDatabase
in interface CommunoteInstaller
CommunoteInstaller.getDatabaseSettings()
public void createCommunoteAccount(String accountName, String timezoneId) throws InvalidClientIdException, CommunoteInstallerException
CommunoteInstaller
createCommunoteAccount
in interface CommunoteInstaller
accountName
- the name of the accounttimezoneId
- the ID of the timezoneInvalidClientIdException
- in case the configured ID of the global client is not validCommunoteInstallerException
- in case creating the client failedpublic User getAdminAccount()
getAdminAccount
in interface CommunoteInstaller
public ClientTO getCommunoteAccount()
getCommunoteAccount
in interface CommunoteInstaller
public StartupProperties getDatabaseSettings()
getDatabaseSettings
in interface CommunoteInstaller
public DatabaseType getDatabaseType()
getDatabaseType
in interface CommunoteInstaller
public DatabaseType getSupportedDatabaseType(String identifier)
CommunoteInstaller
getSupportedDatabaseType
in interface CommunoteInstaller
identifier
- the identifier of the typepublic List<DatabaseType> getSupportedDatabaseTypes()
getSupportedDatabaseTypes
in interface CommunoteInstaller
public void initializeApplicationAfterInstallation() throws ApplicationInitializationException
CommunoteInstaller
initializeApplicationAfterInstallation
in interface CommunoteInstaller
ApplicationInitializationException
public void initializeCommunoteAccount(UserVO adminAccount, Map<ApplicationProperty,String> params) throws EmailValidationException, ConfigurationInitializationException, CommunoteInstallerException
CommunoteInstaller
CommunoteInstaller.createCommunoteAccount(String, String)
initializeCommunoteAccount
in interface CommunoteInstaller
adminAccount
- VO with details of the first Communote user with administrative privilegesparams
- application parameters to initialize the Communote account withEmailValidationException
- in case the email address of the administrator user is invalidConfigurationInitializationException
- in case the provided application parameters caused an errorCommunoteInstallerException
- in case the initialization failedpublic boolean initializeDatabase(DatabaseInitializationStatusCallback statusCallback)
CommunoteInstaller
initializeDatabase
in interface CommunoteInstaller
statusCallback
- the callback to receive status updatespublic boolean isDatabaseInitialized()
CommunoteInstaller
isDatabaseInitialized
in interface CommunoteInstaller
public StartupProperties updateDatabaseSettings(DatabaseType dbType, Map<CoreConfigurationPropertyConstant,String> settings) throws ConfigurationUpdateException
CommunoteInstaller
updateDatabaseSettings
in interface CommunoteInstaller
dbType
- the database typesettings
- the settings like host and username for connecting to the database of the given
typeConfigurationUpdateException
- in case the configuration cannot be savedCopyright © 2019 Communote team. All rights reserved.