Package com.logicaldoc.enterprise
Class QuotaUtil
- java.lang.Object
-
- com.logicaldoc.enterprise.QuotaUtil
-
public class QuotaUtil extends Object
Utility methods for quota handling- Since:
- 7.6.2
- Author:
- Marco Meschieri - LogicalDOC
-
-
Field Summary
Fields Modifier and Type Field Description static long
MB_TO_BYTE
-
Constructor Summary
Constructors Constructor Description QuotaUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
notifyQuotaAlert(com.logicaldoc.core.security.Tenant tenant, com.logicaldoc.core.folder.Folder workspace, Long totalDocs, Long totalSize, Integer totalUsers, Integer totalGuests)
Notifies a list of users about the quota threshold overcoming.static void
registerWorkspaceThresholdOvercame(com.logicaldoc.core.folder.Folder workspace, Long totalSize, Long totalDocs)
Takes care of saving an event that registers the overcome of a quotastatic com.logicaldoc.core.security.Tenant
retrieveTenant(long tenantId)
-
-
-
Method Detail
-
notifyQuotaAlert
public static void notifyQuotaAlert(com.logicaldoc.core.security.Tenant tenant, com.logicaldoc.core.folder.Folder workspace, Long totalDocs, Long totalSize, Integer totalUsers, Integer totalGuests)
Notifies a list of users about the quota threshold overcoming. The notification is both sent as a system message and email(in a different thread).- Parameters:
tenant
- optional if workspace is not nullworkspace
- optional if tenant is not nulltotalDocs
- actual number of documents(optional)totalSize
- actual size in bytes (optional)totalUsers
- actual number of users(optional)totalGuests
- actual number of guests(optional)
-
registerWorkspaceThresholdOvercame
public static void registerWorkspaceThresholdOvercame(com.logicaldoc.core.folder.Folder workspace, Long totalSize, Long totalDocs) throws com.logicaldoc.core.PersistenceException
Takes care of saving an event that registers the overcome of a quota- Parameters:
workspace
- the workspace's foldertotalSize
- the total documents sizetotalDocs
- total number of documents- Throws:
com.logicaldoc.core.PersistenceException
- error in the database
-
retrieveTenant
public static com.logicaldoc.core.security.Tenant retrieveTenant(long tenantId) throws com.logicaldoc.core.PersistenceException
- Throws:
com.logicaldoc.core.PersistenceException
-
-