Class Database
java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,Database>
com.aoindustries.aoserv.client.CachedObject<Integer,Database>
com.aoindustries.aoserv.client.CachedObjectIntegerKey<Database>
com.aoindustries.aoserv.client.postgresql.Database
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AoservReadable,AoservStreamable,AoservWritable,Dumpable,JdbcProvider,Removable,SingleTableObject<Integer,Database>
public final class Database
extends CachedObjectIntegerKey<Database>
implements Dumpable, Removable, JdbcProvider
A
PostgresDatabase corresponds to a unique PostgreSQL table
space on one server. The database name must be unique per server
and, to aid in account portability, will typically be unique
across the entire system.- Author:
- AO Industries, Inc.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a name that may be used for a PostgreSQL database. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Database.NameAO Platform Components.static final Database.NameAO Platform Components.static final Database.NameAO Platform Components.static final Database.NameAO Platform Components.static final CharsetThe character set used by the dumps.static final StringThe classname of the JDBC driver used for thePostgresDatabase.static final Database.NameMonitoring.static final Database.NameTemplates.static final Database.NameTemplates.Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
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
ConstructorsConstructorDescriptionDatabase()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 TypeMethodDescriptionbooleanvoiddump(boolean gzip, StreamHandler streamHandler) Dumps the database inDUMP_ENCODINGencoding into binary form, optionally gzipped.voiddump(PrintWriter out) Dumps the contents of this object into aPrintWriter.voidDumps the database into textual representation, not gzipped.Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i) intbooleanIndicates that PostGIS should be enabled for this database.Gets the URL of the JDBC documentation.Gets the classname of the driver used to contact the server.getJdbcUrl(boolean ipOnly) Gets the URL that should be used for JDBC connections.getName()intvoidInitializes this object from the raw database contents.booleanstatic booleanisSpecial(Database.Name name) Special PostgreSQL databases may not be added or removed.booleanvoidread(StreamableInput in, AoservProtocol.Version protocolVersion) voidremove()Removes this object, and all dependant objects, from the system.AoservObject.toString()implementation that is allowed to throw exceptions.voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCodeMethods 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
-
JDBC_DRIVER
The classname of the JDBC driver used for thePostgresDatabase.- See Also:
-
TEMPLATE0
Templates. -
TEMPLATE1
Templates. -
POSTGRESMON
Monitoring. -
AOINDUSTRIES
AO Platform Components. -
AOSERV
AO Platform Components. -
AOSERV_MASTER
AO Platform Components. -
AOWEB
AO Platform Components. -
DUMP_ENCODING
The character set used by the dumps.
-
-
Constructor Details
-
Database
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
-
isSpecial
Special PostgreSQL databases may not be added or removed. -
allowsConnections
public boolean allowsConnections() -
dump
Dumps the contents of this object into aPrintWriter.- Specified by:
dumpin interfaceDumpable- Throws:
IOExceptionSQLException- See Also:
-
dump
Dumps the database into textual representation, not gzipped.- Throws:
IOExceptionSQLException
-
dump
Dumps the database inDUMP_ENCODINGencoding into binary form, optionally gzipped.- Throws:
IOExceptionSQLException
-
getEnablePostgis
public boolean getEnablePostgis()Indicates that PostGIS should be enabled for this database. -
getColumnImpl
- Specified by:
getColumnImplin classAoservObject<Integer,Database>
-
getDatdba_id
public int getDatdba_id() -
getDatdba
- Throws:
SQLExceptionIOException
-
getJdbcDriver
Description copied from interface:JdbcProviderGets the classname of the driver used to contact the server.- Specified by:
getJdbcDriverin interfaceJdbcProvider
-
getJdbcUrl
Description copied from interface:JdbcProviderGets the URL that should be used for JDBC connections.- Specified by:
getJdbcUrlin interfaceJdbcProvider- Throws:
SQLExceptionIOException
-
getJdbcDocumentationUrl
Description copied from interface:JdbcProviderGets the URL of the JDBC documentation.- Specified by:
getJdbcDocumentationUrlin interfaceJdbcProvider- Throws:
SQLExceptionIOException
-
getName
-
isSpecial
public boolean isSpecial() -
getPostgresEncoding
- Throws:
SQLExceptionIOException
-
getPostgresServer_bind_id
public int getPostgresServer_bind_id() -
getPostgresServer
- Throws:
SQLExceptionIOException
-
getTableId
- Specified by:
getTableIdin classAoservObject<Integer,Database>
-
init
Description copied from class:AoservObjectInitializes this object from the raw database contents.- Specified by:
initin classAoservObject<Integer,Database> - Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
isTemplate
public boolean isTemplate() -
read
- Specified by:
readin interfaceAoservReadable- Specified by:
readin interfaceAoservStreamable- Specified by:
readin classAoservObject<Integer,Database> - Throws:
IOException
-
getCannotRemoveReasons
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:
SQLExceptionIOException
-
remove
Description copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
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<Database>
-
write
- Specified by:
writein interfaceAoservStreamable- Specified by:
writein interfaceAoservWritable- Specified by:
writein classAoservObject<Integer,Database> - Throws:
IOException
-
