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 intstatic final Stringprotected QuotaStatsUpdaterRegistrystatic final Stringstatic final Stringstatic final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(ComponentContext context) Activates the component.voidactivateQuotaOnUserWorkspaces(long maxQuota, CoreSession session) Activates the quota on user personal workspacesbooleancanSetMaxQuota(long maxQuota, DocumentModel doc, CoreSession session) Test to see if quota allowed.voidcomputeInitialStatistics(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.longgetQuotaFromParent(DocumentModel doc, CoreSession session) Gets the quota from the first parent where quota has been set.longgetQuotaSetOnUserWorkspaces(CoreSession session) getQuotaStatsUpdaters(String updaterName) getUserWorkspaceRootId(DocumentModel context, CoreSession session) voidlaunchInitialStatisticsComputation(String updaterName, String repositoryName, String path) Launch an asynchronously initial computation for the givenupdaterNameonrepositoryNamefordocPath.voidlaunchSetMaxQuotaOnUserWorkspaces(long maxSize, DocumentModel context, CoreSession session) Sets this maxQuota on all user workspacesvoidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) voidupdateStatistics(DocumentEventContext docCtx, Event event) Update the statistics for the givendocCtxandevent.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrderMethods inherited from interface org.nuxeo.ecm.quota.QuotaStatsService
computeInitialStatistics, launchInitialStatisticsComputation
-
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:
-
quotaStatsUpdaterRegistry
-
-
Constructor Details
-
QuotaStatsServiceImpl
public QuotaStatsServiceImpl()
-
-
Method Details
-
activate
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
getQuotaStatsUpdaters
- Specified by:
getQuotaStatsUpdatersin interfaceQuotaStatsService
-
getQuotaStatsUpdaters
-
updateStatistics
Description copied from interface:QuotaStatsService- Specified by:
updateStatisticsin interfaceQuotaStatsService
-
computeInitialStatistics
public void computeInitialStatistics(String updaterName, CoreSession session, QuotaStatsInitialWork currentWorker, String path) Description copied from interface:QuotaStatsServiceCompute the initial statistics for the given @{code updaterName} fordocPath.- Specified by:
computeInitialStatisticsin interfaceQuotaStatsService
-
launchInitialStatisticsComputation
public void launchInitialStatisticsComputation(String updaterName, String repositoryName, String path) Description copied from interface:QuotaStatsServiceLaunch an asynchronously initial computation for the givenupdaterNameonrepositoryNamefordocPath.- Specified by:
launchInitialStatisticsComputationin interfaceQuotaStatsService
-
getProgressStatus
Description copied from interface:QuotaStatsServiceReturns the progress status ofupdaterName.- Specified by:
getProgressStatusin interfaceQuotaStatsService
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContributionin classDefaultComponent
-
getQuotaFromParent
Description copied from interface:QuotaStatsServiceGets 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:
getQuotaFromParentin interfaceQuotaStatsService
-
activateQuotaOnUserWorkspaces
Description copied from interface:QuotaStatsServiceActivates the quota on user personal workspaces- Specified by:
activateQuotaOnUserWorkspacesin interfaceQuotaStatsService
-
getQuotaSetOnUserWorkspaces
- Specified by:
getQuotaSetOnUserWorkspacesin interfaceQuotaStatsService
-
getParentsInReverseOrder
-
launchSetMaxQuotaOnUserWorkspaces
public void launchSetMaxQuotaOnUserWorkspaces(long maxSize, DocumentModel context, CoreSession session) Description copied from interface:QuotaStatsServiceSets this maxQuota on all user workspaces- Specified by:
launchSetMaxQuotaOnUserWorkspacesin interfaceQuotaStatsService
-
getUserWorkspaceRootId
-
canSetMaxQuota
Description copied from interface:QuotaStatsServiceTest to see if quota allowed. Skip user worskpaces, where validation rules don't apply.- Specified by:
canSetMaxQuotain interfaceQuotaStatsService
-