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 QuotaAware
public long getInnerSize()
getInnerSize
in interface QuotaAware
public long getTotalSize()
getTotalSize
in interface QuotaAware
public long getTrashSize()
getTrashSize
in interface QuotaAware
public long getVersionsSize()
getVersionsSize
in interface QuotaAware
public void setInnerSize(long size, boolean save)
setInnerSize
in interface QuotaAware
public void addInnerSize(long additionalSize, boolean save)
addInnerSize
in interface QuotaAware
public void addTotalSize(long additionalSize, boolean save)
addTotalSize
in interface QuotaAware
public void addTrashSize(long additionalSize, boolean save)
addTrashSize
in interface QuotaAware
public void addVersionsSize(long additionalSize, boolean save)
addVersionsSize
in interface QuotaAware
public void save()
save
in interface QuotaAware
public void save(boolean disableNotifications)
save
in interface QuotaAware
public long getMaxQuota()
getMaxQuota
in interface QuotaAware
public void setMaxQuota(long maxSize, boolean save, boolean skipValidation)
setMaxQuota
in interface QuotaAware
public void setMaxQuota(long maxSize, boolean save)
setMaxQuota
in interface QuotaAware
public QuotaInfo getQuotaInfo()
getQuotaInfo
in interface QuotaAware
public void resetInfos(boolean save)
resetInfos
in interface QuotaAware
public void invalidateTotalSizeCache() throws IOException
QuotaAware
invalidateTotalSizeCache
in interface QuotaAware
IOException
- when unable to invalidate key-valueprotected void invalidateCache(String cacheName) throws IOException
IOException
public Long getTotalSizeCache() throws IOException
QuotaAware
null
if cache does not exist or key does not exist in cache.getTotalSizeCache
in interface QuotaAware
Long
object or null
IOException
protected Long getSizeInCache(String cacheName) throws IOException
IOException
public void putTotalSizeCache(long size) throws IOException
QuotaAware
putTotalSizeCache
in interface QuotaAware
IOException
- if unable to store valueprotected void putSizeInCache(String cacheName, long size) throws IOException
IOException
public boolean totalSizeCacheExists()
totalSizeCacheExists
in interface QuotaAware
true
if "total size" cache exists otherwise false
.protected String getCacheEntry(String... params)
Copyright © 2015 Nuxeo SA. All rights reserved.