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 DocumentModel
doc
static String
DOCUMENTS_SIZE_INNER_SIZE_PROPERTY
static String
DOCUMENTS_SIZE_MAX_SIZE_PROPERTY
static String
DOCUMENTS_SIZE_STATISTICS_FACET
static String
DOCUMENTS_SIZE_TOTAL_SIZE_PROPERTY
static String
DOCUMENTS_SIZE_TRASH_SIZE_PROPERTY
static String
DOCUMENTS_SIZE_VERSIONS_SIZE_PROPERTY
protected static Log
log
-
Constructor Summary
Constructors Constructor Description QuotaAwareDocument(DocumentModel doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Number
addDelta(String property, long delta)
void
addInnerSize(long delta)
void
addTotalSize(long delta)
void
addTrashSize(long delta)
void
addVersionsSize(long delta)
void
clearInfos()
Resets quota info but keeps the user-specified max quota size, if present.protected void
clearMaxSize()
DocumentModel
getDoc()
long
getInnerSize()
long
getMaxQuota()
QuotaInfo
getQuotaInfo()
long
getTotalSize()
long
getTrashSize()
long
getVersionsSize()
void
resetInfos()
void
save()
void
setAll(long innerSize, long totalSize, long trashSize, long versionsSize)
Set all quota info.void
setMaxQuota(long maxSize)
void
setMaxQuota(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:
getDoc
in interfaceQuotaAware
-
getInnerSize
public long getInnerSize()
- Specified by:
getInnerSize
in interfaceQuotaAware
-
getTotalSize
public long getTotalSize()
- Specified by:
getTotalSize
in interfaceQuotaAware
-
getTrashSize
public long getTrashSize()
- Specified by:
getTrashSize
in interfaceQuotaAware
-
getVersionsSize
public long getVersionsSize()
- Specified by:
getVersionsSize
in interfaceQuotaAware
-
addInnerSize
public void addInnerSize(long delta)
- Specified by:
addInnerSize
in interfaceQuotaAware
-
addTotalSize
public void addTotalSize(long delta)
- Specified by:
addTotalSize
in interfaceQuotaAware
-
addTrashSize
public void addTrashSize(long delta)
- Specified by:
addTrashSize
in interfaceQuotaAware
-
addVersionsSize
public void addVersionsSize(long delta)
- Specified by:
addVersionsSize
in interfaceQuotaAware
-
setAll
public void setAll(long innerSize, long totalSize, long trashSize, long versionsSize)
Description copied from interface:QuotaAware
Set all quota info.- Specified by:
setAll
in interfaceQuotaAware
-
save
public void save()
- Specified by:
save
in interfaceQuotaAware
-
getMaxQuota
public long getMaxQuota()
- Specified by:
getMaxQuota
in interfaceQuotaAware
-
setMaxQuota
public void setMaxQuota(long maxSize)
- Specified by:
setMaxQuota
in interfaceQuotaAware
-
setMaxQuota
public void setMaxQuota(long maxSize, boolean skipValidation)
- Specified by:
setMaxQuota
in interfaceQuotaAware
-
getQuotaInfo
public QuotaInfo getQuotaInfo()
- Specified by:
getQuotaInfo
in interfaceQuotaAware
-
resetInfos
public void resetInfos()
- Specified by:
resetInfos
in interfaceQuotaAware
- Since:
- 5.7
-
clearInfos
public void clearInfos()
Description copied from interface:QuotaAware
Resets quota info but keeps the user-specified max quota size, if present.- Specified by:
clearInfos
in interfaceQuotaAware
-
clearMaxSize
protected void clearMaxSize()
-
-