public class QuotaStatsServiceImpl extends DefaultComponent implements QuotaStatsService
QuotaStatsService
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BATCH_SIZE |
static String |
QUOTA_STATS_UPDATERS_EP |
protected QuotaStatsUpdaterRegistry |
quotaStatsUpdaterRegistry |
static String |
STATUS_INITIAL_COMPUTATION_COMPLETED |
static String |
STATUS_INITIAL_COMPUTATION_PENDING |
static String |
STATUS_INITIAL_COMPUTATION_QUEUED |
lastModified, name
Constructor and Description |
---|
QuotaStatsServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
activateQuotaOnUserWorkspaces(long maxQuota,
CoreSession session)
Activates the quota on user personal workspaces
|
boolean |
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} for
docPath . |
protected List<DocumentModel> |
getParentsInReverseOrder(DocumentModel doc,
CoreSession session) |
String |
getProgressStatus(String updaterName,
String repositoryName)
Returns the progress status of
updaterName . |
long |
getQuotaFromParent(DocumentModel doc,
CoreSession session)
Gets the quota from the first parent where quota has been set.
|
long |
getQuotaSetOnUserWorkspaces(CoreSession session) |
List<QuotaStatsUpdater> |
getQuotaStatsUpdaters() |
QuotaStatsUpdater |
getQuotaStatsUpdaters(String updaterName) |
String |
getUserWorkspaceRootId(DocumentModel context,
CoreSession session) |
void |
launchInitialStatisticsComputation(String updaterName,
String repositoryName,
String path)
Launch an asynchronously initial computation for the given
updaterName on repositoryName
for docPath . |
void |
launchSetMaxQuotaOnUserWorkspaces(long maxSize,
DocumentModel context,
CoreSession session)
Sets this maxQuota on all user workspaces
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
updateStatistics(DocumentEventContext docCtx,
Event event)
Update the statistics for the given
docCtx and event . |
deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
computeInitialStatistics, launchInitialStatisticsComputation
applicationStarted, getApplicationStartedOrder
public static final String STATUS_INITIAL_COMPUTATION_QUEUED
public static final String STATUS_INITIAL_COMPUTATION_PENDING
public static final String STATUS_INITIAL_COMPUTATION_COMPLETED
public static final int DEFAULT_BATCH_SIZE
public static final String QUOTA_STATS_UPDATERS_EP
protected QuotaStatsUpdaterRegistry quotaStatsUpdaterRegistry
public QuotaStatsServiceImpl()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic List<QuotaStatsUpdater> getQuotaStatsUpdaters()
getQuotaStatsUpdaters
in interface QuotaStatsService
public QuotaStatsUpdater getQuotaStatsUpdaters(String updaterName)
public void updateStatistics(DocumentEventContext docCtx, Event event)
QuotaStatsService
updateStatistics
in interface QuotaStatsService
public void computeInitialStatistics(String updaterName, CoreSession session, QuotaStatsInitialWork currentWorker, String path)
QuotaStatsService
docPath
.computeInitialStatistics
in interface QuotaStatsService
public void launchInitialStatisticsComputation(String updaterName, String repositoryName, String path)
QuotaStatsService
updaterName
on repositoryName
for docPath
.launchInitialStatisticsComputation
in interface QuotaStatsService
public String getProgressStatus(String updaterName, String repositoryName)
QuotaStatsService
updaterName
.getProgressStatus
in interface QuotaStatsService
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public long getQuotaFromParent(DocumentModel doc, CoreSession session)
QuotaStatsService
getQuotaFromParent
in interface QuotaStatsService
public void activateQuotaOnUserWorkspaces(long maxQuota, CoreSession session)
QuotaStatsService
activateQuotaOnUserWorkspaces
in interface QuotaStatsService
public long getQuotaSetOnUserWorkspaces(CoreSession session)
getQuotaSetOnUserWorkspaces
in interface QuotaStatsService
protected List<DocumentModel> getParentsInReverseOrder(DocumentModel doc, CoreSession session)
public void launchSetMaxQuotaOnUserWorkspaces(long maxSize, DocumentModel context, CoreSession session)
QuotaStatsService
launchSetMaxQuotaOnUserWorkspaces
in interface QuotaStatsService
public String getUserWorkspaceRootId(DocumentModel context, CoreSession session)
public boolean canSetMaxQuota(long maxQuota, DocumentModel doc, CoreSession session)
QuotaStatsService
canSetMaxQuota
in interface QuotaStatsService
Copyright © 2018 Nuxeo. All rights reserved.