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 TypeMethodDescriptionvoid
enforce
(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 QuotaService
getInstance
(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:QuotaService
The method will be implemented by the child classes to enforce the quota service- Specified by:
enforce
in 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.ServiceFailure
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.InsufficientResources
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotFound
UnsupportedEncodingException
-