public class QuotaDBManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATEREPORTED |
static java.lang.String |
INSTANCEID |
static java.lang.String |
NODEID |
static java.lang.String |
OBJECT |
static java.lang.String |
QUANTITY |
static java.lang.String |
QUOTAID |
static java.lang.String |
QUOTASUBJECT |
static java.lang.String |
QUOTATYPE |
static java.lang.String |
REQUESTOR |
static java.lang.String |
STATUS |
static java.lang.String |
TABLE |
static java.lang.String |
USAGELOCALID |
static java.lang.String |
USAGEREMOTEID |
Constructor and Description |
---|
QuotaDBManager() |
Modifier and Type | Method and Description |
---|---|
static void |
createUsage(org.dataone.bookkeeper.api.Usage usage,
java.util.Date date)
Create a usage record in the usages table with the given date as the reported date
If the date is null, it will create a usage record without the reported date
|
static java.sql.ResultSet |
getUnReportedUsages()
Get the result set from the table which haven't been reported to the bookkeeper server.
|
static int |
lookupRemoteUsageId(int quotaId,
java.lang.String instanceId)
Find the remote usage id in the local database for the given quota id and instance id
|
static void |
setReportedDateAndRemoteId(int localId,
java.util.Date date,
int remoteId)
Set the reported date and remote id for a given usage local id
|
public static final java.lang.String TABLE
public static final java.lang.String USAGELOCALID
public static final java.lang.String USAGEREMOTEID
public static final java.lang.String QUOTAID
public static final java.lang.String INSTANCEID
public static final java.lang.String QUANTITY
public static final java.lang.String STATUS
public static final java.lang.String DATEREPORTED
public static final java.lang.String OBJECT
public static final java.lang.String NODEID
public static final java.lang.String QUOTASUBJECT
public static final java.lang.String QUOTATYPE
public static final java.lang.String REQUESTOR
public static void createUsage(org.dataone.bookkeeper.api.Usage usage, java.util.Date date) throws java.sql.SQLException
usage
- the usage will be record into the db tabledate
- the reported date associated with the usage. If it is null, the reported date will be blank in the tablejava.sql.SQLException
public static void setReportedDateAndRemoteId(int localId, java.util.Date date, int remoteId) throws java.sql.SQLException
localId
- the local id of the usage will be setdate
- the date to report to the bookkeeper serverremoteId
- the remote id will be setjava.sql.SQLException
public static java.sql.ResultSet getUnReportedUsages() throws java.sql.SQLException
java.sql.SQLException
public static int lookupRemoteUsageId(int quotaId, java.lang.String instanceId) throws java.sql.SQLException
quotaId
- the quota id associated with the usageinstanceId
- the instance id associated with the usagejava.sql.SQLException
Copyright © 2023 Regents of the University of California. All Rights Reserved.