Package org.nuxeo.ecm.quota.size
Class QuotaAwareDocument
- java.lang.Object
-
- org.nuxeo.ecm.quota.size.QuotaAwareDocument
-
- All Implemented Interfaces:
QuotaAware
public class QuotaAwareDocument extends Object implements QuotaAware
Adapter to manage a DocumentModel that supports Quotas- Since:
- 5.6
- Author:
- Tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentModeldocstatic StringDOCUMENTS_SIZE_INNER_SIZE_PROPERTYstatic StringDOCUMENTS_SIZE_MAX_SIZE_PROPERTYstatic StringDOCUMENTS_SIZE_STATISTICS_FACETstatic StringDOCUMENTS_SIZE_TOTAL_SIZE_PROPERTYstatic StringDOCUMENTS_SIZE_TRASH_SIZE_PROPERTYstatic StringDOCUMENTS_SIZE_VERSIONS_SIZE_PROPERTYprotected static Loglog
-
Constructor Summary
Constructors Constructor Description QuotaAwareDocument(DocumentModel doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NumberaddDelta(String property, long delta)voidaddInnerSize(long delta)voidaddTotalSize(long delta)voidaddTrashSize(long delta)voidaddVersionsSize(long delta)voidclearInfos()Resets quota info but keeps the user-specified max quota size, if present.protected voidclearMaxSize()DocumentModelgetDoc()longgetInnerSize()longgetMaxQuota()QuotaInfogetQuotaInfo()longgetTotalSize()longgetTrashSize()longgetVersionsSize()voidresetInfos()voidsave()voidsetAll(long innerSize, long totalSize, long trashSize, long versionsSize)Set all quota info.voidsetMaxQuota(long maxSize)voidsetMaxQuota(long maxSize, boolean skipValidation)
-
-
-
Field Detail
-
DOCUMENTS_SIZE_STATISTICS_FACET
public static final String DOCUMENTS_SIZE_STATISTICS_FACET
- See Also:
- Constant Field Values
-
DOCUMENTS_SIZE_INNER_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_INNER_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
DOCUMENTS_SIZE_TOTAL_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_TOTAL_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
DOCUMENTS_SIZE_TRASH_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_TRASH_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
DOCUMENTS_SIZE_VERSIONS_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_VERSIONS_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
DOCUMENTS_SIZE_MAX_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_MAX_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
doc
protected DocumentModel doc
-
log
protected static final Log log
-
-
Constructor Detail
-
QuotaAwareDocument
public QuotaAwareDocument(DocumentModel doc)
-
-
Method Detail
-
getDoc
public DocumentModel getDoc()
- Specified by:
getDocin interfaceQuotaAware
-
getInnerSize
public long getInnerSize()
- Specified by:
getInnerSizein interfaceQuotaAware
-
getTotalSize
public long getTotalSize()
- Specified by:
getTotalSizein interfaceQuotaAware
-
getTrashSize
public long getTrashSize()
- Specified by:
getTrashSizein interfaceQuotaAware
-
getVersionsSize
public long getVersionsSize()
- Specified by:
getVersionsSizein interfaceQuotaAware
-
addInnerSize
public void addInnerSize(long delta)
- Specified by:
addInnerSizein interfaceQuotaAware
-
addTotalSize
public void addTotalSize(long delta)
- Specified by:
addTotalSizein interfaceQuotaAware
-
addTrashSize
public void addTrashSize(long delta)
- Specified by:
addTrashSizein interfaceQuotaAware
-
addVersionsSize
public void addVersionsSize(long delta)
- Specified by:
addVersionsSizein interfaceQuotaAware
-
setAll
public void setAll(long innerSize, long totalSize, long trashSize, long versionsSize)Description copied from interface:QuotaAwareSet all quota info.- Specified by:
setAllin interfaceQuotaAware
-
save
public void save()
- Specified by:
savein interfaceQuotaAware
-
getMaxQuota
public long getMaxQuota()
- Specified by:
getMaxQuotain interfaceQuotaAware
-
setMaxQuota
public void setMaxQuota(long maxSize)
- Specified by:
setMaxQuotain interfaceQuotaAware
-
setMaxQuota
public void setMaxQuota(long maxSize, boolean skipValidation)- Specified by:
setMaxQuotain interfaceQuotaAware
-
getQuotaInfo
public QuotaInfo getQuotaInfo()
- Specified by:
getQuotaInfoin interfaceQuotaAware
-
resetInfos
public void resetInfos()
- Specified by:
resetInfosin interfaceQuotaAware- Since:
- 5.7
-
clearInfos
public void clearInfos()
Description copied from interface:QuotaAwareResets quota info but keeps the user-specified max quota size, if present.- Specified by:
clearInfosin interfaceQuotaAware
-
clearMaxSize
protected void clearMaxSize()
-
-