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 TypeMethodDescriptionintadd(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) voidClears 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.booleanhandleCommand(String[] args, Reader in, TerminalWriter out, TerminalWriter err, boolean isInteractive) Methods inherited from class com.aoindustries.aoserv.client.CachedTableIntegerKey
getMethods inherited from class com.aoindustries.aoserv.client.CachedTable
getIndexedRows, getRows, getRowsCopy, getUniqueRowImpl, isLoadedMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getDefaultOrderBy
Description copied from class:AoservTableGets the default sorting for this table.- Specified by:
getDefaultOrderByin classAoservTable<Integer,Transaction> - Returns:
nullif 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_ZONEtime zone) orType.TIME, which maintains up to microsecond accuracy and is time zone agnostic.time- The time of the transaction ornullto 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:
IOExceptionSQLException
-
get
- Specified by:
getin classCachedTableIntegerKey<Transaction>- Throws:
IOExceptionSQLException- See Also:
-
clearCache
public void clearCache()Description copied from class:CachedTableClears the cache, freeing up memory. The data will be reloaded upon next use.- Overrides:
clearCachein classCachedTable<Integer,Transaction>
-
getAccountBalance
- Throws:
IOExceptionSQLException
-
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 chargesapplied to the account (seeAccount.getCanceled()andAccount.getBillingMonthlyRate()). - Has any existing
transactionin 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
transactionin the currency within the last year
- Account is active (see
- Throws:
IOExceptionSQLException
- Is part of the current
-
getActiveAccountBalance
- Throws:
IOExceptionSQLException- See Also:
-
getAccountBalance
- Throws:
IOExceptionSQLException
-
getConfirmedAccountBalance
- Throws:
IOExceptionSQLException
-
getConfirmedAccountBalance
public Monies getConfirmedAccountBalance(Account account, Timestamp before) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getTransactionBalance
- Throws:
IOExceptionSQLException
-
getTableId
Description copied from class:AoservTableGets the unique identifier for this table. Each table has a unique identifier, as defined inSchemaTable.TableId.- Specified by:
getTableIdin classAoservTable<Integer,Transaction> - Returns:
- the identifier for this table
- See Also:
-
get
- Throws:
IOExceptionSQLException
-
getTransactions
Gets transactions that have this account as their applied-to.- Throws:
IOExceptionSQLException
-
getTransactionsFrom
Gets transactions that have this account as their source.- Throws:
IOExceptionSQLException
-
getTransactions
- Throws:
IOExceptionSQLException
-
handleCommand
public boolean handleCommand(String[] args, Reader in, TerminalWriter out, TerminalWriter err, boolean isInteractive) throws IllegalArgumentException, IOException, SQLException - Overrides:
handleCommandin classAoservTable<Integer,Transaction> - Throws:
IllegalArgumentExceptionIOExceptionSQLException
-
