org.silverpeas.admin.space.quota
Class AbstractSpaceQuotaService<T extends AbstractSpaceQuotaKey>

java.lang.Object
  extended by org.silverpeas.quota.service.AbstractQuotaService<T>
      extended by org.silverpeas.admin.space.quota.AbstractSpaceQuotaService<T>
All Implemented Interfaces:
SpaceQuotaService<T>, QuotaService<T>
Direct Known Subclasses:
DefaultComponentSpaceQuotaService, DefaultDataStorageSpaceQuotaService

public abstract class AbstractSpaceQuotaService<T extends AbstractSpaceQuotaKey>
extends AbstractQuotaService<T>
implements SpaceQuotaService<T>

Author:
Yohann Chastagnier

Constructor Summary
AbstractSpaceQuotaService()
           
 
Method Summary
protected abstract  T createKeyFrom(SpaceInst space)
          Creates a quota key
 Quota getQuotaReachedFromSpacePath(T key)
          Gets the quota reached of the resource from a given quota key in recursively way.
 Quota verify(T key, AbstractQuotaCountingOffset countingOffset)
          Verifies if the quota is full or not enough from a given quota key and adding a counting offset.
 
Methods inherited from class org.silverpeas.quota.service.AbstractQuotaService
get, initialize, initialize, initialize, isActivated, remove, verify, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.silverpeas.quota.service.QuotaService
get, getCurrentCount, initialize, initialize, initialize, remove, verify
 

Constructor Detail

AbstractSpaceQuotaService

public AbstractSpaceQuotaService()
Method Detail

createKeyFrom

protected abstract T createKeyFrom(SpaceInst space)
Creates a quota key

Parameters:
space -
Returns:

getQuotaReachedFromSpacePath

public Quota getQuotaReachedFromSpacePath(T key)
Description copied from interface: SpaceQuotaService
Gets the quota reached of the resource from a given quota key in recursively way.

Specified by:
getQuotaReachedFromSpacePath in interface SpaceQuotaService<T extends AbstractSpaceQuotaKey>
Returns:

verify

public Quota verify(T 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<T extends AbstractSpaceQuotaKey>
Overrides:
verify in class AbstractQuotaService<T extends AbstractSpaceQuotaKey>
Returns:
the quota used by the verify treatment
Throws:
QuotaException


Copyright © 2016 Silverpeas. All Rights Reserved.