public class DocumentsCountUpdater extends AbstractQuotaStatsUpdater
QuotaStatsUpdater
counting the non folderish documents.
Store the descendant and children count on Folderish
documents.
Modifier and Type | Field and Description |
---|---|
static int |
BATCH_SIZE |
descriptionLabel, label, name
Constructor and Description |
---|
DocumentsCountUpdater() |
Modifier and Type | Method and 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 this
QuotaStatsUpdater . |
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 |
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,
DocumentModel folder,
org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count count) |
protected void |
saveDocumentsCount(CoreSession session,
Map<String,org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> foldersCount) |
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) |
getAncestors, getDescriptionLabel, getLabel, getName, setDescriptionLabel, setLabel, setName, updateStatistics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
computeInitialStatistics
public static final int BATCH_SIZE
public DocumentsCountUpdater()
protected void processDocumentCreated(CoreSession session, DocumentModel doc)
processDocumentCreated
in class AbstractQuotaStatsUpdater
protected void processDocumentCopied(CoreSession session, DocumentModel doc)
processDocumentCopied
in class AbstractQuotaStatsUpdater
protected void processDocumentCheckedIn(CoreSession session, DocumentModel doc)
processDocumentCheckedIn
in class AbstractQuotaStatsUpdater
protected void processDocumentCheckedOut(CoreSession session, DocumentModel doc)
processDocumentCheckedOut
in class AbstractQuotaStatsUpdater
protected void processDocumentUpdated(CoreSession session, DocumentModel doc)
processDocumentUpdated
in class AbstractQuotaStatsUpdater
protected void processDocumentMoved(CoreSession session, DocumentModel doc, DocumentModel sourceParent)
processDocumentMoved
in class AbstractQuotaStatsUpdater
protected void processDocumentAboutToBeRemoved(CoreSession session, DocumentModel doc)
processDocumentAboutToBeRemoved
in class AbstractQuotaStatsUpdater
protected void handleQuotaExceeded(QuotaExceededException e, Event event)
handleQuotaExceeded
in class AbstractQuotaStatsUpdater
protected boolean needToProcessEventOnDocument(Event event, DocumentModel doc)
needToProcessEventOnDocument
in class AbstractQuotaStatsUpdater
protected void processDocumentBeforeUpdate(CoreSession session, DocumentModel doc)
processDocumentBeforeUpdate
in class AbstractQuotaStatsUpdater
protected void updateCountStatistics(CoreSession session, DocumentModel doc, List<DocumentModel> ancestors, long count)
protected void updateCount(CoreSession session, DocumentModel parent, String xpath, long count)
protected long getCount(DocumentModel doc)
public void computeInitialStatistics(CoreSession session, QuotaStatsInitialWork currentWorker, String path)
QuotaStatsUpdater
QuotaStatsUpdater
.session
- an unrestricted CoreSession
to be usedpath
- the root of the recomputation, or null
for the whole repositoryprotected Map<String,String> getFolders(CoreSession session)
protected Map<String,org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> computeDocumentsCountByFolder(CoreSession session, Map<String,String> folders)
protected void updateParentsDocumentsCount(Map<String,String> folders, Map<String,org.nuxeo.ecm.quota.count.DocumentsCountUpdater.Count> foldersCount, String folderId)
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 processDocumentTrashOp(CoreSession session, DocumentModel doc, boolean isTrashed)
processDocumentTrashOp
in class AbstractQuotaStatsUpdater
protected void processDocumentRestored(CoreSession session, DocumentModel doc)
processDocumentRestored
in class AbstractQuotaStatsUpdater
protected void processDocumentBeforeRestore(CoreSession session, DocumentModel doc)
processDocumentBeforeRestore
in class AbstractQuotaStatsUpdater
Copyright © 2018 Nuxeo. All rights reserved.