Merged 5.1-MC1 (5.1.0) to HEAD (5.1)

119086 adavis: Merged 5.1.N (5.1.1) to 5.1-MC1 (5.1.0)
      118716 arebegea: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
         118657 adavis: Merged 5.0.2-CLOUD42 (Cloud ) to 5.0.N (5.0.4)
            118656 adavis: Merged 5.0.2-CLOUD (Cloud ) to 5.0.2-CLOUD42 (Cloud )
               118655 adavis: Merged 5.0.2-PLUS (5.0.2-PLUS) to 5.0.2-CLOUD (Cloud )
                  118542 amorarasu: Merged DEV to 5.0.2-PLUS (5.0.2-PLUS)
                     117462 118473 amorarasu: MNT-15147: Cloud 40 Upgrade takes too long
                        - Make the patch.fixPersonSizeCurrentType to not apply to tenants
                        - Added support for making patch.addUnmovableAspect deferred


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@119927 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jean-Pierre Huynh
2015-12-10 10:22:56 +00:00
parent 7e90c583d8
commit 73561a5fa3
6 changed files with 51 additions and 7 deletions

View File

@@ -51,13 +51,13 @@ public interface PatchService
* Apply all outstanding patches that are relevant to the repo. If there is a failure, then the patches that were
* applied will remain so, but the process will not attempt to apply any further patches.
*
* @return Returns true if all outstanding patches were applied, or false if the process was termintated before all
* @return Returns true if all outstanding patches were applied, or false if the process was terminated before all
* patches could be applied.
*/
public boolean applyOutstandingPatches();
/**
* Apply the specified patch that is relevant to the repo.
* Apply the specified patch that is relevant to the repo, regardless of the <b>deferred</b> flag.
*
* @param patch the patch object
* @return true if the specified patch and its dependencies were applied, or

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -183,6 +183,10 @@ public class PatchServiceImpl implements PatchService
// go through all the patches and apply them where necessary
for (Patch patch : sortedPatches)
{
if(patch.isDeferred())
{
continue;
}
// apply the patch
success = applyPatchAndDependencies(patch, appliedPatchesById);
if (!success)
@@ -284,9 +288,9 @@ public class PatchServiceImpl implements PatchService
AppliedPatch appliedPatch = appliedPatchesById.get(id);
if (appliedPatch != null && appliedPatch.getSucceeded())
{
if (appliedPatch.getWasExecuted() && appliedPatch.getSucceeded())
if (appliedPatch.getWasExecuted())
{
// It was sucessfully executed
// It was successfully executed
return true;
}
// We give the patch another chance
@@ -549,6 +553,7 @@ public class PatchServiceImpl implements PatchService
patch.getId(),
I18NUtil.getMessage(patch.getDescription()));
logger.info(msg);
// the patch is executed regardless of the deferred flag value
report = (patch.isDeferred()) ? patch.applyAsync() : patch.apply();
state = STATE.APPLIED;
}

View File

@@ -25,7 +25,7 @@ import java.util.Iterator;
import java.util.List;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.admin.patch.AsynchronousPatch;
import org.alfresco.repo.batch.BatchProcessWorkProvider;
import org.alfresco.repo.batch.BatchProcessor;
import org.alfresco.repo.policy.BehaviourFilter;
@@ -47,7 +47,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
* @author Alex Mukha
*
*/
public class AddUnmovableAspectToSitesPatch extends AbstractPatch
public class AddUnmovableAspectToSitesPatch extends AsynchronousPatch
{
private static Log logger = LogFactory.getLog(AddUnmovableAspectToSitesPatch.class);
private static final String MSG_SUCCESS = "patch.addUnmovableAspect.result";