Package org.alfresco.repo.admin.patch
Interface Patch
-
- All Known Implementing Classes:
AbstractPatch,AbstractPermissionChangePatch,AddDutchEmailTemplatesPatch,AddGroupAuthorityPatch,AddSurfConfigFoldersPatch,AddUnmovableAspectToSitesPatch,AdminUserPatch,AliasableAspectPatch,AsynchronousPatch,CalendarAllDayEventDatesCorrectingPatch,FixBpmPackagesPatch,FixPersonSizeCurrentTypePatch,FixTemplatePatch,GenericBootstrapPatch,GenericDeleteAspectForTypePatch,GenericEMailTemplateUpdatePatch,GenericMimetypeRenamePatch,GenericWorkflowPatch,ImapFoldersPatch,ImapUnsubscribedAspectPatch,MigrateTenantsFromAttrsToTablePatch,NoLongerSupportedPatch,NoOpPatch,QNamePatch,RenameSiteAuthorityDisplayName,SamplePatch,SchemaUpgradeScriptPatch,SharedFolderPatch,SimplePatch,SiteLoadPatch,SurfConfigFolderPatch,SWSDPPatch,UpdateAuditTemplatePatch,UpdateFollowingEmailTemplatesPatch,UpdateWorkflowNotificationTemplatesPatch
public interface PatchA patch is an executable class that makes a change to persisted data.Auditing information is not maintained by the patch - rather it is solely responsible for the execution of the processes necessary to apply the patch.
Patches must not be reappliable. It is up to the patch management systems to ensure that patches are never reapplied.
- Since:
- 1.2
- Author:
- Derek Hulley
- See Also:
AbstractPatch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanapplies(int version)Check if the patch is applicable to a given schema version.java.lang.Stringapply()Applies the patch.java.lang.StringapplyAsync()Apply the patch, regardless of the deferred flag.java.util.List<Patch>getAlternatives()Get patches that could have done the work alreadyjava.util.List<Patch>getDependsOn()Get patches that this patch depends onjava.lang.StringgetDescription()intgetFixesFromSchema()intgetFixesToSchema()java.lang.StringgetId()intgetTargetSchema()booleanisDeferred()Indicates whether the patch must be deferred (not to be executed in bootstrap) or notbooleanisForce()booleanisIgnored()Is this patch just ignored - never considered for applicationbooleanrequiresTransaction()Does the patch need to be wrapped in a transaction?
-
-
-
Method Detail
-
getId
java.lang.String getId()
-
getDescription
java.lang.String getDescription()
-
getFixesFromSchema
int getFixesFromSchema()
- Returns:
- Returns the smallest schema number that this patch may be applied to
-
getFixesToSchema
int getFixesToSchema()
- Returns:
- Returns the largest schema number that this patch may be applied to
-
getTargetSchema
int getTargetSchema()
- Returns:
- Returns the schema number that this patch attempts to bring the repo up to
-
isForce
boolean isForce()
- Returns:
- Returns true if the patch must forcefully run regardless of any other state
-
getDependsOn
java.util.List<Patch> getDependsOn()
Get patches that this patch depends on- Returns:
- Returns a list of patches
-
getAlternatives
java.util.List<Patch> getAlternatives()
Get patches that could have done the work already- Returns:
- Returns a list of patches
-
applies
boolean applies(int version)
Check if the patch is applicable to a given schema version.- Parameters:
version- a schema version number- Returns:
- Returns
(fixesFromVersion <= version <= fixesToVersion)
-
requiresTransaction
boolean requiresTransaction()
Does the patch need to be wrapped in a transaction?- Returns:
- Returns true if the patch needs to be wrapped, false otherwise
-
apply
java.lang.String apply() throws PatchExceptionApplies the patch. Typically this will be within the bounds of a new transaction.- Returns:
- Returns the patch execution report
- Throws:
PatchException- if the patch failed to be applied
-
applyAsync
java.lang.String applyAsync() throws PatchExceptionApply the patch, regardless of the deferred flag. So if the patch has not run due to it being deferred earlier then this will run it now. Also ignores the "applied" lock. So the patch can be executed many times.- Returns:
- the patch report
- Throws:
PatchException- if the patch failed to be applied
-
isIgnored
boolean isIgnored()
Is this patch just ignored - never considered for application- Returns:
- boolean
-
isDeferred
boolean isDeferred()
Indicates whether the patch must be deferred (not to be executed in bootstrap) or not- Returns:
- true if the patch must be deferred, false otherwise
-
-