Class RepoUsageComponentImpl

java.lang.Object
org.alfresco.repo.usage.RepoUsageComponentImpl
All Implemented Interfaces:
RepoUsageComponent

public class RepoUsageComponentImpl extends Object implements RepoUsageComponent
Low-level implementation to answer repository usage queries
Since:
3.5
Author:
Derek Hulley
  • Constructor Details

    • RepoUsageComponentImpl

      public RepoUsageComponentImpl()
      Defaults
  • Method Details

    • 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(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: 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
    • resetUsage

      public boolean resetUsage(RepoUsage.UsageType usageType)
      Description copied from interface: RepoUsageComponent
      Force a reset of the current repository usage. Usage data will be zero'd
      Specified by:
      resetUsage in interface RepoUsageComponent
      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: 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