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 CommunoteInstallerCommunoteInstaller.getDatabaseSettings()public void createCommunoteAccount(String accountName, String timezoneId) throws InvalidClientIdException, CommunoteInstallerException
CommunoteInstallercreateCommunoteAccount in interface CommunoteInstalleraccountName - 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 CommunoteInstallerpublic ClientTO getCommunoteAccount()
getCommunoteAccount in interface CommunoteInstallerpublic StartupProperties getDatabaseSettings()
getDatabaseSettings in interface CommunoteInstallerpublic DatabaseType getDatabaseType()
getDatabaseType in interface CommunoteInstallerpublic DatabaseType getSupportedDatabaseType(String identifier)
CommunoteInstallergetSupportedDatabaseType in interface CommunoteInstalleridentifier - the identifier of the typepublic List<DatabaseType> getSupportedDatabaseTypes()
getSupportedDatabaseTypes in interface CommunoteInstallerpublic void initializeApplicationAfterInstallation()
throws ApplicationInitializationException
CommunoteInstallerinitializeApplicationAfterInstallation in interface CommunoteInstallerApplicationInitializationExceptionpublic void initializeCommunoteAccount(UserVO adminAccount, Map<ApplicationProperty,String> params) throws EmailValidationException, ConfigurationInitializationException, CommunoteInstallerException
CommunoteInstallerCommunoteInstaller.createCommunoteAccount(String, String)initializeCommunoteAccount in interface CommunoteInstalleradminAccount - 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)
CommunoteInstallerinitializeDatabase in interface CommunoteInstallerstatusCallback - the callback to receive status updatespublic boolean isDatabaseInitialized()
CommunoteInstallerisDatabaseInitialized in interface CommunoteInstallerpublic StartupProperties updateDatabaseSettings(DatabaseType dbType, Map<CoreConfigurationPropertyConstant,String> settings) throws ConfigurationUpdateException
CommunoteInstallerupdateDatabaseSettings in interface CommunoteInstallerdbType - 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.