Class Server
- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<Server>
-
- com.aoindustries.aoserv.client.postgresql.Server
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,SingleTableObject<Integer,Server>
public final class Server extends CachedObjectIntegerKey<Server>
APostgresServercorresponds to a unique PostgreSQL install space on one server. The server name must be unique per server.PostgresDatabases andPostgresServerUsers are unique perPostgresServer.- Author:
- AO Industries, Inc.
- See Also:
Version,Database,UserServer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServer.NameRepresents a name that may be used for a PostgreSQL installation.static classServer.ReservedWordDeprecated.2019-07-14: Is this still used?
-
Field Summary
Fields Modifier and Type Field Description static PosixPathDATA_BASE_DIRThe directory that contains the PostgreSQL data files.static PortDEFAULT_PORTThe default PostSQL port.-
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 Server()
-
Method Summary
-
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,Server>
-
getBind_id
public int getBind_id()
-
getBind
public Bind getBind() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getAoServer_server_pkey
public int getAoServer_server_pkey()
-
getLinuxServer
public Server getLinuxServer() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getVersion_version_id
public int getVersion_version_id()
-
getVersion
public Version getVersion() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getMaxConnections
public int getMaxConnections()
-
getSortMem
public int getSortMem()
-
getSharedBuffers
public int getSharedBuffers()
-
getFSync
public boolean getFSync()
-
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,Server>- 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,Server>- Throws:
IOException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,Server>- Throws:
IOException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,Server>
-
toStringImpl
public String toStringImpl() throws SQLException, IOException
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<Server>- Throws:
SQLExceptionIOException
-
addPostgresDatabase
public int addPostgresDatabase(Database.Name name, UserServer datdba, Encoding encoding, boolean enablePostgis) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getDataDirectory
public PosixPath getDataDirectory()
-
getName
public Server.Name getName()
-
getPostgresDatabase
public Database getPostgresDatabase(Database.Name name) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getPostgresDatabases
public List<Database> getPostgresDatabases() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getPostgresServerUser
public UserServer getPostgresServerUser(User.Name username) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getPostgresServerUsers
public List<UserServer> getPostgresServerUsers() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getPostgresUsers
public List<User> getPostgresUsers() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
isPostgresDatabaseNameAvailable
public boolean isPostgresDatabaseNameAvailable(Database.Name name) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
restartPostgreSQL
public void restartPostgreSQL() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
startPostgreSQL
public void startPostgreSQL() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
stopPostgreSQL
public void stopPostgreSQL() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
-