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
public class DocumentsCountUpdater extends AbstractQuotaStatsUpdater
QuotaStatsUpdater
counting the non folderish documents.Store the descendant and children count on
Folderish
documents.- Since:
- 5.5
-
-
Field Summary
Fields Modifier and Type Field Description static int
BATCH_SIZE
-
Fields inherited from class org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
descriptionLabel, label, name
-
-
Constructor Summary
Constructors Constructor Description DocumentsCountUpdater()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count>
computeDocumentsCountByFolder(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)
protected Map<String,String>
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 Detail
-
BATCH_SIZE
public static final int BATCH_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
processDocumentCreated
protected void processDocumentCreated(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentCreated
in classAbstractQuotaStatsUpdater
-
processDocumentCopied
protected void processDocumentCopied(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentCopied
in classAbstractQuotaStatsUpdater
-
processDocumentCheckedIn
protected void processDocumentCheckedIn(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentCheckedIn
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedIn
protected void processDocumentBeforeCheckedIn(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentBeforeCheckedIn
in classAbstractQuotaStatsUpdater
-
processDocumentCheckedOut
protected void processDocumentCheckedOut(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentCheckedOut
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedOut
protected void processDocumentBeforeCheckedOut(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentBeforeCheckedOut
in classAbstractQuotaStatsUpdater
-
processDocumentUpdated
protected void processDocumentUpdated(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentUpdated
in classAbstractQuotaStatsUpdater
-
processDocumentMoved
protected void processDocumentMoved(CoreSession session, DocumentModel doc, DocumentModel sourceParent)
- Specified by:
processDocumentMoved
in classAbstractQuotaStatsUpdater
-
processDocumentAboutToBeRemoved
protected void processDocumentAboutToBeRemoved(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentAboutToBeRemoved
in classAbstractQuotaStatsUpdater
-
handleQuotaExceeded
protected void handleQuotaExceeded(QuotaExceededException e, Event event)
- Specified by:
handleQuotaExceeded
in classAbstractQuotaStatsUpdater
-
needToProcessEventOnDocument
protected boolean needToProcessEventOnDocument(Event event, DocumentModel doc)
- Specified by:
needToProcessEventOnDocument
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeUpdate
protected void processDocumentBeforeUpdate(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentBeforeUpdate
in classAbstractQuotaStatsUpdater
-
updateCountStatistics
protected void updateCountStatistics(CoreSession session, DocumentModel doc, List<DocumentModel> ancestors, long count)
-
updateCount
protected void updateCount(CoreSession session, DocumentModel parent, String xpath, long count)
-
getCount
protected long getCount(DocumentModel doc)
-
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
protected Map<String,String> getFolders(CoreSession session)
-
computeDocumentsCountByFolder
protected Map<String,org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> computeDocumentsCountByFolder(CoreSession session, Map<String,String> folders)
-
updateParentsDocumentsCount
protected void updateParentsDocumentsCount(Map<String,String> folders, Map<String,org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> foldersCount, String folderId)
-
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
protected void processDocumentTrashOp(CoreSession session, DocumentModel doc, boolean isTrashed)
- Specified by:
processDocumentTrashOp
in classAbstractQuotaStatsUpdater
-
processDocumentRestored
protected void processDocumentRestored(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentRestored
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeRestore
protected void processDocumentBeforeRestore(CoreSession session, DocumentModel doc)
- Specified by:
processDocumentBeforeRestore
in classAbstractQuotaStatsUpdater
-
-