|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.admin.patch.AbstractPatch
public abstract class AbstractPatch
Base implementation of the patch. This class ensures that the patch is thread- and transaction-safe.
| Field Summary | |
|---|---|
protected AuthenticationComponent |
authenticationComponent
support service |
static java.lang.String |
ERR_PROPERTY_NOT_SET
I18N message when properties not set. |
protected NamespaceService |
namespaceService
support service |
protected NodeService |
nodeService
support service |
protected SearchService |
searchService
support service |
protected TenantDeployerService |
tenantDeployerService
support service |
protected TransactionService |
transactionService
used to ensure a unique transaction per execution |
| Constructor Summary | |
|---|---|
AbstractPatch()
|
|
| Method Summary | |
|---|---|
boolean |
applies(int version)
Check if the patch is applicable to a given schema version. |
java.lang.String |
apply()
Sets up the transaction and ensures thread-safety. |
protected abstract java.lang.String |
applyInternal()
This method does the work. |
protected void |
checkProperties()
Check that the schema version properties have been set appropriately. |
protected void |
checkPropertyNotNull(java.lang.Object value,
java.lang.String name)
Performs a null check on the supplied value. |
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()
|
void |
init()
This ensures that this bean gets registered with the appropriate service. |
protected void |
reportProgress(long estimatedTotal,
long currentInteration)
Support to report patch completion and estimated completion time. |
void |
setApplyToTenants(boolean applyToTenants)
|
void |
setAuthenticationComponent(AuthenticationComponent authenticationComponent)
Set a generally-used service |
void |
setDependsOn(java.util.List dependsOn)
Set all the dependencies for this patch. |
void |
setDescription(java.lang.String description)
|
void |
setFixesFromSchema(int version)
Set the smallest schema number that this patch may be applied to. |
void |
setFixesToSchema(int version)
Set the largest schema version number that this patch may be applied to. |
void |
setId(java.lang.String id)
|
void |
setNamespaceService(NamespaceService namespaceService)
Set a generally-used service |
void |
setNodeService(NodeService nodeService)
Set a generally-used service |
void |
setPatchService(PatchService patchService)
Set the service that this patch will register with for execution. |
void |
setSearchService(SearchService searchService)
Set a generally-used service |
void |
setTargetSchema(int version)
Set the schema version that this patch attempts to take the existing schema to. |
void |
setTenantDeployerService(TenantDeployerService tenantDeployerService)
|
void |
setTransactionService(TransactionService transactionService)
Set the transaction provider so that each execution can be performed within a transaction |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ERR_PROPERTY_NOT_SET
protected TransactionService transactionService
protected NamespaceService namespaceService
protected NodeService nodeService
protected SearchService searchService
protected AuthenticationComponent authenticationComponent
protected TenantDeployerService tenantDeployerService
| Constructor Detail |
|---|
public AbstractPatch()
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void setPatchService(PatchService patchService)
public void setTransactionService(TransactionService transactionService)
public void setNamespaceService(NamespaceService namespaceService)
public void setNodeService(NodeService nodeService)
public void setSearchService(SearchService searchService)
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
public void setTenantDeployerService(TenantDeployerService tenantDeployerService)
public void init()
service.
public java.lang.String getId()
getId in interface Patchpublic void setId(java.lang.String id)
id - the unique ID of the patch. This dictates the order in which patches are applied.public int getFixesFromSchema()
getFixesFromSchema in interface Patchpublic void setFixesFromSchema(int version)
version - a schema number not smaller than 0public int getFixesToSchema()
getFixesToSchema in interface Patchpublic void setFixesToSchema(int version)
version - a schema version number not smaller than the from version number.public int getTargetSchema()
getTargetSchema in interface Patchpublic void setTargetSchema(int version)
version - a schema version number that must be greater than the max fix schema numberpublic java.lang.String getDescription()
getDescription in interface Patchpublic void setDescription(java.lang.String description)
description - a thorough description of the patchpublic java.util.List getDependsOn()
Patch
getDependsOn in interface Patchpublic void setDependsOn(java.util.List dependsOn)
dependsOn - a list of dependenciespublic boolean applies(int version)
Patch
applies in interface Patchversion - a schema version number
(fixesFromVersion <= version <= fixesToVersion)
protected final void checkPropertyNotNull(java.lang.Object value,
java.lang.String name)
value - value to checkname - name of the property to reportpublic void setApplyToTenants(boolean applyToTenants)
protected void checkProperties()
public java.lang.String apply()
throws PatchException
apply in interface PatchPatchException - if the patch failed to be appliedAbstractPatch.applyInternal()
protected abstract java.lang.String applyInternal()
throws java.lang.Exception
java.lang.Exception - anything can be thrown. This must be used for all failures.AbstractPatch.apply()
protected void reportProgress(long estimatedTotal,
long currentInteration)
estimatedTotal - currentInteration -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||