public abstract class UsageTask
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected BookKeeperClient |
bookkeeperClient |
protected boolean |
isLoggedLocally |
protected org.dataone.bookkeeper.api.Usage |
usage |
Constructor and Description |
---|
UsageTask(org.dataone.bookkeeper.api.Usage usage,
BookKeeperClient bookkeeperClient)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
reportToBookKeeper()
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
|
protected org.dataone.bookkeeper.api.Usage usage
protected BookKeeperClient bookkeeperClient
protected boolean isLoggedLocally
public UsageTask(org.dataone.bookkeeper.api.Usage usage, BookKeeperClient bookkeeperClient)
usage
- the usage will be reportedbookkeeperClient
- the client to report the usage to the remote serverpublic void setIsLoggedLocally(boolean isLoggedLocally)
isLoggedLocally
- true means local database has the record; otherwise false.public void run()
run
in interface java.lang.Runnable
protected abstract int reportToBookKeeper() throws java.lang.Exception
java.lang.Exception
Copyright © 2023 Regents of the University of California. All Rights Reserved.