java.lang.Object
com.aoindustries.aoserv.client.AoservObject<User.Name,User>
com.aoindustries.aoserv.client.CachedObject<User.Name,User>
com.aoindustries.aoserv.client.postgresql.CachedObjectUserNameKey<User>
com.aoindustries.aoserv.client.postgresql.User
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
,Disablable
,PasswordProtected
,Removable
,SingleTableObject<User.Name,
User>
public final class User
extends CachedObjectUserNameKey<User>
implements Removable, PasswordProtected, Disablable
A
PostgresUser
may have access to multiple servers. The information
common to all servers is contained in PostgresUser
.- Author:
- AO Industries, Inc.
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final int
Deprecated.static final String
A password may be set to null, which means that the account will be disabled.static final String
static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.static final User.Name
The username of the PostgreSQL special users.Fields inherited from class com.aoindustries.aoserv.client.postgresql.CachedObjectUserNameKey
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
Fields inherited from interface com.aoindustries.aoserv.client.password.PasswordProtected
ALL, NONE, SOME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
addPostgresServerUser
(Server postgresServer) int
boolean
boolean
boolean
boolean
boolean
boolean
canTrace()
static List
<PasswordChecker.Result> checkPassword
(User.Name username, String password) checkPassword
(String password) void
disable
(DisableLog dl) void
enable()
Lists the reasons an object may not be removed.protected Object
getColumnImpl
(int i) getPostgresServerUser
(Server server) void
Initializes this object from the raw database contents.boolean
boolean
Checks if this object is disabled.boolean
static boolean
Special PostgreSQL users may not be added or removed.void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
setPassword
(String password) void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.postgresql.CachedObjectUserNameKey
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
-
MAX_USERNAME_LENGTH
Deprecated.Please useUser.Name.MAX_LENGTH
instead.The maximum length of a PostgreSQL username.- See Also:
-
POSTGRES
The username of the PostgreSQL special users. -
PG_MONITOR
The username of the PostgreSQL special users. -
PG_READ_ALL_SETTINGS
The username of the PostgreSQL special users. -
PG_READ_ALL_STATS
The username of the PostgreSQL special users. -
PG_SIGNAL_BACKEND
The username of the PostgreSQL special users. -
PG_STAT_SCAN_TABLES
The username of the PostgreSQL special users. -
PG_EXECUTE_SERVER_PROGRAM
The username of the PostgreSQL special users. -
PG_READ_SERVER_FILES
The username of the PostgreSQL special users. -
PG_WRITE_SERVER_FILES
The username of the PostgreSQL special users. -
PG_READ_ALL_DATA
The username of the PostgreSQL special users. -
PG_WRITE_ALL_DATA
The username of the PostgreSQL special users. -
PG_DATABASE_OWNER
The username of the PostgreSQL special users. -
PG_CHECKPOINT
The username of the PostgreSQL special users. -
POSTGRESMON
The username of the PostgreSQL special users. -
AOADMIN
The username of the PostgreSQL special users. -
AOSERV_APP
The username of the PostgreSQL special users. -
AOWEB_APP
The username of the PostgreSQL special users. -
NO_PASSWORD
A password may be set to null, which means that the account will be disabled. -
NO_PASSWORD_DB_VALUE
- See Also:
-
-
Constructor Details
-
User
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
isSpecial
Special PostgreSQL users may not be added or removed. -
addPostgresServerUser
- Throws:
IOException
SQLException
-
arePasswordsSet
- Specified by:
arePasswordsSet
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
canCatupd
public boolean canCatupd() -
canCreatedb
public boolean canCreatedb() -
canDisable
- Specified by:
canDisable
in interfaceDisablable
- Throws:
IOException
SQLException
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
canTrace
public boolean canTrace() -
checkPassword
- Specified by:
checkPassword
in interfacePasswordProtected
- Throws:
IOException
-
checkPassword
public static List<PasswordChecker.Result> checkPassword(User.Name username, String password) throws IOException - Throws:
IOException
-
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<User.Name,
User>
-
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_id
-
getDisableLog
- Specified by:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
getPostgresServerUser
- Throws:
IOException
SQLException
-
getPostgresServerUsers
- Throws:
IOException
SQLException
-
getTableId
- Specified by:
getTableId
in classAoservObject<User.Name,
User>
-
getUsername_username_id
-
getUsername
- Throws:
SQLException
IOException
-
isSpecial
public boolean isSpecial() -
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<User.Name,
User> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
isDatabaseAdmin
public boolean isDatabaseAdmin() -
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<User.Name,
User> - Throws:
IOException
-
getCannotRemoveReasons
Description copied from interface:Removable
Lists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasons
in interfaceRemovable
- Returns:
- an empty
List<CannotRemoveReason>
if this object may be removed, or a list of descriptions - Throws:
SQLException
IOException
-
remove
Description copied from interface:Removable
Removes this object, and all dependant objects, from the system.- Specified by:
remove
in interfaceRemovable
- Throws:
IOException
SQLException
-
setPassword
- Specified by:
setPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<User.Name,
User> - Throws:
IOException
-
canSetPassword
public boolean canSetPassword()- Specified by:
canSetPassword
in interfacePasswordProtected
-
User.Name.MAX_LENGTH
instead.