Class TransactionTable
java.lang.Object
com.aoindustries.aoserv.client.AoservTable<Integer,Transaction>
com.aoindustries.aoserv.client.CachedTable<Integer,Transaction>
com.aoindustries.aoserv.client.CachedTableIntegerKey<Transaction>
com.aoindustries.aoserv.client.billing.TransactionTable
- All Implemented Interfaces:
Table<Transaction>
,Iterable<Transaction>
- Author:
- AO Industries, Inc.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.aoindustries.aoserv.client.AoservTable
AoservTable.OrderBy
-
Field Summary
Fields inherited from class com.aoindustries.aoserv.client.AoservTable
ASCENDING, connector, DESCENDING
-
Method Summary
Modifier and TypeMethodDescriptionint
add
(int timeType, Timestamp time, Account account, Account sourceAccount, Administrator administrator, TransactionType type, String description, int quantity, Money rate, PaymentType paymentType, String paymentInfo, Processor processor, byte paymentConfirmed) void
Clears the cache, freeing up memory.get
(int transid) get
(TransactionSearchCriteria criteria) getAccountBalance
(Account account) getAccountBalance
(Account account, Timestamp before) getActiveAccountBalance
(Account account) getActiveAccountBalance
(Account account, long currentTime) Gets the active account balances for an account, including zero balances for any currency that has no transactions and is currently active in billing.getConfirmedAccountBalance
(Account account) getConfirmedAccountBalance
(Account account, Timestamp before) protected AoservTable.OrderBy[]
Gets the default sorting for this table.Gets the unique identifier for this table.getTransactionBalance
(Transaction transaction) getTransactions
(Account account) Gets transactions that have this account as their applied-to.getTransactionsFrom
(Account account) Gets transactions that have this account as their source.boolean
handleCommand
(String[] args, Reader in, TerminalWriter out, TerminalWriter err, boolean isInteractive) Methods inherited from class com.aoindustries.aoserv.client.CachedTableIntegerKey
get
Methods inherited from class com.aoindustries.aoserv.client.CachedTable
getIndexedRows, getRows, getRowsCopy, getUniqueRowImpl, isLoaded
Methods inherited from class com.aoindustries.aoserv.client.AoservTable
addProgressListener, addTableListener, addTableListener, addTableLoadListener, getCachedRowCount, getConnector, getDefaultOrderBySqlExpressions, getIndexedRows, getMap, getNewObject, getObject, getObjects, getObjects, getObjects, getObjectsNoProgress, getObjectsNoProgress, getSize, getSortAlgorithm, getTableName, getTableSchema, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, hasAnyTableListener, hasTableListener, isEmpty, iterator, printTable, removeProgressListener, removeTableListener, removeTableLoadListener, size, sortIfNeeded, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getDefaultOrderBy
Description copied from class:AoservTable
Gets the default sorting for this table.- Specified by:
getDefaultOrderBy
in classAoservTable<Integer,
Transaction> - Returns:
null
if the sorting is performed by the server or the array of column names
-
add
public int add(int timeType, Timestamp time, Account account, Account sourceAccount, Administrator administrator, TransactionType type, String description, int quantity, Money rate, PaymentType paymentType, String paymentInfo, Processor processor, byte paymentConfirmed) throws IOException, SQLException - Parameters:
timeType
- EitherType.DATE
(rounded to the date inType.DATE_TIME_ZONE
time zone) orType.TIME
, which maintains up to microsecond accuracy and is time zone agnostic.time
- The time of the transaction ornull
to use the current date / time per the master database clock. The master database server is both NTP-synchronized and actively monitored, so it is best to let the master database choose the time when "now" or "today" is desired for the transaction.- Throws:
IOException
SQLException
-
get
- Specified by:
get
in classCachedTableIntegerKey<Transaction>
- Throws:
IOException
SQLException
- See Also:
-
clearCache
public void clearCache()Description copied from class:CachedTable
Clears the cache, freeing up memory. The data will be reloaded upon next use.- Overrides:
clearCache
in classCachedTable<Integer,
Transaction>
-
getAccountBalance
- Throws:
IOException
SQLException
-
getActiveAccountBalance
public Monies getActiveAccountBalance(Account account, long currentTime) throws IOException, SQLException Gets the active account balances for an account, including zero balances for any currency that has no transactions and is currently active in billing. A currency is active when any of the following is true:- Is part of the current
monthly charges
applied to the account (seeAccount.getCanceled()
andAccount.getBillingMonthlyRate()
). - Has any existing
transaction
in the currency and any of the following:- Account is active (see
Account.getCanceled()
) - Account canceled less than a year ago
- Account has a non-zero balance in the currency
- Account has a
transaction
in the currency within the last year
- Account is active (see
- Throws:
IOException
SQLException
- Is part of the current
-
getActiveAccountBalance
- Throws:
IOException
SQLException
- See Also:
-
getAccountBalance
- Throws:
IOException
SQLException
-
getConfirmedAccountBalance
- Throws:
IOException
SQLException
-
getConfirmedAccountBalance
public Monies getConfirmedAccountBalance(Account account, Timestamp before) throws IOException, SQLException - Throws:
IOException
SQLException
-
getTransactionBalance
- Throws:
IOException
SQLException
-
getTableId
Description copied from class:AoservTable
Gets the unique identifier for this table. Each table has a unique identifier, as defined inSchemaTable.TableId
.- Specified by:
getTableId
in classAoservTable<Integer,
Transaction> - Returns:
- the identifier for this table
- See Also:
-
get
- Throws:
IOException
SQLException
-
getTransactions
Gets transactions that have this account as their applied-to.- Throws:
IOException
SQLException
-
getTransactionsFrom
Gets transactions that have this account as their source.- Throws:
IOException
SQLException
-
getTransactions
- Throws:
IOException
SQLException
-
handleCommand
public boolean handleCommand(String[] args, Reader in, TerminalWriter out, TerminalWriter err, boolean isInteractive) throws IllegalArgumentException, IOException, SQLException - Overrides:
handleCommand
in classAoservTable<Integer,
Transaction> - Throws:
IllegalArgumentException
IOException
SQLException
-