org.alfresco.repo.admin.patch
Interface Patch

All Known Implementing Classes:
AbstractPatch, AbstractPermissionChangePatch, ActivitiesTemplatesUpdatePatch, AuthorityDefaultZonesPatch, AuthorityMigrationPatch, AVMFormsPropertyTokenisationPatch, AVMPermissionDataPatch, AVMStorePropertyTokenisationPatch, AVMToADMRemoteStorePatch, AVMWebProjectInheritPermissionsPatch, BaseReindexingPatch, CalendarModelUriPatch, ClearOldImapMessgesPatch, ClearOldImapTemplatesPatch2, ContentUrlConverterPatch, CopiedFromAspectPatch, DeploymentMigrationPatch, DmPermissionsPatch, EmailTemplatesInviteAndNotifyFoldersPatch, FixAclInheritancePatch, FixAuthoritiesCrcValuesPatch, FixNameCrcValuesPatch, FixUserQNamesPatch, GenericBootstrapPatch, GenericMimetypeRenamePatch, GenericWorkflowPatch, ImapFoldersPatch, InvitationMigrationPatch, LinkNodeFileExtensionPatch, MigrateAttrAVMLocksPatch, MigrateAttrChainingURSPatch, MigrateAttrDropOldTablesPatch, MigrateAttrPropBackedBeanPatch, MigrateAttrTenantsPatch, MigrateVersionStorePatch, MoveWCMToGroupBasedPermissionsPatch, MultiTFixAdminExistingTenantsPatch, MultiTShareExistingTenantsPatch, NoLongerSupportedPatch, NoOpPatch, PersonUsagePatch, QNamePatch, ResetWCMToGroupBasedPermissionsPatch, SamplePatch, SchemaUpgradeScriptPatch, SimplePatch, SiteLoadPatch, SitePermissionRefactorPatch, SitesSpacePermissionsPatch, SiteStorePatch, SpacesStoreGuestPermissionPatch, WCMFoldersPatch, WCMPostPermissionSnapshotPatch, WebSiteAddModeratedPatch

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
See Also:
AbstractPatch

Method Summary
 boolean applies(int version)
          Check if the patch is applicable to a given schema version.
 java.lang.String apply()
          Applies the patch.
 java.util.List getAlternatives()
          Get patches that could have done the work already
 java.util.List getDependsOn()
          Get patches that this patch depends on
 java.lang.String getDescription()
           
 int getFixesFromSchema()
           
 int getFixesToSchema()
           
 java.lang.String getId()
           
 int getTargetSchema()
           
 boolean isForce()
           
 boolean requiresTransaction()
          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 getDependsOn()
Get patches that this patch depends on

Returns:
Returns a list of patches

getAlternatives

java.util.List 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 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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.