Package com.day.cq.dam.usage.api
Interface AssetUsageTracker
-
public interface AssetUsageTracker
TheAssetUsageTracker
interface describes the methods for recording and accessing the asset usage record.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AssetUsageTracker.AggregateUsageInfo
The Class AggregateUsageInfo, defines the meta properties for the asset usage information.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LAST_USED
The last used.static java.lang.String
USAGE_COUNT
The usage count.static java.lang.String
USAGE_TYPE
The asset usage type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getAssetScore(Asset asset)
Gets the asset score.java.util.List<AssetUsageTracker.AggregateUsageInfo>
getUsageStats(Asset asset, java.util.List<java.lang.String> usagesType)
Gets the asset usage stats.void
recordUsage(Asset asset, AssetUsageRecord assetUsageRecord)
Update theasset
usages information withassetUsageRecord
.
-
-
-
Field Detail
-
USAGE_COUNT
static final java.lang.String USAGE_COUNT
The usage count.- See Also:
- Constant Field Values
-
LAST_USED
static final java.lang.String LAST_USED
The last used.- See Also:
- Constant Field Values
-
USAGE_TYPE
static final java.lang.String USAGE_TYPE
The asset usage type.- See Also:
- Constant Field Values
-
-
Method Detail
-
recordUsage
void recordUsage(Asset asset, AssetUsageRecord assetUsageRecord) throws RepositoryException, PersistenceException, ReplicationException
Update theasset
usages information withassetUsageRecord
.- Parameters:
asset
- the asset to updateassetUsageRecord
- the new asset usage record- Throws:
RepositoryException
- the repository exceptionPersistenceException
- the persistence exceptionReplicationException
- the replication exception
-
getAssetScore
long getAssetScore(Asset asset)
Gets the asset score.- Parameters:
asset
- asset for which score is required- Returns:
- the asset score
-
getUsageStats
java.util.List<AssetUsageTracker.AggregateUsageInfo> getUsageStats(Asset asset, java.util.List<java.lang.String> usagesType)
Gets the asset usage stats.- Parameters:
asset
- the asset for which information is requiredusagesType
- list of usages to be returned- Returns:
- the list of
AggregateUsageInfo
for all the solutions in which thisasset
has been used.
-
-