public class DocumentsSizeUpdater extends AbstractQuotaStatsUpdater
QuotaStatsUpdater
counting space used by Blobs in document. This implementation does not
track the space used by non-Blob properties.Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_QUOTA_CHECK_LISTENER |
static String |
USER_WORKSPACES_ROOT |
descriptionLabel, label, name
Constructor and Description |
---|
DocumentsSizeUpdater() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkQuota(CoreSession session,
DocumentModel doc,
long delta)
Checks the size delta against the maximum quota specified for this document or an ancestor.
|
void |
computeInitialStatistics(CoreSession session,
QuotaStatsInitialWork currentWorker)
Compute the initial statistics on the whole repository for this
QuotaStatsUpdater . |
protected List<Blob> |
getAllBlobs(DocumentModel doc)
Returns the list of blobs for this document.
|
protected long |
getBlobsSize(DocumentModel doc)
Gets the sum of all blobs sizes for this document.
|
protected long |
getVersionsSize(CoreSession session,
DocumentModel doc)
Gets the sum of all blobs sizes for all the document's versions.
|
protected void |
handleQuotaExceeded(QuotaExceededException e,
Event event) |
protected void |
initDocument(CoreSession session,
DocumentModel doc) |
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,
String transition) |
protected void |
processDocumentUpdated(CoreSession session,
DocumentModel doc) |
protected void |
updateAncestors(CoreSession session,
DocumentModel doc,
long deltaTotal,
long deltaTrash,
long deltaVersions) |
protected void |
updateDocument(DocumentModel doc,
long deltaInner,
long deltaTotal,
long deltaTrash,
long deltaVersions) |
protected void |
updateDocument(DocumentModel doc,
long deltaInner,
long deltaTotal,
long deltaTrash,
long deltaVersions,
boolean allowSave) |
protected void |
updateDocumentAndAncestors(CoreSession session,
DocumentModel doc,
long deltaInner,
long deltaTotal,
long deltaTrash,
long deltaVersions) |
getAncestors, getDescriptionLabel, getLabel, getName, setDescriptionLabel, setLabel, setName, updateStatistics
public static final String DISABLE_QUOTA_CHECK_LISTENER
public static final String USER_WORKSPACES_ROOT
public DocumentsSizeUpdater()
public void computeInitialStatistics(CoreSession session, QuotaStatsInitialWork currentWorker)
QuotaStatsUpdater
QuotaStatsUpdater
.session
- an unrestricted CoreSession
to be usedprotected void initDocument(CoreSession session, DocumentModel doc)
protected void handleQuotaExceeded(QuotaExceededException e, Event event)
handleQuotaExceeded
in class AbstractQuotaStatsUpdater
protected void processDocumentCreated(CoreSession session, DocumentModel doc)
processDocumentCreated
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 processDocumentBeforeUpdate(CoreSession session, DocumentModel doc)
processDocumentBeforeUpdate
in class AbstractQuotaStatsUpdater
protected void processDocumentCopied(CoreSession session, DocumentModel doc)
processDocumentCopied
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 processDocumentTrashOp(CoreSession session, DocumentModel doc, String transition)
processDocumentTrashOp
in class AbstractQuotaStatsUpdater
protected void processDocumentBeforeRestore(CoreSession session, DocumentModel doc)
processDocumentBeforeRestore
in class AbstractQuotaStatsUpdater
protected void processDocumentRestored(CoreSession session, DocumentModel doc)
processDocumentRestored
in class AbstractQuotaStatsUpdater
protected boolean needToProcessEventOnDocument(Event event, DocumentModel doc)
needToProcessEventOnDocument
in class AbstractQuotaStatsUpdater
protected void checkQuota(CoreSession session, DocumentModel doc, long delta)
protected long getVersionsSize(CoreSession session, DocumentModel doc)
protected long getBlobsSize(DocumentModel doc)
protected List<Blob> getAllBlobs(DocumentModel doc)
protected void updateDocument(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions)
protected void updateDocument(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions, boolean allowSave)
protected void updateAncestors(CoreSession session, DocumentModel doc, long deltaTotal, long deltaTrash, long deltaVersions)
protected void updateDocumentAndAncestors(CoreSession session, DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions)
Copyright © 2018 Nuxeo. All rights reserved.