Class UsageTask
java.lang.Object
edu.ucsb.nceas.metacat.dataone.quota.UsageTask
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
CreateUsageTask
,DeleteUsageTask
,UpdateUsageTask
The parent class reporting usages to the remote book keeper server and logging the quota usages events
into the local database. The children classes are CreateUsageTask, UpdateUsageTask and DeleteUsageTask.
- Author:
- tao
-
Field Summary
Modifier and TypeFieldDescriptionprotected BookKeeperClient
protected boolean
protected org.dataone.bookkeeper.api.Usage
-
Constructor Summary
ConstructorDescriptionUsageTask
(org.dataone.bookkeeper.api.Usage usage, BookKeeperClient bookkeeperClient) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
The child class needs to implement this method to detail how to report the usage to the remote book keeper server.void
run()
void
setIsLoggedLocally
(boolean isLoggedLocally) Set the property if the usage has been logged locally or not
-
Field Details
-
usage
protected org.dataone.bookkeeper.api.Usage usage -
bookkeeperClient
-
isLoggedLocally
protected boolean isLoggedLocally
-
-
Constructor Details
-
UsageTask
Constructor- Parameters:
usage
- the usage will be reportedbookkeeperClient
- the client to report the usage to the remote server
-
-
Method Details
-
setIsLoggedLocally
public void setIsLoggedLocally(boolean isLoggedLocally) Set the property if the usage has been logged locally or not- Parameters:
isLoggedLocally
- true means local database has the record; otherwise false.
-
run
public void run() -
reportToBookKeeper
The child class needs to implement this method to detail how to report the usage to the remote book keeper server.- Throws:
Exception
-