Package org.alfresco.repo.usage
Class RepoUsageComponentImpl
java.lang.Object
org.alfresco.repo.usage.RepoUsageComponentImpl
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptiongetUsage()Get the current repository usage data.Calculate and retrieve full status alerts based on the usage and license expiry state.voidinit()Check that all properties are properly setvoidObserve when restrictions changebooleanresetUsage(RepoUsage.UsageType usageType) Force a reset of the current repository usage.voidsetAttributeService(AttributeService attributeService) voidsetAuthorityService(AuthorityService authorityService) voidsetCannedQueryDAO(CannedQueryDAO cannedQueryDAO) voidsetDictionaryService(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.
-
Constructor Details
-
RepoUsageComponentImpl
public RepoUsageComponentImpl()Defaults
-
-
Method Details
-
setTransactionService
- Parameters:
transactionService- service that tells if the server is read-only or not
-
setAuthorityService
- Parameters:
authorityService- service to check for admin rights
-
setAttributeService
- Parameters:
attributeService- service used to store usage attributes
-
setDictionaryService
- Parameters:
dictionaryService- component to resolve types and subtypes
-
setCannedQueryDAO
- Parameters:
cannedQueryDAO- DAO for executing queries
-
setQnameDAO
- Parameters:
qnameDAO- DAO for getting IDs of QNames
-
observeRestrictions
Description copied from interface:RepoUsageComponentObserve when restrictions change- Specified by:
observeRestrictionsin interfaceRepoUsageComponent
-
init
public void init()Check that all properties are properly set -
setRestrictions
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
- Specified by:
getRestrictionsin interfaceRepoUsageComponent- Returns:
- Returns the restrictions currently in play for the repository
-
updateUsage
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
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
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
Calculate and retrieve full status alerts based on the usage and license expiry state.- Specified by:
getUsageStatusin interfaceRepoUsageComponent- Returns:
- Returns the usage status bean
-