Package org.alfresco.repo.domain.usage
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.usage.UsageDAO
UsageDAO.MapHandler, UsageDAO.StringHandler
-
-
Constructor Summary
Constructors Constructor Description AbstractUsageDAOImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intdeleteDeltas(long nodeId)Delete usage deltas for given node entity idintdeleteDeltas(NodeRef nodeRef)Delete usage deltas for given nodeRefprotected abstract intdeleteUsageDeltaEntitiesByNodeId(long nodeEntityId)LonggetContentSizeForStoreForUser(StoreRef storeRef, String userName)Get user with a calculated usagelonggetTotalDeltaSize(NodeRef nodeRef, boolean removeDeltas)Get the total delta size for a node.Set<NodeRef>getUsageDeltaNodes()voidgetUserContentSizesForStore(StoreRef storeRef, UsageDAO.MapHandler resultsCallback)New style content urls - Iterate and sum all content node sizes for user (owner/creator)voidgetUsersWithoutUsage(StoreRef storeRef, UsageDAO.MapHandler handler)Iterate over all person nodes to get users without a calculated usagevoidgetUsersWithUsage(StoreRef storeRef, UsageDAO.MapHandler handler)Iterate over all person nodes to get users with a calculated usagevoidinsertDelta(NodeRef usageNodeRef, long deltaSize)Create a usage delta entry.protected abstract UsageDeltaEntityinsertUsageDeltaEntity(UsageDeltaEntity entity)protected abstract LongselectContentSizeForStoreForUser(StoreRef storeRef, String userName)protected abstract UsageDeltaEntityselectTotalUsageDeltaSize(long nodeEntityId)protected abstract List<Long>selectUsageDeltaNodes()protected abstract voidselectUserContentSizesForStore(StoreRef storeRef, UsageDAO.MapHandler resultsCallback)protected abstract voidselectUsersWithoutUsage(StoreRef storeRef, UsageDAO.MapHandler handler)protected abstract voidselectUsersWithUsage(StoreRef storeRef, UsageDAO.MapHandler handler)voidsetNodeDAO(NodeDAO nodeDAO)
-
-
-
Method Detail
-
setNodeDAO
public void setNodeDAO(NodeDAO nodeDAO)
-
deleteDeltas
public int deleteDeltas(NodeRef nodeRef)
Description copied from interface:UsageDAODelete usage deltas for given nodeRef- Specified by:
deleteDeltasin interfaceUsageDAO- Parameters:
nodeRef- NodeRef- Returns:
- int
-
deleteDeltas
public int deleteDeltas(long nodeId)
Description copied from interface:UsageDAODelete usage deltas for given node entity id- Specified by:
deleteDeltasin interfaceUsageDAO- Parameters:
nodeId- long- Returns:
- int
-
getTotalDeltaSize
public long getTotalDeltaSize(NodeRef nodeRef, boolean removeDeltas)
Description copied from interface:UsageDAOGet the total delta size for a node.- Specified by:
getTotalDeltaSizein interfaceUsageDAO- Parameters:
nodeRef- the node referenceremoveDeltas- 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:UsageDAOCreate a usage delta entry.- Specified by:
insertDeltain interfaceUsageDAOdeltaSize- the size change
-
getUsageDeltaNodes
public Set<NodeRef> getUsageDeltaNodes()
- Specified by:
getUsageDeltaNodesin interfaceUsageDAO
-
getUserContentSizesForStore
public void getUserContentSizesForStore(StoreRef storeRef, UsageDAO.MapHandler resultsCallback)
Description copied from interface:UsageDAONew style content urls - Iterate and sum all content node sizes for user (owner/creator)- Specified by:
getUserContentSizesForStorein interfaceUsageDAO- Parameters:
storeRef- the store to search inresultsCallback- 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:UsageDAOIterate over all person nodes to get users without a calculated usage- Specified by:
getUsersWithoutUsagein interfaceUsageDAO- Parameters:
storeRef- the store to search inhandler- the callback to use while iterating over the people
-
getUsersWithUsage
public void getUsersWithUsage(StoreRef storeRef, UsageDAO.MapHandler handler)
Description copied from interface:UsageDAOIterate over all person nodes to get users with a calculated usage- Specified by:
getUsersWithUsagein interfaceUsageDAO- Parameters:
storeRef- the store to search inhandler- the callback to use while iterating over the people
-
getContentSizeForStoreForUser
public Long getContentSizeForStoreForUser(StoreRef storeRef, String userName)
Description copied from interface:UsageDAOGet user with a calculated usage- Specified by:
getContentSizeForStoreForUserin interfaceUsageDAO- Parameters:
storeRef- the store to search inuserName- the username- Returns:
- Returns ussage
-
insertUsageDeltaEntity
protected abstract UsageDeltaEntity insertUsageDeltaEntity(UsageDeltaEntity entity)
-
selectTotalUsageDeltaSize
protected abstract UsageDeltaEntity selectTotalUsageDeltaSize(long nodeEntityId)
-
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)
-
-