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
Modifier and TypeClassDescriptionstatic final class
The unique, case-insensitive identifier for anAccount
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum depth of the business tree.Fields inherited from class com.aoindustries.aoserv.client.account.CachedObjectAccountNameKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Constructor Summary
ConstructorDescriptionAccount()
Deprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionint
addAccountHost
(Host server) 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) int
addDisableLog
(String disableReason) void
addNoticeLog
(String billingContact, Email emailAddress, String type, int transid) int
addPackage
(Account.Name name, PackageDefinition packageDefinition) int
addPackageDefinition
(PackageCategory category, String name, String version, String display, String description, Money setupFee, TransactionType setupFeeTransactionType, Money monthlyRate, TransactionType monthlyRateTransactionType) 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) 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) 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) boolean
boolean
boolean
boolean
void
boolean
boolean
boolean
int
void
disable
(DisableLog dl) void
enable()
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.boolean
Gets theAccount
that 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 ornull
if not a brand.protected Object
getColumnImpl
(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 theProfile
with the highest priority.Gets theAccount
in the account tree that is one level down from the top level account.Deprecated.Please useTransactionTable.getTransactions(com.aoindustries.aoserv.client.account.Account)
directlyDeprecated.void
Initializes this object from the raw database contents.boolean
isAccountOrParent
(Account other) Deprecated.Please useisAccountOrParentOf(com.aoindustries.aoserv.client.account.Account)
instead.boolean
isAccountOrParentOf
(Account other) Determines if thisAccount
is the other account or a parent of it.boolean
Checks if this object is disabled.boolean
isParentOf
(Account other) Determines if thisAccount
is a parent of the other business.boolean
void
move
(Server from, Server to, TerminalWriter out) void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
setName
(Account.Name name) void
setUseMonthlyCreditCard
(CreditCard creditCard) Sets the credit card that will be used monthly.void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.account.CachedObjectAccountNameKey
equals, getKey, hashCode, toStringImpl
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
Methods 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.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:
IOException
SQLException
-
addAccountHost
- Throws:
IOException
SQLException
-
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:
IOException
SQLException
-
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:
IOException
SQLException
-
addDisableLog
- Throws:
IOException
SQLException
-
addNoticeLog
@Deprecated public void addNoticeLog(String billingContact, Email emailAddress, String type, int transid) throws IOException, SQLException - Throws:
IOException
SQLException
-
addPackage
public int addPackage(Account.Name name, PackageDefinition packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
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:
IOException
SQLException
-
canAddBackupServer
public boolean canAddBackupServer() -
canAddAccounts
public boolean canAddAccounts() -
cancel
-
canCancel
- Throws:
IOException
SQLException
-
isRootAccount
- Throws:
IOException
SQLException
-
canDisable
- Specified by:
canDisable
in interfaceDisablable
- Throws:
IOException
SQLException
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
canSeePrices
public boolean canSeePrices() -
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getAccountBalance
Deprecated.- Throws:
IOException
SQLException
-
getAccountBalance
Deprecated.- Throws:
IOException
SQLException
-
getAccountBalanceString
Deprecated.Please usegetAccountBalance()
andMonies.toString()
insteadGets a comma-separated list of account balances.- Throws:
IOException
SQLException
- 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:
IOException
SQLException
- See Also:
-
getName
-
getAutoEnable
public boolean getAutoEnable() -
billParent
public boolean billParent() -
getAutoEnableMinimumPayment
- Throws:
IOException
SQLException
-
getDoNotDisableReason
-
getTopLevelAccount
Gets theAccount
in the account tree that is one level down from the top level account.- Throws:
IOException
SQLException
-
getBillingAccount
Gets theAccount
that is responsible for paying the bills created by this business.- Throws:
SQLException
IOException
-
getProfile
Gets theProfile
with the highest priority.- Throws:
IOException
SQLException
-
getProfiles
Gets a list of allprofiles
for thisAccount
sorted with the highest priority profile at the zero index.- Throws:
IOException
SQLException
-
getAccountHost
- Throws:
IOException
SQLException
-
getAccountHosts
- Throws:
IOException
SQLException
-
getCanceled
-
getCancelReason
-
getChildAccounts
- Throws:
IOException
SQLException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Account.Name,
Account>
-
getConfirmedAccountBalance
Deprecated.- Throws:
IOException
SQLException
-
getConfirmedAccountBalance
@Deprecated public Monies getConfirmedAccountBalance(Timestamp before) throws IOException, SQLException Deprecated.- Throws:
IOException
SQLException
-
getContractVersion
-
getCreated
-
getCreditCardProcessors
- Throws:
IOException
SQLException
-
getCreditCards
- Throws:
IOException
SQLException
-
getDefaultHost
- Throws:
IOException
SQLException
-
isDisabled
public boolean isDisabled()Description copied from interface:Disablable
Checks 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:
isDisabled
in interfaceDisablable
-
getDisableLog
- Specified by:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
getEmailForwarding
- Throws:
SQLException
IOException
-
getEmailLists
- Throws:
IOException
SQLException
-
getLinuxServerGroup
- Throws:
IOException
SQLException
-
getMailAccounts
- Throws:
IOException
SQLException
-
getMonthlyCreditCard
- Throws:
IOException
SQLException
-
getMonthlyCharges
Gets all monthly charges from this account.- Throws:
SQLException
IOException
- See Also:
-
getBillingMonthlyCharges
Gets all monthly charges billed to this account.- Throws:
SQLException
IOException
- 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
PackageDefinition
andMonthlyCharge
from this account ornull
if unavailable. - Throws:
SQLException
IOException
- 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
PackageDefinition
andMonthlyCharge
billed to this account ornull
if unavailable. - Throws:
SQLException
IOException
- See Also:
-
getNoticeLogs
- Throws:
IOException
SQLException
-
getPackages
- Throws:
IOException
SQLException
-
getParent_name
-
getParent
- Throws:
IOException
SQLException
-
getEmailDomains
- Throws:
SQLException
IOException
-
getTableId
- Specified by:
getTableId
in 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:
IOException
SQLException
-
getTransactionsFrom
Deprecated.Gets transactions that have this account as their source.- Throws:
IOException
SQLException
-
getWhoisHistoryAccounts
- Throws:
IOException
SQLException
- See Also:
-
isAccountOrParent
Deprecated.Please useisAccountOrParentOf(com.aoindustries.aoserv.client.account.Account)
instead.- Throws:
IOException
SQLException
-
isAccountOrParentOf
Determines if thisAccount
is the other account or a parent of it. This is often used for access control between accounts.- Throws:
IOException
SQLException
-
isParentOf
Determines if thisAccount
is a parent of the other business. This is often used for access control between accounts.- Throws:
IOException
SQLException
-
move
- Throws:
IOException
SQLException
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Account.Name,
Account> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Account.Name,
Account> - Throws:
IOException
-
setName
- Throws:
SQLException
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Account.Name,
Account> - Throws:
IOException
-
getTickets
- Throws:
SQLException
IOException
-
getEncryptionKeys
Gets all of the encryption keys for this business.- Throws:
IOException
SQLException
-
setUseMonthlyCreditCard
Sets the credit card that will be used monthly. Any other selected card will be deselected. IfcreditCard
is null, none will be used automatically.- Throws:
IOException
SQLException
-
getLastCreditCardTransaction
Gets the most recent credit card transaction.- Throws:
IOException
SQLException
-
getBrand
Gets the Brand for this business ornull
if not a brand.- Throws:
IOException
SQLException
-
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:
IOException
SQLException
-
getPackageDefinition
public PackageDefinition getPackageDefinition(PackageCategory category, String name, String version) throws IOException, SQLException - Throws:
IOException
SQLException
-
getPackageDefinitions
public List<PackageDefinition> getPackageDefinitions(PackageCategory category) throws IOException, SQLException - Throws:
IOException
SQLException
-
getActivePackageDefinitions
public Map<PackageCategory,List<PackageDefinition>> getActivePackageDefinitions() throws IOException, SQLExceptionGets all active package definitions for this business.- Throws:
IOException
SQLException
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Account>
-