Package org.alfresco.repo.usage
Class RepoUsageComponentImpl
- java.lang.Object
-
- org.alfresco.repo.usage.RepoUsageComponentImpl
-
- All Implemented Interfaces:
RepoUsageComponent
public class RepoUsageComponentImpl extends java.lang.Object implements RepoUsageComponent
Low-level implementation to answer repository usage queries- Since:
- 3.5
- Author:
- Derek Hulley
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.usage.RepoUsageComponent
RepoUsageComponent.RestrictionObserver
-
-
Field Summary
-
Fields inherited from interface org.alfresco.repo.usage.RepoUsageComponent
KEY_USAGE_CURRENT, KEY_USAGE_DOCUMENTS, KEY_USAGE_LAST_UPDATE_DOCUMENTS, KEY_USAGE_LAST_UPDATE_USERS, KEY_USAGE_ROOT, KEY_USAGE_USERS
-
-
Constructor Summary
Constructors Constructor Description RepoUsageComponentImpl()Defaults
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepoUsagegetRestrictions()RepoUsagegetUsage()Get the current repository usage data.RepoUsageStatusgetUsageStatus()Calculate and retrieve full status alerts based on the usage and license expiry state.voidinit()Check that all properties are properly setvoidobserveRestrictions(RepoUsageComponent.RestrictionObserver observer)Observe when restrictions changebooleanresetUsage(RepoUsage.UsageType usageType)Force a reset of the current repository usage.voidsetAttributeService(AttributeService attributeService)voidsetAuthorityService(AuthorityService authorityService)voidsetCannedQueryDAO(CannedQueryDAO cannedQueryDAO)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetQnameDAO(QNameDAO qnameDAO)voidsetRestrictions(RepoUsage restrictions)Record changes to the restrictions imposed on the repository.voidsetTransactionService(TransactionService transactionService)booleanupdateUsage(RepoUsage.UsageType usageType)Force an update of the current repository usage.
-
-
-
Method Detail
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
- Parameters:
transactionService- service that tells if the server is read-only or not
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
- Parameters:
authorityService- service to check for admin rights
-
setAttributeService
public void setAttributeService(AttributeService attributeService)
- Parameters:
attributeService- service used to store usage attributes
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
- Parameters:
dictionaryService- component to resolve types and subtypes
-
setCannedQueryDAO
public void setCannedQueryDAO(CannedQueryDAO cannedQueryDAO)
- Parameters:
cannedQueryDAO- DAO for executing queries
-
setQnameDAO
public void setQnameDAO(QNameDAO qnameDAO)
- Parameters:
qnameDAO- DAO for getting IDs of QNames
-
observeRestrictions
public void observeRestrictions(RepoUsageComponent.RestrictionObserver observer)
Description copied from interface:RepoUsageComponentObserve when restrictions change- Specified by:
observeRestrictionsin interfaceRepoUsageComponent
-
init
public void init()
Check that all properties are properly set
-
setRestrictions
public void setRestrictions(RepoUsage restrictions)
Description copied from interface:RepoUsageComponentRecord changes to the restrictions imposed on the repository. These may be cached for fast access. This method should only be called if thecurrent restrictionshave changed.- Specified by:
setRestrictionsin interfaceRepoUsageComponent- Parameters:
restrictions- the new restrictions imposed on the repository
-
getRestrictions
public RepoUsage getRestrictions()
- Specified by:
getRestrictionsin interfaceRepoUsageComponent- Returns:
- Returns the restrictions currently in play for the repository
-
updateUsage
public boolean updateUsage(RepoUsage.UsageType usageType)
Description copied from interface:RepoUsageComponentForce an update of the current repository usage. Usage data will be gathered and stored as required.- Specified by:
updateUsagein interfaceRepoUsageComponent- Parameters:
usageType- the type of usage data that must be updated- Returns:
- true if the update succeeded or false if some other client was already performing the same update
-
resetUsage
public boolean resetUsage(RepoUsage.UsageType usageType)
Description copied from interface:RepoUsageComponentForce a reset of the current repository usage. Usage data will be zero'd- Specified by:
resetUsagein interfaceRepoUsageComponent- Parameters:
usageType- the type of usage data that must be reset- Returns:
- true if the reset succeeded or false if some other client was already performing the same reset
-
getUsage
public RepoUsage getUsage()
Description copied from interface:RepoUsageComponentGet the current repository usage data. This will not trigger an update of the data if it is not available; only pre-loaded data will be used.- Specified by:
getUsagein interfaceRepoUsageComponent- Returns:
- Returns the repository-specific current usage data.
-
getUsageStatus
public RepoUsageStatus getUsageStatus()
Calculate and retrieve full status alerts based on the usage and license expiry state.- Specified by:
getUsageStatusin interfaceRepoUsageComponent- Returns:
- Returns the usage status bean
-
-