Package com.logicaldoc.enterprise
Class DocumentCounter
- java.lang.Object
-
- com.logicaldoc.enterprise.DocumentCounter
-
- All Implemented Interfaces:
com.logicaldoc.core.document.DocumentListener
public class DocumentCounter extends Object implements com.logicaldoc.core.document.DocumentListener
Listener that takes care about increasing/decreasing the documents counters- Since:
- 6.9
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description DocumentCounter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCheckin(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary)
void
afterSaveHistory(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory event, Map<String,Object> dictionary)
void
afterStore(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary)
void
beforeCheckin(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary)
void
beforeStore(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary)
static void
updateStatistics(long tenantId, Long workspaceId, Long userId, boolean forceUpdate)
Updates the quota statistics.static void
validateDocumentsQuota(long tenantId, long userId, long workspaceId)
Validates the respect of all the quotas(both docs number and storage size) for tenant/workspace/userstatic void
validateMaxDocuments(long tenantId, long workspaceId)
Validate the max number of documents admissible for the given tenant/workspace/tenant.static void
validateMaxSize(long tenantId, long workspaceId, long userId)
Validate the max size admissible for the given tenant/workspace/user.
-
-
-
Field Detail
-
WSDOCS
public static final String WSDOCS
- See Also:
- Constant Field Values
-
WSSIZE
public static final String WSSIZE
- See Also:
- Constant Field Values
-
REPODOCS
public static final String REPODOCS
- See Also:
- Constant Field Values
-
REPOSIZE
public static final String REPOSIZE
- See Also:
- Constant Field Values
-
USERQUOTA
public static final String USERQUOTA
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateMaxDocuments
public static void validateMaxDocuments(long tenantId, long workspaceId) throws com.logicaldoc.core.PersistenceException
Validate the max number of documents admissible for the given tenant/workspace/tenant. The whole system must be valid also.- Parameters:
tenantId
- identifier of the tenantworkspaceId
- identifier of the workspace- Throws:
com.logicaldoc.core.PersistenceException
- count over the maximum admitted by the license/quota
-
validateMaxSize
public static void validateMaxSize(long tenantId, long workspaceId, long userId) throws com.logicaldoc.core.PersistenceException
Validate the max size admissible for the given tenant/workspace/user. The whole system must be valid also- Parameters:
tenantId
- identifier of the tenantworkspaceId
- identifier of the workspaceuserId
- identifier of the suer- Throws:
com.logicaldoc.core.PersistenceException
- count over the maximum admitted by the license/quota
-
validateDocumentsQuota
public static void validateDocumentsQuota(long tenantId, long userId, long workspaceId) throws com.logicaldoc.core.PersistenceException
Validates the respect of all the quotas(both docs number and storage size) for tenant/workspace/user- Parameters:
tenantId
- identifier of the tenantworkspaceId
- identifier of the workspaceuserId
- identifier of the suer- Throws:
com.logicaldoc.core.PersistenceException
- count over the maximum admitted by the license/quota
-
afterCheckin
public void afterCheckin(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary) throws com.logicaldoc.core.PersistenceException
- Specified by:
afterCheckin
in interfacecom.logicaldoc.core.document.DocumentListener
- Throws:
com.logicaldoc.core.PersistenceException
-
afterStore
public void afterStore(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary) throws com.logicaldoc.core.PersistenceException
- Specified by:
afterStore
in interfacecom.logicaldoc.core.document.DocumentListener
- Throws:
com.logicaldoc.core.PersistenceException
-
beforeCheckin
public void beforeCheckin(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary) throws com.logicaldoc.core.PersistenceException
- Specified by:
beforeCheckin
in interfacecom.logicaldoc.core.document.DocumentListener
- Throws:
com.logicaldoc.core.PersistenceException
-
beforeStore
public void beforeStore(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory transaction, Map<String,Object> dictionary) throws com.logicaldoc.core.PersistenceException
- Specified by:
beforeStore
in interfacecom.logicaldoc.core.document.DocumentListener
- Throws:
com.logicaldoc.core.PersistenceException
-
updateStatistics
public static void updateStatistics(long tenantId, Long workspaceId, Long userId, boolean forceUpdate)
Updates the quota statistics. The computation is done only if the last computation occurred after count.ttl hours after the actual date- Parameters:
tenantId
- identifier of the tenantworkspaceId
- identifier of the workspaceuserId
- identifier of the userforceUpdate
- if true the statistics are computed anyways
-
afterSaveHistory
public void afterSaveHistory(com.logicaldoc.core.document.Document document, com.logicaldoc.core.document.DocumentHistory event, Map<String,Object> dictionary) throws com.logicaldoc.core.PersistenceException
- Specified by:
afterSaveHistory
in interfacecom.logicaldoc.core.document.DocumentListener
- Throws:
com.logicaldoc.core.PersistenceException
-
-