Package org.alfresco.repo.usage
Interface RepoUsageComponent
-
- All Known Implementing Classes:
RepoUsageComponentImpl
public interface RepoUsageComponentLow-level interface to answer repository usage queries- Since:
- 3.5
- Author:
- Derek Hulley
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRepoUsageComponent.RestrictionObserverInterface for observers of repository restriction changes
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEY_USAGE_CURRENTstatic java.lang.StringKEY_USAGE_DOCUMENTSstatic java.lang.StringKEY_USAGE_LAST_UPDATE_DOCUMENTSstatic java.lang.StringKEY_USAGE_LAST_UPDATE_USERSstatic java.lang.StringKEY_USAGE_ROOTstatic java.lang.StringKEY_USAGE_USERS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RepoUsagegetRestrictions()RepoUsagegetUsage()Get the current repository usage data.RepoUsageStatusgetUsageStatus()Calculate and retrieve full status alerts based on the usage and license expiry state.voidobserveRestrictions(RepoUsageComponent.RestrictionObserver observer)Observe when restrictions changebooleanresetUsage(RepoUsage.UsageType usageType)Force a reset of the current repository usage.voidsetRestrictions(RepoUsage restrictions)Record changes to the restrictions imposed on the repository.booleanupdateUsage(RepoUsage.UsageType usageType)Force an update of the current repository usage.
-
-
-
Field Detail
-
KEY_USAGE_ROOT
static final java.lang.String KEY_USAGE_ROOT
- See Also:
- Constant Field Values
-
KEY_USAGE_CURRENT
static final java.lang.String KEY_USAGE_CURRENT
- See Also:
- Constant Field Values
-
KEY_USAGE_LAST_UPDATE_USERS
static final java.lang.String KEY_USAGE_LAST_UPDATE_USERS
- See Also:
- Constant Field Values
-
KEY_USAGE_USERS
static final java.lang.String KEY_USAGE_USERS
- See Also:
- Constant Field Values
-
KEY_USAGE_LAST_UPDATE_DOCUMENTS
static final java.lang.String KEY_USAGE_LAST_UPDATE_DOCUMENTS
- See Also:
- Constant Field Values
-
KEY_USAGE_DOCUMENTS
static final java.lang.String KEY_USAGE_DOCUMENTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
observeRestrictions
void observeRestrictions(RepoUsageComponent.RestrictionObserver observer)
Observe when restrictions change
-
setRestrictions
void setRestrictions(RepoUsage restrictions)
Record changes to the restrictions imposed on the repository. These may be cached for fast access. This method should only be called if thecurrent restrictionshave changed.- Parameters:
restrictions- the new restrictions imposed on the repository
-
getRestrictions
RepoUsage getRestrictions()
- Returns:
- Returns the restrictions currently in play for the repository
-
updateUsage
boolean updateUsage(RepoUsage.UsageType usageType)
Force an update of the current repository usage. Usage data will be gathered and stored as required.- 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
boolean resetUsage(RepoUsage.UsageType usageType)
Force a reset of the current repository usage. Usage data will be zero'd- 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
RepoUsage getUsage()
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.- Returns:
- Returns the repository-specific current usage data.
-
getUsageStatus
RepoUsageStatus getUsageStatus()
Calculate and retrieve full status alerts based on the usage and license expiry state.- Returns:
- Returns the usage status bean
-
-