|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.transaction.TransactionListenerAdapter
org.alfresco.repo.content.cleanup.EagerContentStoreCleaner
public class EagerContentStoreCleaner
This component is responsible cleaning up orphaned content.
Clean-up happens at two levels. Eager cleanup: (since 3.2) Ifeager cleanup
is activated, then this
component listens to all content property change events and recorded for post-transaction
processing. All orphaned content is deleted from the registered store(s). Note that
any listeners
are called as normal; backup or scrubbing
procedures should be plugged in as listeners if this is required.
Lazy cleanup:
This is triggered by means of a Quartz job
. This is
a heavy-weight process that effectively compares the database metadata with the
content URLs controlled by the various stores. Once again, the listeners are called
appropriately.
How backup policies are affected:
When restoring the system from a backup, the type of restore required is dictated by
the cleanup policy being enforced. If eager cleanup is active, the system mustDeletedContentBackupCleanerListener
, or
Constructor Summary | |
---|---|
EagerContentStoreCleaner()
|
Method Summary | |
---|---|
void |
afterCommit()
Cleans up all newly-orphaned content |
void |
afterRollback()
Invoked after transaction rollback. |
boolean |
deleteFromStores(java.lang.String contentUrl)
Delete the content URL from all stores |
void |
init()
Initializes the cleaner based on the eagerCleanup flag. |
void |
registerNewContentUrl(java.lang.String contentUrl)
Queues orphaned content for post-transaction removal |
boolean |
registerOrphanedContentUrl(java.lang.String contentUrl)
Queues orphaned content for post-transaction removal NB: Any content registered will be deleted if the current transaction commits and if 'eager' cleanup is turned on. |
boolean |
registerOrphanedContentUrl(java.lang.String contentUrl,
boolean force)
Queues orphaned content for post-transaction removal NB: Any content registered will be deleted if the current transaction commits and if 'eager' cleanup is turned on. |
void |
setEagerOrphanCleanup(boolean eagerOrphanCleanup)
|
void |
setListeners(java.util.List listeners)
|
void |
setStores(java.util.List stores)
|
Methods inherited from class org.alfresco.repo.transaction.TransactionListenerAdapter |
---|
beforeCommit, beforeCompletion, flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EagerContentStoreCleaner()
Method Detail |
---|
public void setEagerOrphanCleanup(boolean eagerOrphanCleanup)
eagerOrphanCleanup
- true to enable this component, otherwise falsepublic void setStores(java.util.List stores)
stores
- the content stores to cleanpublic void setListeners(java.util.List listeners)
listeners
- the listeners that can react to deletionspublic void init()
eagerCleanup
flag.
public void registerNewContentUrl(java.lang.String contentUrl)
public boolean registerOrphanedContentUrl(java.lang.String contentUrl)
public boolean registerOrphanedContentUrl(java.lang.String contentUrl, boolean force)
force
- true for force the post-commit URL deletion
regardless of the setting EagerContentStoreCleaner.setEagerOrphanCleanup(boolean)
.
public void afterCommit()
afterCommit
in interface TransactionListener
afterCommit
in class TransactionListenerAdapter
public void afterRollback()
TransactionListenerAdapter
Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.
afterRollback
in interface TransactionListener
afterRollback
in class TransactionListenerAdapter
public boolean deleteFromStores(java.lang.String contentUrl)
contentUrl
- the URL to delete
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |