Class PortalQuotaService
java.lang.Object
edu.ucsb.nceas.metacat.dataone.quota.QuotaService
edu.ucsb.nceas.metacat.dataone.quota.PortalQuotaService
A class enforce the portal quota service, which controls how many portals
users can create
- Author:
- tao
-
Field Summary
Fields inherited from class edu.ucsb.nceas.metacat.dataone.quota.QuotaService
client, DEFAULT_QUOTA_ID, executor, nodeId -
Method Summary
Modifier and TypeMethodDescriptionvoidenforce(String quotaSubject, org.dataone.service.types.v1.Subject requestor, String instanceId, org.dataone.service.types.v2.SystemMetadata sysmeta, String method) The method will be implemented by the child classes to enforce the quota servicestatic QuotaServicegetInstance(ExecutorService executor, BookKeeperClient client) Get a singleton class instanceMethods inherited from class edu.ucsb.nceas.metacat.dataone.quota.QuotaService
checkQuota, deleteUsage, isLastUnarchivedInChain, isLastUndeletedInChain, updateUsage
-
Method Details
-
getInstance
Get a singleton class instance- Parameters:
executor- a thread executor serviceclient- the client to connect the remote book keeper server- Returns:
- the PortalQuotaService instance
-
enforce
public void enforce(String quotaSubject, org.dataone.service.types.v1.Subject requestor, String instanceId, org.dataone.service.types.v2.SystemMetadata sysmeta, String method) throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InsufficientResources, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.NotFound, UnsupportedEncodingException Description copied from class:QuotaServiceThe method will be implemented by the child classes to enforce the quota service- Specified by:
enforcein classQuotaService- Parameters:
quotaSubject- the subject of the quota which will be usedrequestor- the subject of the user who requests the usageinstanceId- the id of the object will be applied the quotasysmeta- the system metadata of the object which will use the quotamethod- the method name which will call the createUsage method (create or update)- Throws:
org.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.InsufficientResourcesorg.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.NotFoundUnsupportedEncodingException
-