Package org.nuxeo.ecm.quota
Class QuotaStatsServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.quota.QuotaStatsServiceImpl
- All Implemented Interfaces:
QuotaStatsService
,Adaptable
,Component
,Extensible
,TimestampedService
Default implementation of
QuotaStatsService
.- Since:
- 5.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
protected Map
<String, QuotaStatsUpdater> static final String
static final String
static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateQuotaOnUserWorkspaces
(long maxQuota, CoreSession session) Activates the quota on user personal workspacesboolean
canSetMaxQuota
(long maxQuota, DocumentModel doc, CoreSession session) Test to see if quota allowed.void
computeInitialStatistics
(String updaterName, CoreSession session, QuotaStatsInitialWork currentWorker, String path) Compute the initial statistics for the given @{code updaterName} fordocPath
.protected List
<DocumentModel> getParentsInReverseOrder
(DocumentModel doc, CoreSession session) getProgressStatus
(String updaterName, String repositoryName) Returns the progress status ofupdaterName
.long
getQuotaFromParent
(DocumentModel doc, CoreSession session) Gets the quota from the first parent where quota has been set.long
getQuotaSetOnUserWorkspaces
(CoreSession session) getQuotaStatsUpdaters
(String updaterName) getUserWorkspaceRootId
(DocumentModel context, CoreSession session) void
launchInitialStatisticsComputation
(String updaterName, String repositoryName, String path) Launch an asynchronously initial computation for the givenupdaterName
onrepositoryName
fordocPath
.void
launchSetMaxQuotaOnUserWorkspaces
(long maxSize, DocumentModel context, CoreSession session) Sets this maxQuota on all user workspacesvoid
start
(ComponentContext context) Start the component.void
stop
(ComponentContext context) Stop the component.void
updateStatistics
(DocumentEventContext docCtx, Event event) Update the statistics for the givendocCtx
andevent
.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
STATUS_INITIAL_COMPUTATION_QUEUED
- See Also:
-
STATUS_INITIAL_COMPUTATION_PENDING
- See Also:
-
STATUS_INITIAL_COMPUTATION_COMPLETED
- See Also:
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE- See Also:
-
QUOTA_STATS_UPDATERS_EP
- See Also:
-
quotaStatsUpdaters
-
-
Constructor Details
-
QuotaStatsServiceImpl
public QuotaStatsServiceImpl()
-
-
Method Details
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
stop
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
-
getQuotaStatsUpdaters
- Specified by:
getQuotaStatsUpdaters
in interfaceQuotaStatsService
-
getQuotaStatsUpdaters
-
updateStatistics
Description copied from interface:QuotaStatsService
- Specified by:
updateStatistics
in interfaceQuotaStatsService
-
computeInitialStatistics
public void computeInitialStatistics(String updaterName, CoreSession session, QuotaStatsInitialWork currentWorker, String path) Description copied from interface:QuotaStatsService
Compute the initial statistics for the given @{code updaterName} fordocPath
.- Specified by:
computeInitialStatistics
in interfaceQuotaStatsService
-
launchInitialStatisticsComputation
public void launchInitialStatisticsComputation(String updaterName, String repositoryName, String path) Description copied from interface:QuotaStatsService
Launch an asynchronously initial computation for the givenupdaterName
onrepositoryName
fordocPath
.- Specified by:
launchInitialStatisticsComputation
in interfaceQuotaStatsService
-
getProgressStatus
Description copied from interface:QuotaStatsService
Returns the progress status ofupdaterName
.- Specified by:
getProgressStatus
in interfaceQuotaStatsService
-
getQuotaFromParent
Description copied from interface:QuotaStatsService
Gets the quota from the first parent where quota has been set. Returns -1 if no quota has been set. For user workspaces, only the first parent is investigated- Specified by:
getQuotaFromParent
in interfaceQuotaStatsService
-
activateQuotaOnUserWorkspaces
Description copied from interface:QuotaStatsService
Activates the quota on user personal workspaces- Specified by:
activateQuotaOnUserWorkspaces
in interfaceQuotaStatsService
-
getQuotaSetOnUserWorkspaces
- Specified by:
getQuotaSetOnUserWorkspaces
in interfaceQuotaStatsService
-
getParentsInReverseOrder
-
launchSetMaxQuotaOnUserWorkspaces
public void launchSetMaxQuotaOnUserWorkspaces(long maxSize, DocumentModel context, CoreSession session) Description copied from interface:QuotaStatsService
Sets this maxQuota on all user workspaces- Specified by:
launchSetMaxQuotaOnUserWorkspaces
in interfaceQuotaStatsService
-
getUserWorkspaceRootId
-
canSetMaxQuota
Description copied from interface:QuotaStatsService
Test to see if quota allowed. Skip user worskpaces, where validation rules don't apply.- Specified by:
canSetMaxQuota
in interfaceQuotaStatsService
-