Package org.nuxeo.ecm.quota.count
Class DocumentsCountUpdater
java.lang.Object
org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
org.nuxeo.ecm.quota.count.DocumentsCountUpdater
- All Implemented Interfaces:
QuotaStatsUpdater
QuotaStatsUpdater
counting the non folderish documents.
Store the descendant and children count on Folderish
documents.
- Since:
- 5.5
-
Field Summary
Fields inherited from class org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
descriptionLabel, label, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeDocumentsCountByFolder
(CoreSession session, Map<String, String> folders) void
computeInitialStatistics
(CoreSession session, QuotaStatsInitialWork currentWorker, String path) Compute the initial statistics under the given path for thisQuotaStatsUpdater
.protected long
getCount
(DocumentModel doc) getFolders
(CoreSession session) protected void
handleQuotaExceeded
(QuotaExceededException e, Event event) protected boolean
needToProcessEventOnDocument
(Event event, DocumentModel doc) protected void
processDocumentAboutToBeRemoved
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeCheckedIn
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeCheckedOut
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeRestore
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeUpdate
(CoreSession session, DocumentModel doc) protected void
processDocumentCheckedIn
(CoreSession session, DocumentModel doc) protected void
processDocumentCheckedOut
(CoreSession session, DocumentModel doc) protected void
processDocumentCopied
(CoreSession session, DocumentModel doc) protected void
processDocumentCreated
(CoreSession session, DocumentModel doc) protected void
processDocumentMoved
(CoreSession session, DocumentModel doc, DocumentModel sourceParent) protected void
processDocumentRestored
(CoreSession session, DocumentModel doc) protected void
processDocumentTrashOp
(CoreSession session, DocumentModel doc, boolean isTrashed) protected void
processDocumentUpdated
(CoreSession session, DocumentModel doc) protected void
saveDocumentsCount
(CoreSession session, Map<String, org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> foldersCount) protected void
saveDocumentsCount
(CoreSession session, DocumentModel folder, org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count count) protected void
updateCount
(CoreSession session, DocumentModel parent, String xpath, long count) protected void
updateCountStatistics
(CoreSession session, DocumentModel doc, List<DocumentModel> ancestors, long count) protected void
updateParentsDocumentsCount
(Map<String, String> folders, Map<String, org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> foldersCount, String folderId) Methods inherited from class org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
getAncestors, getDescriptionLabel, getLabel, getName, setDescriptionLabel, setLabel, setName, updateStatistics
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.quota.QuotaStatsUpdater
computeInitialStatistics
-
Field Details
-
BATCH_SIZE
public static final int BATCH_SIZE- See Also:
-
-
Constructor Details
-
DocumentsCountUpdater
public DocumentsCountUpdater()
-
-
Method Details
-
processDocumentCreated
- Specified by:
processDocumentCreated
in classAbstractQuotaStatsUpdater
-
processDocumentCopied
- Specified by:
processDocumentCopied
in classAbstractQuotaStatsUpdater
-
processDocumentCheckedIn
- Specified by:
processDocumentCheckedIn
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedIn
- Specified by:
processDocumentBeforeCheckedIn
in classAbstractQuotaStatsUpdater
-
processDocumentCheckedOut
- Specified by:
processDocumentCheckedOut
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedOut
- Specified by:
processDocumentBeforeCheckedOut
in classAbstractQuotaStatsUpdater
-
processDocumentUpdated
- Specified by:
processDocumentUpdated
in classAbstractQuotaStatsUpdater
-
processDocumentMoved
protected void processDocumentMoved(CoreSession session, DocumentModel doc, DocumentModel sourceParent) - Specified by:
processDocumentMoved
in classAbstractQuotaStatsUpdater
-
processDocumentAboutToBeRemoved
- Specified by:
processDocumentAboutToBeRemoved
in classAbstractQuotaStatsUpdater
-
handleQuotaExceeded
- Specified by:
handleQuotaExceeded
in classAbstractQuotaStatsUpdater
-
needToProcessEventOnDocument
- Specified by:
needToProcessEventOnDocument
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeUpdate
- Specified by:
processDocumentBeforeUpdate
in classAbstractQuotaStatsUpdater
-
updateCountStatistics
protected void updateCountStatistics(CoreSession session, DocumentModel doc, List<DocumentModel> ancestors, long count) -
updateCount
-
getCount
-
computeInitialStatistics
public void computeInitialStatistics(CoreSession session, QuotaStatsInitialWork currentWorker, String path) Description copied from interface:QuotaStatsUpdater
Compute the initial statistics under the given path for thisQuotaStatsUpdater
.- Parameters:
session
- an unrestrictedCoreSession
to be usedpath
- the root of the recomputation, ornull
for the whole repository
-
getFolders
-
computeDocumentsCountByFolder
-
updateParentsDocumentsCount
-
saveDocumentsCount
protected void saveDocumentsCount(CoreSession session, Map<String, org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> foldersCount) -
saveDocumentsCount
protected void saveDocumentsCount(CoreSession session, DocumentModel folder, org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count count) -
processDocumentTrashOp
- Specified by:
processDocumentTrashOp
in classAbstractQuotaStatsUpdater
-
processDocumentRestored
- Specified by:
processDocumentRestored
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeRestore
- Specified by:
processDocumentBeforeRestore
in classAbstractQuotaStatsUpdater
-