edu.ucsb.nceas.metacat.dataone.quota

## Class QuotaTypeDeterminer

- java.lang.Object
- - edu.ucsb.nceas.metacat.dataone.quota.QuotaTypeDeterminer

-     public class QuotaTypeDeterminer
      extends java.lang.Object

  A class to decide the quota type (storage, portal and etc) based on the given name space
  Author:
    tao

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PORTAL`
    `static java.lang.String` | `STORAGE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QuotaTypeDeterminer(java.util.List<java.lang.String> portalNameSpaces)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `determine(org.dataone.service.types.v2.SystemMetadata sysmeta)` Determine the quota type and instance id from the object format information in the system metadata
    `java.lang.String` | `getInstanceId()` Get the instance id determined in the determine method
    `java.lang.String` | `getQuotaType()` Get the quota type determined in the determine method

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### STORAGE

          public static final java.lang.String STORAGE

      See Also:
        Constant Field Values

    - #### PORTAL

          public static final java.lang.String PORTAL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### QuotaTypeDeterminer

          public QuotaTypeDeterminer(java.util.List<java.lang.String> portalNameSpaces)
                              throws org.dataone.service.exceptions.ServiceFailure

      Constructor
      Parameters:
        `portalNameSpaces` - list of portal objects' name space
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`

  - ### Method Detail

    - #### determine

          public void determine(org.dataone.service.types.v2.SystemMetadata sysmeta)
                         throws org.dataone.service.exceptions.InvalidRequest

      Determine the quota type and instance id from the object format information in the system metadata
      Parameters:
        `sysmeta` - the system metadata associated with the request object
      Throws:
        `org.dataone.service.exceptions.InvalidRequest`

    - #### getQuotaType

          public java.lang.String getQuotaType()

      Get the quota type determined in the determine method
      Returns:
        the string of the quota type

    - #### getInstanceId

          public java.lang.String getInstanceId()

      Get the instance id determined in the determine method
      Returns:
        the string of the instance id

Copyright © 2023 Regents of the University of California. All Rights Reserved.