Class PortalQuotaService

java.lang.Object
edu.ucsb.nceas.metacat.dataone.quota.QuotaService
edu.ucsb.nceas.metacat.dataone.quota.PortalQuotaService

public class PortalQuotaService extends QuotaService
A class enforce the portal quota service, which controls how many portals users can create
Author:
tao
  • Method Details

    • getInstance

      public static QuotaService getInstance(ExecutorService executor, BookKeeperClient client)
      Get a singleton class instance
      Parameters:
      executor - a thread executor service
      client - 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 class QuotaService
      Parameters:
      quotaSubject - the subject of the quota which will be used
      requestor - the subject of the user who requests the usage
      instanceId - the id of the object will be applied the quota
      sysmeta - the system metadata of the object which will use the quota
      method - 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