Class ContentUsageImpl

java.lang.Object
org.alfresco.repo.usage.ContentUsageImpl
All Implemented Interfaces:
NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy, ContentUsageService

Implements Content Usage service and policies/behaviour.
  • Constructor Details

    • ContentUsageImpl

      public ContentUsageImpl()
  • Method Details

    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setPersonService

      public void setPersonService(PersonService personService)
    • setUsageService

      public void setUsageService(UsageService usageService)
    • setPolicyComponent

      public void setPolicyComponent(PolicyComponent policyComponent)
    • setAuthenticationContext

      public void setAuthenticationContext(AuthenticationContext authenticationContext)
    • setTenantService

      public void setTenantService(TenantService tenantService)
    • setEnabled

      public void setEnabled(boolean enabled)
    • setStores

      public void setStores(List<String> stores)
    • getStores

      public List<String> getStores()
    • setExcludedTypes

      public void setExcludedTypes(List<String> excludedTypes)
    • init

      public void init()
      The initialise method
    • onCreateNode

      public void onCreateNode(ChildAssociationRef childAssocRef)
      Description copied from interface: NodeServicePolicies.OnCreateNodePolicy
      Called when a new node has been created.
      Specified by:
      onCreateNode in interface NodeServicePolicies.OnCreateNodePolicy
      Parameters:
      childAssocRef - the created child association reference
    • onUpdateProperties

      public void onUpdateProperties(NodeRef nodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)
      Called after a node's properties have been changed.
      Specified by:
      onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
      Parameters:
      nodeRef - reference to the updated node
      before - the node's properties before the change
      after - the node's properties after the change
    • beforeDeleteNode

      public void beforeDeleteNode(NodeRef nodeRef)
      Called before a node is deleted.
      Specified by:
      beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
      Parameters:
      nodeRef - the node reference
    • setUserStoredUsage

      public void setUserStoredUsage(NodeRef personNodeRef, long currentUsage)
      Set user's usage. Should only be called by background (collapse) job !
      Parameters:
      personNodeRef - person nodeRef
      currentUsage - long
    • getUserStoredUsage

      public long getUserStoredUsage(NodeRef personNodeRef)
    • getUserUsage

      public long getUserUsage(String userName)
      Description copied from interface: ContentUsageService
      Gets user usage
      Specified by:
      getUserUsage in interface ContentUsageService
      Returns:
      Return user's current calculated usage (in bytes)
    • getUserUsage

      public long getUserUsage(NodeRef personNodeRef, boolean removeDeltas)
    • setUserQuota

      public void setUserQuota(String userName, long currentQuota)
      Set user's current quota. Usually called by Web Client (Admin Console) if admin is changing/setting a user's quota.
      Specified by:
      setUserQuota in interface ContentUsageService
      Parameters:
      userName - user name
      currentQuota - User's new quota (in bytes)
    • getUserQuota

      public long getUserQuota(String userName)
      Description copied from interface: ContentUsageService
      Gets user quota Note: -1 means no quota limit set
      Specified by:
      getUserQuota in interface ContentUsageService
      Returns:
      Return user's quota (in bytes).
    • getEnabled

      public boolean getEnabled()
      Description copied from interface: ContentUsageService
      Are ContentUsages enabled (refer to 'system.usages.enabled' repository property) ?
      Specified by:
      getEnabled in interface ContentUsageService
      Returns:
      true if ContentUsages are enabled, otherwise false