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 |
static String |
STATUS_INITIAL_COMPUTATION_COMPLETED |
static String |
STATUS_INITIAL_COMPUTATION_PENDING |
static String |
STATUS_INITIAL_COMPUTATION_QUEUED |
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)
Compute the initial statistics for the given @{code updaterName}.
|
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)
Launch an asynchronously initial computation for the given
updaterName on repositoryName . |
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 . |
applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
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
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) throws ClientException
QuotaStatsService
updateStatistics
in interface QuotaStatsService
ClientException
public void computeInitialStatistics(String updaterName, CoreSession session, QuotaStatsInitialWork currentWorker)
QuotaStatsService
computeInitialStatistics
in interface QuotaStatsService
public void launchInitialStatisticsComputation(String updaterName, String repositoryName)
QuotaStatsService
updaterName
on repositoryName
.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) throws ClientException
QuotaStatsService
getQuotaFromParent
in interface QuotaStatsService
ClientException
public void activateQuotaOnUserWorkspaces(long maxQuota, CoreSession session) throws ClientException
QuotaStatsService
activateQuotaOnUserWorkspaces
in interface QuotaStatsService
ClientException
public long getQuotaSetOnUserWorkspaces(CoreSession session) throws ClientException
getQuotaSetOnUserWorkspaces
in interface QuotaStatsService
ClientException
public void launchSetMaxQuotaOnUserWorkspaces(long maxSize, DocumentModel context, CoreSession session) throws ClientException
QuotaStatsService
launchSetMaxQuotaOnUserWorkspaces
in interface QuotaStatsService
ClientException
public String getUserWorkspaceRootId(DocumentModel context, CoreSession session) throws ClientException
ClientException
public boolean canSetMaxQuota(long maxQuota, DocumentModel doc, CoreSession session) throws ClientException
QuotaStatsService
canSetMaxQuota
in interface QuotaStatsService
ClientException
Copyright © 2015 Nuxeo SA. All rights reserved.