Schema script auto-application

Split NodeStatus transaction out into a shared entity and also record server info
Beginnings of changes required for index rebuilding, both full and incremental


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3654 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-09-01 17:06:07 +00:00
parent f77c66f906
commit e738ddfdf1
31 changed files with 1926 additions and 351 deletions

View File

@@ -60,7 +60,7 @@ public class PatchExecuter implements ApplicationListener
{
logger.info(I18NUtil.getMessage(MSG_CHECKING));
Date before = new Date(System.currentTimeMillis() - 20000L); // 20 seconds ago
Date before = new Date(System.currentTimeMillis() - 60000L); // 60 seconds ago
patchService.applyOutstandingPatches();
Date after = new Date(System .currentTimeMillis() + 20000L); // 20 seconds ahead

View File

@@ -20,7 +20,7 @@ import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.service.cmr.admin.PatchException;
/**
* This patch ensures that an upgrade script has been executed. Upgrade scripts
* This patch ensures that an upgrade scriptUrl has been executed. Upgrade scripts
* should create an entry for the patch with the required ID and execution status
* so that the code in this class is never called. If called, an exception message
* is always generated.
@@ -31,26 +31,37 @@ public class SchemaUpgradeScriptPatch extends AbstractPatch
{
private static final String MSG_NOT_EXECUTED = "patch.schemaUpgradeScript.err.not_executed";
private String scriptName;
private String scriptUrl;
public SchemaUpgradeScriptPatch()
{
}
/**
* @return Returns the URL of the scriptUrl that has to have been run
*/
public String getScriptUrl()
{
return scriptUrl;
}
/**
* Set the name of the upgrade script to execute.
* Set the URL of the upgrade scriptUrl to execute. This is the full URL of the
* file, e.g. <b>classpath:alfresco/patch/scripts/upgrade-1.4/${hibernate.dialect.class}/patchAlfrescoSchemaUpdate-1.4-2.sql</b>
* where the <b>${hibernate.dialect.class}</b> placeholder will be substituted with the Hibernate
* <code>Dialect</code> as configured for the system.
*
* @param scriptName the script filename
* @param scriptUrl the scriptUrl filename
*/
public void setScriptName(String scriptName)
public void setScriptUrl(String script)
{
this.scriptName = scriptName;
this.scriptUrl = script;
}
protected void checkProperties()
{
super.checkProperties();
checkPropertyNotNull(scriptName, "scriptName");
checkPropertyNotNull(scriptUrl, "scriptUrl");
}
/**
@@ -59,6 +70,6 @@ public class SchemaUpgradeScriptPatch extends AbstractPatch
@Override
protected String applyInternal() throws Exception
{
throw new PatchException(MSG_NOT_EXECUTED, scriptName);
throw new PatchException(MSG_NOT_EXECUTED, scriptUrl);
}
}