- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.GlobalObject<String,T>
-
- com.aoindustries.aoserv.client.GlobalObjectStringKey<Resource>
-
- com.aoindustries.aoserv.client.billing.Resource
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable
public final class Resource extends GlobalObjectStringKey<Resource>
AResourceis a measurable hardware resource. APackagecomes with a set of resources, and when thosePackageDefinitionLimits are exceeded, an additional amount is charged to theAccount.- Author:
- AO Industries, Inc.
- See Also:
Package
-
-
Field Summary
Fields Modifier and Type Field Description static StringAOSERV_DAEMONstatic StringAOSERV_MASTERstatic StringBANDWIDTHstatic StringCONSULTINGstatic StringDISKstatic StringDISTRIBUTION_SCANstatic StringDRUPALstatic StringEMAILstatic StringFAILOVERstatic StringHARDWARE_DISK_7200_120static StringHTTPDstatic StringIPstatic StringJAVAVMstatic StringJOOMLAstatic StringMYSQL_REPLICATIONstatic StringRACKstatic StringSERVER_DATABASEstatic StringSERVER_ENTERPRISEstatic StringSERVER_P4static StringSERVER_SCSIstatic StringSERVER_XEONstatic StringSITEstatic StringSYSADMINstatic StringUSER-
Fields inherited from class com.aoindustries.aoserv.client.GlobalObjectStringKey
pkey
-
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 Resource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectgetColumnImpl(int i)StringgetDisplayUnit(int quantity)StringgetName()Gets the unique name of this resource.StringgetPerUnit(Object amount)Table.TableIDgetTableID()voidinit(ResultSet result)Initializes this object from the raw database contents.voidread(StreamableInput in, AoservProtocol.Version protocolVersion)StringtoStringImpl()AOServObject.toString()implementation that is allowed to throw exceptions.voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion)-
Methods inherited from class com.aoindustries.aoserv.client.GlobalObjectStringKey
equals, getKey, hashCode
-
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 Detail
-
AOSERV_DAEMON
public static final String AOSERV_DAEMON
- See Also:
- Constant Field Values
-
AOSERV_MASTER
public static final String AOSERV_MASTER
- See Also:
- Constant Field Values
-
BANDWIDTH
public static final String BANDWIDTH
- See Also:
- Constant Field Values
-
CONSULTING
public static final String CONSULTING
- See Also:
- Constant Field Values
-
DISK
public static final String DISK
- See Also:
- Constant Field Values
-
DISTRIBUTION_SCAN
public static final String DISTRIBUTION_SCAN
- See Also:
- Constant Field Values
-
DRUPAL
public static final String DRUPAL
- See Also:
- Constant Field Values
-
EMAIL
public static final String EMAIL
- See Also:
- Constant Field Values
-
FAILOVER
public static final String FAILOVER
- See Also:
- Constant Field Values
-
HARDWARE_DISK_7200_120
public static final String HARDWARE_DISK_7200_120
- See Also:
- Constant Field Values
-
HTTPD
public static final String HTTPD
- See Also:
- Constant Field Values
-
IP
public static final String IP
- See Also:
- Constant Field Values
-
JAVAVM
public static final String JAVAVM
- See Also:
- Constant Field Values
-
JOOMLA
public static final String JOOMLA
- See Also:
- Constant Field Values
-
MYSQL_REPLICATION
public static final String MYSQL_REPLICATION
- See Also:
- Constant Field Values
-
RACK
public static final String RACK
- See Also:
- Constant Field Values
-
SERVER_DATABASE
public static final String SERVER_DATABASE
- See Also:
- Constant Field Values
-
SERVER_ENTERPRISE
public static final String SERVER_ENTERPRISE
- See Also:
- Constant Field Values
-
SERVER_P4
public static final String SERVER_P4
- See Also:
- Constant Field Values
-
SERVER_SCSI
public static final String SERVER_SCSI
- See Also:
- Constant Field Values
-
SERVER_XEON
public static final String SERVER_XEON
- See Also:
- Constant Field Values
-
SITE
public static final String SITE
- See Also:
- Constant Field Values
-
SYSADMIN
public static final String SYSADMIN
- See Also:
- Constant Field Values
-
USER
public static final String USER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<String,Resource>
-
getName
public String getName()
Gets the unique name of this resource.
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<String,Resource>
-
getDisplayUnit
public String getDisplayUnit(int quantity)
-
init
public void init(ResultSet result) throws SQLException
Description copied from class:AOServObjectInitializes this object from the raw database contents.- Specified by:
initin classAOServObject<String,Resource>- 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<String,Resource>- 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 classGlobalObjectStringKey<Resource>
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<String,Resource>- Throws:
IOException
-
-