edu.ucsb.nceas.metacat.dataone.quota

## Class CreateUsageTask

- java.lang.Object
- - edu.ucsb.nceas.metacat.dataone.quota.UsageTask
  - - edu.ucsb.nceas.metacat.dataone.quota.CreateUsageTask

- All Implemented Interfaces:
    java.lang.Runnable

      public class CreateUsageTask
      extends UsageTask

  This class represents a task to report a creation of a usage to the remote bookkeeper server and set the reported date in the local usages table after the succeeded reporting
  Author:
    tao

- - ### Field Summary

    - ### Fields inherited from class edu.ucsb.nceas.metacat.dataone.quota.UsageTask

      `bookkeeperClient, isLoggedLocally, usage`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CreateUsageTask(org.dataone.bookkeeper.api.Usage usage, BookKeeperClient bookkeeperClient)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `reportToBookKeeper()` The child class needs to implement this method to detail how to report the usage to the remote book keeper server.

    - ### Methods inherited from class edu.ucsb.nceas.metacat.dataone.quota.UsageTask

      `run, setIsLoggedLocally`

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

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

- - ### Constructor Detail

    - #### CreateUsageTask

          public CreateUsageTask(org.dataone.bookkeeper.api.Usage usage,
                                 BookKeeperClient bookkeeperClient)

      Constructor
      Parameters:
        `usage` - the usage will be reported
        `bookkeeperClient` - the client to report the usage to the remote server

  - ### Method Detail

    - #### reportToBookKeeper

          protected int reportToBookKeeper()
                                    throws java.lang.Exception

      Description copied from class: `UsageTask`
      The child class needs to implement this method to detail how to report the usage to the remote book keeper server.
      Specified by:
        `reportToBookKeeper` in class `UsageTask`
      Throws:
        `java.lang.Exception`

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