Class AccountTable
- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServTable<K,V>
-
- com.aoindustries.aoserv.client.CachedTable<Account.Name,V>
-
- com.aoindustries.aoserv.client.account.CachedTableAccountNameKey<Account>
-
- com.aoindustries.aoserv.client.account.AccountTable
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAccount(Account.Name accounting, String contractNumber, Host defaultServer, Account.Name parent, boolean canAddBackupServers, boolean canAddAccounts, boolean canSeePrices, boolean billParent)voidclearCache()Clears the cache, freeing up memory.Account.NamegenerateAccountingCode(Account.Name template)Accountget(Account.Name accounting)Gets oneAccountfrom the database.protected AOServTable.OrderBy[]getDefaultOrderBy()Gets the default sorting for this table.AccountgetRootAccount()Account.NamegetRootAccount_name()Table.TableIDgetTableID()Gets the unique identifier for this table.List<Account>getTopLevelAccounts()Gets the list of all accounts that either have a null parent (the actual root of the account tree) or where the parent is inaccessible.Tree<Account>getTree()Gets a Tree view of all the accessible businesses.booleanhandleCommand(String[] args, Reader in, TerminalWriter out, TerminalWriter err, boolean isInteractive)booleanisAccountingAvailable(Account.Name accounting)-
Methods inherited from class com.aoindustries.aoserv.client.account.CachedTableAccountNameKey
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 Detail
-
getDefaultOrderBy
protected AOServTable.OrderBy[] getDefaultOrderBy()
Description copied from class:AOServTableGets the default sorting for this table.- Specified by:
getDefaultOrderByin classAOServTable<Account.Name,Account>- Returns:
nullif the sorting is performed by the server or the array of column names
-
addAccount
public void addAccount(Account.Name accounting, String contractNumber, Host defaultServer, Account.Name parent, boolean canAddBackupServers, boolean canAddAccounts, boolean canSeePrices, boolean billParent) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
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<Account.Name,Account>
-
generateAccountingCode
public Account.Name generateAccountingCode(Account.Name template) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
get
public Account get(Account.Name accounting) throws IOException, SQLException
Gets oneAccountfrom the database.- Specified by:
getin classCachedTableAccountNameKey<Account>- Throws:
IOExceptionSQLException- See Also:
CachedTableAccountNameKey.get(java.lang.Object)
-
getRootAccount_name
public Account.Name getRootAccount_name() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getRootAccount
public Account getRootAccount() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getTableID
public Table.TableID 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<Account.Name,Account>- Returns:
- the identifier for this table
- See Also:
Table.TableID
-
getTopLevelAccounts
public List<Account> getTopLevelAccounts() throws IOException, SQLException
Gets the list of all accounts that either have a null parent (the actual root of the account tree) or where the parent is inaccessible.- Throws:
IOExceptionSQLException
-
handleCommand
public boolean handleCommand(String[] args, Reader in, TerminalWriter out, TerminalWriter err, boolean isInteractive) throws IllegalArgumentException, SQLException, IOException
- Overrides:
handleCommandin classAOServTable<Account.Name,Account>- Throws:
IllegalArgumentExceptionSQLExceptionIOException
-
isAccountingAvailable
public boolean isAccountingAvailable(Account.Name accounting) throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
-