Class PackageDefinition
- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<PackageDefinition>
-
- com.aoindustries.aoserv.client.billing.PackageDefinition
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,Removable,SingleTableObject<Integer,PackageDefinition>
public final class PackageDefinition extends CachedObjectIntegerKey<PackageDefinition> implements Removable
APackageDefinitionstores one unique set of resources, limits, and prices.- Author:
- AO Industries, Inc.
-
-
Field Summary
-
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
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
Constructors Constructor Description PackageDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcopy()AccountgetAccount()May be null if filtered.Account.NamegetAccount_name()List<CannotRemoveReason<Package>>getCannotRemoveReasons()Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i)StringgetDescription()StringgetDisplay()PackageDefinitionLimitgetLimit(Resource resource)List<PackageDefinitionLimit>getLimits()MoneygetMonthlyRate()Gets the monthly rate for the base package ornullwhen unavailable.TransactionTypegetMonthlyRateTransactionType()StringgetName()PackageCategorygetPackageCategory()StringgetPackageCategory_name()List<Package>getPackages()Gets the list of packages using this definition.MoneygetSetupFee()Gets the setup fee ornullfor none.TransactionTypegetSetupFeeTransactionType()Table.TableIDgetTableID()StringgetVersion()voidinit(ResultSet result)Initializes this object from the raw database contents.booleanisActive()booleanisApproved()voidread(StreamableInput in, AoservProtocol.Version protocolVersion)voidremove()Removes this object, and all dependant objects, from the system.voidsetActive(boolean active)voidsetLimits(PackageDefinitionLimit[] limits)StringtoStringImpl()AOServObject.toString()implementation that is allowed to throw exceptions.voidupdate(Account business, PackageCategory category, String name, String version, String display, String description, Money setupFee, TransactionType setupFeeTransactionType, Money monthlyRate, TransactionType monthlyRateTransactionType)voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion)-
Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
-
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
-
-
-
-
Method Detail
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,PackageDefinition>
-
getAccount_name
public Account.Name getAccount_name()
-
getAccount
public Account getAccount() throws IOException, SQLException
May be null if filtered.- Throws:
IOExceptionSQLException
-
getPackageCategory_name
public String getPackageCategory_name()
-
getPackageCategory
public PackageCategory getPackageCategory() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getPackages
public List<Package> getPackages() throws IOException, SQLException
Gets the list of packages using this definition.- Throws:
IOExceptionSQLException
-
getLimit
public PackageDefinitionLimit getLimit(Resource resource) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getLimits
public List<PackageDefinitionLimit> getLimits() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
setLimits
public void setLimits(PackageDefinitionLimit[] limits) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getName
public String getName()
-
getVersion
public String getVersion()
-
getDisplay
public String getDisplay()
-
getDescription
public String getDescription()
-
getSetupFee
public Money getSetupFee()
Gets the setup fee ornullfor none.
-
getSetupFeeTransactionType
public TransactionType getSetupFeeTransactionType() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getMonthlyRate
public Money getMonthlyRate()
Gets the monthly rate for the base package ornullwhen unavailable.
-
getMonthlyRateTransactionType
public TransactionType getMonthlyRateTransactionType() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
isActive
public boolean isActive()
-
copy
public int copy() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
setActive
public void setActive(boolean active) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
isApproved
public boolean isApproved()
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,PackageDefinition>
-
init
public void init(ResultSet result) throws SQLException
Description copied from class:AOServObjectInitializes this object from the raw database contents.- Specified by:
initin classAOServObject<Integer,PackageDefinition>- Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<Integer,PackageDefinition>- Throws:
IOException
-
toStringImpl
public String toStringImpl()
Description copied from class:AOServObjectAOServObject.toString()implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAOServObject.toString()on the key (fromAOServObject.getKey()). When the key isnull, uses the default implementation fromObject.toString().- Overrides:
toStringImplin classCachedObjectIntegerKey<PackageDefinition>
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,PackageDefinition>- Throws:
IOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<Package>> getCannotRemoveReasons() throws IOException, SQLException
Description copied from interface:RemovableLists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasonsin interfaceRemovable- Returns:
- an empty
List<CannotRemoveReason>if this object may be removed, or a list of descriptions - Throws:
IOExceptionSQLException
-
remove
public void remove() throws IOException, SQLExceptionDescription copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
update
public void update(Account business, PackageCategory category, String name, String version, String display, String description, Money setupFee, TransactionType setupFeeTransactionType, Money monthlyRate, TransactionType monthlyRateTransactionType) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
-