Class AbstractUsageDAOImpl

java.lang.Object
org.alfresco.repo.domain.usage.AbstractUsageDAOImpl
All Implemented Interfaces:
UsageDAO
Direct Known Subclasses:
UsageDAOImpl

public abstract class AbstractUsageDAOImpl extends Object implements UsageDAO
Abstract implementation for Usage DAO.

This provides basic services such as caching, but defers to the underlying implementation for CRUD operations for: alf_usage_delta

Since:
3.4
Author:
janv
  • Constructor Details

    • AbstractUsageDAOImpl

      public AbstractUsageDAOImpl()
  • Method Details

    • setNodeDAO

      public void setNodeDAO(NodeDAO nodeDAO)
    • deleteDeltas

      public int deleteDeltas(NodeRef nodeRef)
      Description copied from interface: UsageDAO
      Delete usage deltas for given nodeRef
      Specified by:
      deleteDeltas in interface UsageDAO
      Parameters:
      nodeRef - NodeRef
      Returns:
      int
    • deleteDeltas

      public int deleteDeltas(long nodeId)
      Description copied from interface: UsageDAO
      Delete usage deltas for given node entity id
      Specified by:
      deleteDeltas in interface UsageDAO
      Parameters:
      nodeId - long
      Returns:
      int
    • getTotalDeltaSize

      public long getTotalDeltaSize(NodeRef nodeRef, boolean removeDeltas)
      Description copied from interface: UsageDAO
      Get the total delta size for a node.
      Specified by:
      getTotalDeltaSize in interface UsageDAO
      Parameters:
      nodeRef - the node reference
      removeDeltas - true to remove the deltas before returning the result.
      Returns:
      sum of delta sizes (in bytes) - can be +ve or -ve
    • insertDelta

      public void insertDelta(NodeRef usageNodeRef, long deltaSize)
      Description copied from interface: UsageDAO
      Create a usage delta entry.
      Specified by:
      insertDelta in interface UsageDAO
      deltaSize - the size change
    • getUsageDeltaNodes

      public Set<NodeRef> getUsageDeltaNodes()
      Specified by:
      getUsageDeltaNodes in interface UsageDAO
    • getUserContentSizesForStore

      public void getUserContentSizesForStore(StoreRef storeRef, UsageDAO.MapHandler resultsCallback)
      Description copied from interface: UsageDAO
      New style content urls - Iterate and sum all content node sizes for user (owner/creator)
      Specified by:
      getUserContentSizesForStore in interface UsageDAO
      Parameters:
      storeRef - the store to search in
      resultsCallback - the callback to use while iterating over the content sizes (one row per user)
    • getUsersWithoutUsage

      public void getUsersWithoutUsage(StoreRef storeRef, UsageDAO.MapHandler handler)
      Description copied from interface: UsageDAO
      Iterate over all person nodes to get users without a calculated usage
      Specified by:
      getUsersWithoutUsage in interface UsageDAO
      Parameters:
      storeRef - the store to search in
      handler - the callback to use while iterating over the people
    • getUsersWithUsage

      public void getUsersWithUsage(StoreRef storeRef, UsageDAO.MapHandler handler)
      Description copied from interface: UsageDAO
      Iterate over all person nodes to get users with a calculated usage
      Specified by:
      getUsersWithUsage in interface UsageDAO
      Parameters:
      storeRef - the store to search in
      handler - the callback to use while iterating over the people
    • getContentSizeForStoreForUser

      public Long getContentSizeForStoreForUser(StoreRef storeRef, String userName)
      Description copied from interface: UsageDAO
      Get user with a calculated usage
      Specified by:
      getContentSizeForStoreForUser in interface UsageDAO
      Parameters:
      storeRef - the store to search in
      userName - the username
      Returns:
      Returns ussage
    • insertUsageDeltaEntity

      protected abstract UsageDeltaEntity insertUsageDeltaEntity(UsageDeltaEntity entity)
    • selectTotalUsageDeltaSize

      protected abstract UsageDeltaEntity selectTotalUsageDeltaSize(long nodeEntityId)
    • selectUsageDeltaNodes

      protected abstract List<Long> selectUsageDeltaNodes()
    • selectUsersWithoutUsage

      protected abstract void selectUsersWithoutUsage(StoreRef storeRef, UsageDAO.MapHandler handler)
    • selectUsersWithUsage

      protected abstract void selectUsersWithUsage(StoreRef storeRef, UsageDAO.MapHandler handler)
    • selectUserContentSizesForStore

      protected abstract void selectUserContentSizesForStore(StoreRef storeRef, UsageDAO.MapHandler resultsCallback)
    • selectContentSizeForStoreForUser

      protected abstract Long selectContentSizeForStoreForUser(StoreRef storeRef, String userName)
    • deleteUsageDeltaEntitiesByNodeId

      protected abstract int deleteUsageDeltaEntitiesByNodeId(long nodeEntityId)