java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Account.Name,Account>
com.aoindustries.aoserv.client.CachedObject<Account.Name,Account>
com.aoindustries.aoserv.client.account.CachedObjectAccountNameKey<Account>
com.aoindustries.aoserv.client.account.Account
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AoservReadable,AoservStreamable,AoservWritable,Disablable,SingleTableObject<Account.Name,,Account> Comparable<Account>
public final class Account
extends CachedObjectAccountNameKey<Account>
implements Disablable, Comparable<Account>
An
Account is one distinct set of packages, resources, and permissions.
Some businesses may have child businesses associated with them. When that is the
case, the top level business is ultimately responsible for all actions taken and
resources used by itself and all child businesses.- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe unique, case-insensitive identifier for anAccount. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum depth of the business tree.Fields inherited from class com.aoindustries.aoserv.client.account.CachedObjectAccountNameKey
pkeyFields inherited from class com.aoindustries.aoserv.client.CachedObject
tableFields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionAccount()Deprecated, for removal: This API element is subject to removal in a future version.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionintaddAccountHost(Host server) intaddCreditCard(Processor processor, String groupName, String cardInfo, byte expirationMonth, short expirationYear, String providerUniqueId, String firstName, String lastName, String companyName, Email email, String phone, String fax, String customerId, String customerTaxId, String streetAddress1, String streetAddress2, String city, String state, String postalCode, CountryCode countryCode, String principalName, String description, String cardNumber) intaddDisableLog(String disableReason) voidaddNoticeLog(String billingContact, Email emailAddress, String type, int transid) intaddPackage(Account.Name name, PackageDefinition packageDefinition) intaddPackageDefinition(PackageCategory category, String name, String version, String display, String description, Money setupFee, TransactionType setupFeeTransactionType, Money monthlyRate, TransactionType monthlyRateTransactionType) intaddPayment(Processor processor, String groupName, boolean testMode, int duplicateWindow, String orderNumber, Money amount, Money taxAmount, boolean taxExempt, Money shippingAmount, Money dutyAmount, String shippingFirstName, String shippingLastName, String shippingCompanyName, String shippingStreetAddress1, String shippingStreetAddress2, String shippingCity, String shippingState, String shippingPostalCode, String shippingCountryCode, boolean emailCustomer, Email merchantEmail, String invoiceNumber, String purchaseOrderNumber, String description, Administrator creditCardCreatedBy, String creditCardPrincipalName, Account creditCardAccount, String creditCardGroupName, String creditCardProviderUniqueId, String creditCardMaskedCardNumber, Byte creditCard_expirationMonth, Short creditCard_expirationYear, String creditCardFirstName, String creditCardLastName, String creditCardCompanyName, Email creditCardEmail, String creditCardPhone, String creditCardFax, String creditCardCustomerId, String creditCardCustomerTaxId, String creditCardStreetAddress1, String creditCardStreetAddress2, String creditCardCity, String creditCardState, String creditCardPostalCode, String creditCardCountryCode, String creditCardComments, long authorizationTime, String authorizationPrincipalName) intaddProfile(String name, boolean isPrivate, String phone, String fax, String address1, String address2, String city, String state, String country, String zip, boolean sendInvoice, String billingContact, Set<Email> billingEmail, Profile.EmailFormat billingEmailFormat, String technicalContact, Set<Email> technicalEmail, Profile.EmailFormat technicalEmailFormat) intaddTransaction(int timeType, Timestamp time, Account sourceAccount, Administrator administrator, TransactionType type, String description, int quantity, Money rate, PaymentType paymentType, String paymentInfo, Processor processor, byte paymentConfirmed) booleanbooleanbooleanbooleanvoidbooleanbooleanbooleanintvoiddisable(DisableLog dl) voidenable()Deprecated.getAccountBalance(Timestamp before) Deprecated.Deprecated.Please usegetAccountBalance()andMonies.toString()insteadgetAccountBalanceString(Timestamp before) Deprecated.Please usegetAccountBalance(java.sql.Timestamp)andMonies.toString()insteadgetAccountHost(Host host) Gets all active package definitions for this business.booleanGets theAccountthat is responsible for paying the bills created by this business.Gets all monthly charges billed to this account.Gets an approximation of the monthly rate billed to this account.getBrand()Gets the Brand for this business ornullif not a brand.protected ObjectgetColumnImpl(int i) Deprecated.getConfirmedAccountBalance(Timestamp before) Deprecated.Gets all of the encryption keys for this business.Gets the most recent credit card transaction.getLinuxServerGroup(Server aoServer) Gets all monthly charges from this account.Gets an approximation of the monthly rate from this account.getName()getPackageDefinition(PackageCategory category, String name, String version) getPackageDefinitions(PackageCategory category) Gets theProfilewith the highest priority.Gets theAccountin the account tree that is one level down from the top level account.Deprecated.Please useTransactionTable.getTransactions(com.aoindustries.aoserv.client.account.Account)directlyDeprecated.voidInitializes this object from the raw database contents.booleanisAccountOrParent(Account other) Deprecated.Please useisAccountOrParentOf(com.aoindustries.aoserv.client.account.Account)instead.booleanisAccountOrParentOf(Account other) Determines if thisAccountis the other account or a parent of it.booleanChecks if this object is disabled.booleanisParentOf(Account other) Determines if thisAccountis a parent of the other business.booleanvoidmove(Server from, Server to, TerminalWriter out) voidread(StreamableInput in, AoservProtocol.Version protocolVersion) voidsetName(Account.Name name) voidsetUseMonthlyCreditCard(CreditCard creditCard) Sets the credit card that will be used monthly.voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.account.CachedObjectAccountNameKey
equals, getKey, hashCode, toStringImplMethods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTableMethods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Field Details
-
MAXIMUM_BUSINESS_TREE_DEPTH
public static final int MAXIMUM_BUSINESS_TREE_DEPTHThe maximum depth of the business tree.- See Also:
-
-
Constructor Details
-
Account
Deprecated, for removal: This API element is subject to removal in a future version.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
addProfile
public int addProfile(String name, boolean isPrivate, String phone, String fax, String address1, String address2, String city, String state, String country, String zip, boolean sendInvoice, String billingContact, Set<Email> billingEmail, Profile.EmailFormat billingEmailFormat, String technicalContact, Set<Email> technicalEmail, Profile.EmailFormat technicalEmailFormat) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
addAccountHost
- Throws:
IOExceptionSQLException
-
addCreditCard
public int addCreditCard(Processor processor, String groupName, String cardInfo, byte expirationMonth, short expirationYear, String providerUniqueId, String firstName, String lastName, String companyName, Email email, String phone, String fax, String customerId, String customerTaxId, String streetAddress1, String streetAddress2, String city, String state, String postalCode, CountryCode countryCode, String principalName, String description, String cardNumber) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
addPayment
@Deprecated public int addPayment(Processor processor, String groupName, boolean testMode, int duplicateWindow, String orderNumber, Money amount, Money taxAmount, boolean taxExempt, Money shippingAmount, Money dutyAmount, String shippingFirstName, String shippingLastName, String shippingCompanyName, String shippingStreetAddress1, String shippingStreetAddress2, String shippingCity, String shippingState, String shippingPostalCode, String shippingCountryCode, boolean emailCustomer, Email merchantEmail, String invoiceNumber, String purchaseOrderNumber, String description, Administrator creditCardCreatedBy, String creditCardPrincipalName, Account creditCardAccount, String creditCardGroupName, String creditCardProviderUniqueId, String creditCardMaskedCardNumber, Byte creditCard_expirationMonth, Short creditCard_expirationYear, String creditCardFirstName, String creditCardLastName, String creditCardCompanyName, Email creditCardEmail, String creditCardPhone, String creditCardFax, String creditCardCustomerId, String creditCardCustomerTaxId, String creditCardStreetAddress1, String creditCardStreetAddress2, String creditCardCity, String creditCardState, String creditCardPostalCode, String creditCardCountryCode, String creditCardComments, long authorizationTime, String authorizationPrincipalName) throws IOException, SQLException Adds a transaction in the pending state.- Throws:
IOExceptionSQLException
-
addDisableLog
- Throws:
IOExceptionSQLException
-
addNoticeLog
@Deprecated public void addNoticeLog(String billingContact, Email emailAddress, String type, int transid) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
addPackage
public int addPackage(Account.Name name, PackageDefinition packageDefinition) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
addTransaction
@Deprecated public int addTransaction(int timeType, Timestamp time, Account sourceAccount, Administrator administrator, TransactionType type, String description, int quantity, Money rate, PaymentType paymentType, String paymentInfo, Processor processor, byte paymentConfirmed) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
canAddBackupServer
public boolean canAddBackupServer() -
canAddAccounts
public boolean canAddAccounts() -
cancel
-
canCancel
- Throws:
IOExceptionSQLException
-
isRootAccount
- Throws:
IOExceptionSQLException
-
canDisable
- Specified by:
canDisablein interfaceDisablable- Throws:
IOExceptionSQLException
-
canEnable
- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
canSeePrices
public boolean canSeePrices() -
disable
- Specified by:
disablein interfaceDisablable- Throws:
IOExceptionSQLException
-
enable
- Specified by:
enablein interfaceDisablable- Throws:
IOExceptionSQLException
-
getAccountBalance
Deprecated.- Throws:
IOExceptionSQLException
-
getAccountBalance
Deprecated.- Throws:
IOExceptionSQLException
-
getAccountBalanceString
Deprecated.Please usegetAccountBalance()andMonies.toString()insteadGets a comma-separated list of account balances.- Throws:
IOExceptionSQLException- See Also:
-
getAccountBalanceString
@Deprecated public String getAccountBalanceString(Timestamp before) throws IOException, SQLException Deprecated.Please usegetAccountBalance(java.sql.Timestamp)andMonies.toString()insteadGets a comma-separated list of account balances before a given time.- Throws:
IOExceptionSQLException- See Also:
-
getName
-
getAutoEnable
public boolean getAutoEnable() -
billParent
public boolean billParent() -
getAutoEnableMinimumPayment
- Throws:
IOExceptionSQLException
-
getDoNotDisableReason
-
getTopLevelAccount
Gets theAccountin the account tree that is one level down from the top level account.- Throws:
IOExceptionSQLException
-
getBillingAccount
Gets theAccountthat is responsible for paying the bills created by this business.- Throws:
SQLExceptionIOException
-
getProfile
Gets theProfilewith the highest priority.- Throws:
IOExceptionSQLException
-
getProfiles
Gets a list of allprofilesfor thisAccountsorted with the highest priority profile at the zero index.- Throws:
IOExceptionSQLException
-
getAccountHost
- Throws:
IOExceptionSQLException
-
getAccountHosts
- Throws:
IOExceptionSQLException
-
getCanceled
-
getCancelReason
-
getChildAccounts
- Throws:
IOExceptionSQLException
-
getColumnImpl
- Specified by:
getColumnImplin classAoservObject<Account.Name,Account>
-
getConfirmedAccountBalance
Deprecated.- Throws:
IOExceptionSQLException
-
getConfirmedAccountBalance
@Deprecated public Monies getConfirmedAccountBalance(Timestamp before) throws IOException, SQLException Deprecated.- Throws:
IOExceptionSQLException
-
getContractVersion
-
getCreated
-
getCreditCardProcessors
- Throws:
IOExceptionSQLException
-
getCreditCards
- Throws:
IOExceptionSQLException
-
getDefaultHost
- Throws:
IOExceptionSQLException
-
isDisabled
public boolean isDisabled()Description copied from interface:DisablableChecks if this object is disabled. This should execute very quickly (not incur any round-trip to any database) and thus does not throw any checked exceptions.- Specified by:
isDisabledin interfaceDisablable
-
getDisableLog
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getEmailForwarding
- Throws:
SQLExceptionIOException
-
getEmailLists
- Throws:
IOExceptionSQLException
-
getLinuxServerGroup
- Throws:
IOExceptionSQLException
-
getMailAccounts
- Throws:
IOExceptionSQLException
-
getMonthlyCreditCard
- Throws:
IOExceptionSQLException
-
getMonthlyCharges
Gets all monthly charges from this account.- Throws:
SQLExceptionIOException- See Also:
-
getBillingMonthlyCharges
Gets all monthly charges billed to this account.- Throws:
SQLExceptionIOException- See Also:
-
getMonthlyRate
Gets an approximation of the monthly rate from this account. This is not guaranteed to be exactly the same as the underlying billing database processes.- Returns:
- the total monthly rate of all
PackageDefinitionandMonthlyChargefrom this account ornullif unavailable. - Throws:
SQLExceptionIOException- See Also:
-
getBillingMonthlyRate
Gets an approximation of the monthly rate billed to this account. This is not guaranteed to be exactly the same as the underlying billing database processes.- Returns:
- the total monthly rate of all
PackageDefinitionandMonthlyChargebilled to this account ornullif unavailable. - Throws:
SQLExceptionIOException- See Also:
-
getNoticeLogs
- Throws:
IOExceptionSQLException
-
getPackages
- Throws:
IOExceptionSQLException
-
getParent_name
-
getParent
- Throws:
IOExceptionSQLException
-
getEmailDomains
- Throws:
SQLExceptionIOException
-
getTableId
- Specified by:
getTableIdin classAoservObject<Account.Name,Account>
-
getTransactions
Deprecated.Please useTransactionTable.getTransactions(com.aoindustries.aoserv.client.account.Account)directlyGets transactions that have this account as their applied-to.- Throws:
IOExceptionSQLException
-
getTransactionsFrom
Deprecated.Gets transactions that have this account as their source.- Throws:
IOExceptionSQLException
-
getWhoisHistoryAccounts
- Throws:
IOExceptionSQLException- See Also:
-
isAccountOrParent
Deprecated.Please useisAccountOrParentOf(com.aoindustries.aoserv.client.account.Account)instead.- Throws:
IOExceptionSQLException
-
isAccountOrParentOf
Determines if thisAccountis the other account or a parent of it. This is often used for access control between accounts.- Throws:
IOExceptionSQLException
-
isParentOf
Determines if thisAccountis a parent of the other business. This is often used for access control between accounts.- Throws:
IOExceptionSQLException
-
move
- Throws:
IOExceptionSQLException
-
init
Description copied from class:AoservObjectInitializes this object from the raw database contents.- Specified by:
initin classAoservObject<Account.Name,Account> - Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
readin interfaceAoservReadable- Specified by:
readin interfaceAoservStreamable- Specified by:
readin classAoservObject<Account.Name,Account> - Throws:
IOException
-
setName
- Throws:
SQLExceptionIOException
-
write
- Specified by:
writein interfaceAoservStreamable- Specified by:
writein interfaceAoservWritable- Specified by:
writein classAoservObject<Account.Name,Account> - Throws:
IOException
-
getTickets
- Throws:
SQLExceptionIOException
-
getEncryptionKeys
Gets all of the encryption keys for this business.- Throws:
IOExceptionSQLException
-
setUseMonthlyCreditCard
Sets the credit card that will be used monthly. Any other selected card will be deselected. IfcreditCardis null, none will be used automatically.- Throws:
IOExceptionSQLException
-
getLastCreditCardTransaction
Gets the most recent credit card transaction.- Throws:
IOExceptionSQLException
-
getBrand
Gets the Brand for this business ornullif not a brand.- Throws:
IOExceptionSQLException
-
addPackageDefinition
@Deprecated public int addPackageDefinition(PackageCategory category, String name, String version, String display, String description, Money setupFee, TransactionType setupFeeTransactionType, Money monthlyRate, TransactionType monthlyRateTransactionType) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getPackageDefinition
public PackageDefinition getPackageDefinition(PackageCategory category, String name, String version) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getPackageDefinitions
public List<PackageDefinition> getPackageDefinitions(PackageCategory category) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getActivePackageDefinitions
public Map<PackageCategory,List<PackageDefinition>> getActivePackageDefinitions() throws IOException, SQLExceptionGets all active package definitions for this business.- Throws:
IOExceptionSQLException
-
compareTo
- Specified by:
compareToin interfaceComparable<Account>
-
