Class AbstractSpaceQuotaService<T extends AbstractSpaceQuotaKey>
- java.lang.Object
-
- org.silverpeas.core.admin.quota.service.AbstractQuotaService<T>
-
- org.silverpeas.core.admin.space.quota.AbstractSpaceQuotaService<T>
-
- All Implemented Interfaces:
QuotaService<T>
,SpaceQuotaService<T>
- Direct Known Subclasses:
DefaultComponentSpaceQuotaService
,DefaultDataStorageSpaceQuotaService
public abstract class AbstractSpaceQuotaService<T extends AbstractSpaceQuotaKey> extends AbstractQuotaService<T> implements SpaceQuotaService<T>
- Author:
- Yohann Chastagnier
-
-
Constructor Summary
Constructors Constructor Description AbstractSpaceQuotaService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
createKeyFrom(SpaceInst space)
Creates a quota key for the specified space.Quota
getQuotaReachedFromSpacePath(T key)
Gets the quota reached by a resource from a given quota key and this in a recursively way.Quota
verify(T key, Quota quota, AbstractQuotaCountingOffset countingOffset)
Verifies if the given loaded and computed quota by adding a counting offset.-
Methods inherited from class org.silverpeas.core.admin.quota.service.AbstractQuotaService
get, initialize, initialize, initialize, isActivated, remove, verify, verify, verify, verifyQuota
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.admin.quota.service.QuotaService
get, getCurrentCount, initialize, initialize, initialize, remove, verify, verify, verify
-
-
-
-
Method Detail
-
createKeyFrom
protected abstract T createKeyFrom(SpaceInst space)
Creates a quota key for the specified space.- Parameters:
space
- a space instance.- Returns:
- the key
-
getQuotaReachedFromSpacePath
@NonNull public Quota getQuotaReachedFromSpacePath(T key)
Description copied from interface:SpaceQuotaService
Gets the quota reached by a resource from a given quota key and this in a recursively way.- Specified by:
getQuotaReachedFromSpacePath
in interfaceSpaceQuotaService<T extends AbstractSpaceQuotaKey>
- Parameters:
key
- the key of the quota.- Returns:
- a quota. If no such quota is associated with the given key, then an empty quota is returned. In this case the identifier, the type and the related source of the quota are null (undefined).
-
verify
public Quota verify(T key, Quota quota, AbstractQuotaCountingOffset countingOffset) throws QuotaException
Description copied from interface:QuotaService
Verifies if the given loaded and computed quota by adding a counting offset.Be aware of that the quota count is not again computed by this service. When this signature is called, it means that the
If full then a quota full exception is thrown. If not enough then a quota not enough exception is thrown.Quota
instance has been already loaded and there is no need to perform again the counting.- Specified by:
verify
in interfaceQuotaService<T extends AbstractSpaceQuotaKey>
- Overrides:
verify
in classAbstractQuotaService<T extends AbstractSpaceQuotaKey>
- Parameters:
key
- the keyquota
- a loaded quotacountingOffset
- a counting offset- Returns:
- a copied quota from the given one containing the count with the offset used by the verify treatment
- Throws:
QuotaException
- on error
-
-