public class QuotaAwareDocument extends Object implements QuotaAware
| Modifier and Type | Field and 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 org.apache.commons.logging.Log |
log |
QUOTA_TOTALSIZE_CACHE_NAME| Constructor and Description |
|---|
QuotaAwareDocument(DocumentModel doc) |
| Modifier and Type | Method and Description |
|---|---|
protected Number |
addDelta(String property,
long delta) |
void |
addInnerSize(long additionalSize,
boolean save) |
void |
addTotalSize(long additionalSize,
boolean save) |
void |
addTrashSize(long additionalSize,
boolean save) |
void |
addVersionsSize(long additionalSize,
boolean save) |
protected Cache |
getCache(String cacheName) |
protected String |
getCacheEntry(String... params) |
DocumentModel |
getDoc() |
long |
getInnerSize() |
long |
getMaxQuota() |
QuotaInfo |
getQuotaInfo() |
protected Long |
getSizeInCache(String cacheName) |
long |
getTotalSize() |
Long |
getTotalSizeCache()
Returns value of "total size" cache of document OR
null if cache does not exist or key does not exist in cache. |
long |
getTrashSize() |
long |
getVersionsSize() |
protected void |
invalidateCache(String cacheName) |
void |
invalidateTotalSizeCache()
Invalidates "total size" key-value in cache if exists.
|
protected void |
putSizeInCache(String cacheName,
long size) |
void |
putTotalSizeCache(long size)
Stores "total size" value in cache if it exists.
|
void |
resetInfos(boolean save) |
void |
save() |
void |
save(boolean disableNotifications) |
void |
setInnerSize(long size,
boolean save) |
void |
setMaxQuota(long maxSize,
boolean save) |
void |
setMaxQuota(long maxSize,
boolean save,
boolean skipValidation) |
boolean |
totalSizeCacheExists() |
public static final String DOCUMENTS_SIZE_STATISTICS_FACET
public static final String DOCUMENTS_SIZE_INNER_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_TOTAL_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_TRASH_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_VERSIONS_SIZE_PROPERTY
public static final String DOCUMENTS_SIZE_MAX_SIZE_PROPERTY
protected DocumentModel doc
protected static final org.apache.commons.logging.Log log
public QuotaAwareDocument(DocumentModel doc)
public DocumentModel getDoc()
getDoc in interface QuotaAwarepublic long getInnerSize()
getInnerSize in interface QuotaAwarepublic long getTotalSize()
getTotalSize in interface QuotaAwarepublic long getTrashSize()
getTrashSize in interface QuotaAwarepublic long getVersionsSize()
getVersionsSize in interface QuotaAwarepublic void setInnerSize(long size, boolean save)
setInnerSize in interface QuotaAwarepublic void addInnerSize(long additionalSize, boolean save)
addInnerSize in interface QuotaAwarepublic void addTotalSize(long additionalSize, boolean save)
addTotalSize in interface QuotaAwarepublic void addTrashSize(long additionalSize, boolean save)
addTrashSize in interface QuotaAwarepublic void addVersionsSize(long additionalSize, boolean save)
addVersionsSize in interface QuotaAwarepublic void save()
save in interface QuotaAwarepublic void save(boolean disableNotifications)
save in interface QuotaAwarepublic long getMaxQuota()
getMaxQuota in interface QuotaAwarepublic void setMaxQuota(long maxSize, boolean save, boolean skipValidation)
setMaxQuota in interface QuotaAwarepublic void setMaxQuota(long maxSize, boolean save)
setMaxQuota in interface QuotaAwarepublic QuotaInfo getQuotaInfo()
getQuotaInfo in interface QuotaAwarepublic void resetInfos(boolean save)
resetInfos in interface QuotaAwarepublic void invalidateTotalSizeCache() throws IOException
QuotaAwareinvalidateTotalSizeCache in interface QuotaAwareIOException - when unable to invalidate key-valueprotected void invalidateCache(String cacheName) throws IOException
IOExceptionpublic Long getTotalSizeCache() throws IOException
QuotaAwarenull if cache does not exist or key does not exist in cache.getTotalSizeCache in interface QuotaAwareLong object or nullIOExceptionprotected Long getSizeInCache(String cacheName) throws IOException
IOExceptionpublic void putTotalSizeCache(long size) throws IOException
QuotaAwareputTotalSizeCache in interface QuotaAwareIOException - if unable to store valueprotected void putSizeInCache(String cacheName, long size) throws IOException
IOExceptionpublic boolean totalSizeCacheExists()
totalSizeCacheExists in interface QuotaAwaretrue if "total size" cache exists otherwise false.protected String getCacheEntry(String... params)
Copyright © 2015 Nuxeo SA. All rights reserved.