|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pramati.bfly.vm.update.UpdateAdapter
dekoh.portal.install.PortalAppsUpdateHelper
public class PortalAppsUpdateHelper
PortalAppsUpdateHelper helps in achieving backwards compatability for content applications deployed on
Dekoh platform. To use this class applications are expected to do the following.
<oldSchemaVersion>_<newSchemaVersion>_migration.sql E.g: 11_12_migration.sql 12_13_migration.sqlIn above example to upgrade a Database schema from version 11 to 13, this class will execute 11_12_migration.sql followed by 12_13_migration.sql.
PortalAppsUpdateHelper.getMigrationSQLFileNames(String,String) getMigrationSQLFileNames} application can
override the above naming convetion. When the application is installed for the first time the database version will
be 1. This value can also be overridden.
| Field Summary | |
|---|---|
protected String |
currentDBVersion
|
| Fields inherited from interface com.pramati.bfly.vm.api.UpdateHandler |
|---|
CALLBACK_JAR_NAME |
| Constructor Summary | |
|---|---|
PortalAppsUpdateHelper()
|
|
PortalAppsUpdateHelper(PortalDataSource portalDataSource)
|
|
| Method Summary | |
|---|---|
protected Connection |
getConnection()
|
protected String |
getCurrentDatabaseSchemaVersion()
|
protected String[] |
getMigrationSQLFileNames(String oldVersion,
String newVersion)
Return list of SQL file names that will need to be executed to migrate the database between two given versions. |
boolean |
handleApplicationDBChanges(String applicationId,
Version oldVersion,
Version newVersion)
|
protected void |
handleApplicationDBUpgrade(String applicationId,
Version oldVersion,
Version newVersion,
InstallationDetails installationDetails,
Connection connection)
An version of Application is already installed, will need to migrate the database to preserve backwards compatibility. |
protected void |
handleFirstTimeApplicationDBInstallation(String applicationName,
Version applicationVersion,
Connection connection)
Installing the application for the first time. |
void |
init(Map initParams)
This method is currently not used. |
void |
preInstall(InstallEnv env)
Invoked before the component is actually installed or updated. |
| Methods inherited from class com.pramati.bfly.vm.update.UpdateAdapter |
|---|
postInstall, postUninstall, preUninstall |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String currentDBVersion
| Constructor Detail |
|---|
public PortalAppsUpdateHelper()
public PortalAppsUpdateHelper(PortalDataSource portalDataSource)
| Method Detail |
|---|
public void init(Map initParams)
UpdateHandler
init in interface UpdateHandlerinit in class UpdateAdapter
public void preInstall(InstallEnv env)
throws InstallationException
UpdateHandler
preInstall in interface UpdateHandlerpreInstall in class UpdateAdapterenv -
InstallationException
public boolean handleApplicationDBChanges(String applicationId,
Version oldVersion,
Version newVersion)
throws InstallationException
applicationId - oldVersion - newVersion -
InstallationException
protected void handleFirstTimeApplicationDBInstallation(String applicationName,
Version applicationVersion,
Connection connection)
throws InstallationException
applicationName - applicationVersion - connection -
InstallationExceptionprotected String getCurrentDatabaseSchemaVersion()
protected void handleApplicationDBUpgrade(String applicationId,
Version oldVersion,
Version newVersion,
InstallationDetails installationDetails,
Connection connection)
throws RequiredSQLFilesNotFoundException,
InstallationException
applicationId - oldVersion - newVersion - installationDetails - connection -
InstallationException - Execution of one of the SQL statements in the migration sql file fails
RequiredSQLFilesNotFoundException - when the migration SQL files are not found packaged with callback.jar of given
application
protected String[] getMigrationSQLFileNames(String oldVersion,
String newVersion)
oldVersion - newVersion -
protected Connection getConnection()
|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
© 2009 Pramati Technologies - Dekoh - Portal for Developers