org.silverpeas.admin.space.quota
Class DefaultDataStorageSpaceQuotaService

java.lang.Object
  extended by org.silverpeas.quota.service.AbstractQuotaService<T>
      extended by org.silverpeas.admin.space.quota.AbstractSpaceQuotaService<DataStorageSpaceQuotaKey>
          extended by 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

Constructor Summary
DefaultDataStorageSpaceQuotaService()
           
 
Method Summary
protected  DataStorageSpaceQuotaKey createKeyFrom(SpaceInst space)
          Creates a quota key
 Quota get(DataStorageSpaceQuotaKey key)
          Gets the quota of the resource from a given quota key.
 long getCurrentCount(DataStorageSpaceQuotaKey key)
          Gets the current count from a given quota key
protected  boolean isActivated()
          Indicates if the type of quota is activated
 Quota verify(DataStorageSpaceQuotaKey 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.admin.space.quota.AbstractSpaceQuotaService
getQuotaReachedFromSpacePath
 
Methods inherited from class org.silverpeas.quota.service.AbstractQuotaService
initialize, initialize, initialize, 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.admin.space.quota.SpaceQuotaService
getQuotaReachedFromSpacePath
 
Methods inherited from interface org.silverpeas.quota.service.QuotaService
initialize, initialize, initialize, remove, verify
 

Constructor Detail

DefaultDataStorageSpaceQuotaService

public DefaultDataStorageSpaceQuotaService()
Method Detail

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.