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 Patch
A 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:
  • Method Details

    • getId

      String getId()
    • getDescription

      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

      List<Patch> getDependsOn()
      Get patches that this patch depends on
      Returns:
      Returns a list of patches
    • getAlternatives

      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

      String apply() throws PatchException
      Applies 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

      String applyAsync() throws PatchException
      Apply 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