org.alfresco.repo.usage
Class RepoUsageComponentImpl

java.lang.Object
  extended by 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

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, LOCK_TTL, LOCK_USAGE, LOCK_USAGE_DOCUMENTS, LOCK_USAGE_USERS
 
Constructor Summary
RepoUsageComponentImpl()
          Defaults
 
Method Summary
 RepoUsage getRestrictions()
           
 RepoUsage getUsage()
          Get the current repository usage data.
 RepoUsageStatus getUsageStatus()
          Calculate and retrieve full status alerts based on the usage and license expiry state.
 void init()
          Check that all properties are properly set
 void observeRestrictions(RepoUsageComponent.RestrictionObserver observer)
          Observe when restrictions change
 void setAttributeService(AttributeService attributeService)
           
 void setAuthorityService(AuthorityService authorityService)
           
 void setCannedQueryDAO(CannedQueryDAO cannedQueryDAO)
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setJobLockService(JobLockService jobLockService)
           
 void setQnameDAO(QNameDAO qnameDAO)
           
 void setRestrictions(RepoUsage restrictions)
          Record changes to the restrictions imposed on the repository.
 void setTransactionService(TransactionService transactionService)
           
 boolean updateUsage(RepoUsage.UsageType usageType)
          Force an update of the current repository usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepoUsageComponentImpl

public RepoUsageComponentImpl()
Defaults

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

setJobLockService

public void setJobLockService(JobLockService jobLockService)
Parameters:
jobLockService - service to prevent duplicate work when updating usages

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: RepoUsageComponent
Observe when restrictions change

Specified by:
observeRestrictions in interface RepoUsageComponent

init

public void init()
Check that all properties are properly set


setRestrictions

public void setRestrictions(RepoUsage restrictions)
Description copied from interface: RepoUsageComponent
Record changes to the restrictions imposed on the repository. These may be cached for fast access. This method should only be called if the current restrictions have changed.

Specified by:
setRestrictions in interface RepoUsageComponent
Parameters:
restrictions - the new restrictions imposed on the repository

getRestrictions

public RepoUsage getRestrictions()
Specified by:
getRestrictions in interface RepoUsageComponent
Returns:
Returns the restrictions currently in play for the repository

updateUsage

public boolean updateUsage(RepoUsage.UsageType usageType)
Description copied from interface: RepoUsageComponent
Force an update of the current repository usage. Usage data will be gathered and stored as required.

Specified by:
updateUsage in interface RepoUsageComponent
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

getUsage

public RepoUsage getUsage()
Description copied from interface: RepoUsageComponent
Get 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:
getUsage in interface RepoUsageComponent
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:
getUsageStatus in interface RepoUsageComponent
Returns:
Returns the usage status bean


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.