org.silverpeas.admin.space.quota
Class DefaultDataStorageSpaceQuotaService
java.lang.Object
org.silverpeas.quota.service.AbstractQuotaService<T>
org.silverpeas.admin.space.quota.AbstractSpaceQuotaService<DataStorageSpaceQuotaKey>
org.silverpeas.admin.space.quota.DefaultDataStorageSpaceQuotaService
- All Implemented Interfaces:
- DataStorageSpaceQuotaService, SpaceQuotaService<DataStorageSpaceQuotaKey>, QuotaService<DataStorageSpaceQuotaKey>
@Service
public class DefaultDataStorageSpaceQuotaService
- extends AbstractSpaceQuotaService<DataStorageSpaceQuotaKey>
- implements DataStorageSpaceQuotaService
- Author:
- Yohann Chastagnier
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultDataStorageSpaceQuotaService
public DefaultDataStorageSpaceQuotaService()
get
public Quota get(DataStorageSpaceQuotaKey key)
throws QuotaException
- Description copied from interface:
QuotaService
- Gets the quota of the resource from a given quota key.
A save operation is done if the current count has changed.
- Specified by:
get
in interface QuotaService<DataStorageSpaceQuotaKey>
- Overrides:
get
in class AbstractQuotaService<DataStorageSpaceQuotaKey>
- Returns:
-
- Throws:
QuotaException
createKeyFrom
protected DataStorageSpaceQuotaKey createKeyFrom(SpaceInst space)
- Description copied from class:
AbstractSpaceQuotaService
- Creates a quota key
- Specified by:
createKeyFrom
in class AbstractSpaceQuotaService<DataStorageSpaceQuotaKey>
- Returns:
getCurrentCount
public long getCurrentCount(DataStorageSpaceQuotaKey key)
throws QuotaException
- Description copied from interface:
QuotaService
- Gets the current count from a given quota key
- Specified by:
getCurrentCount
in interface QuotaService<DataStorageSpaceQuotaKey>
- Returns:
-
- Throws:
QuotaException
verify
public Quota verify(DataStorageSpaceQuotaKey key,
AbstractQuotaCountingOffset countingOffset)
throws QuotaException
- Description copied from interface:
QuotaService
- Verifies if the quota is full or not enough from a given quota key and adding a counting
offset.
If full then a quota full exception is throwed.
If not enough then a quota not enough exception is throwed.
- Specified by:
verify
in interface QuotaService<DataStorageSpaceQuotaKey>
- Overrides:
verify
in class AbstractSpaceQuotaService<DataStorageSpaceQuotaKey>
- Returns:
- the quota used by the verify treatment
- Throws:
QuotaException
isActivated
protected boolean isActivated()
- Description copied from class:
AbstractQuotaService
- Indicates if the type of quota is activated
- Specified by:
isActivated
in class AbstractQuotaService<DataStorageSpaceQuotaKey>
- Returns:
Copyright © 2016 Silverpeas. All Rights Reserved.