public class ConnectionFactoryImpl extends ConnectionFactory
Modifier and Type | Field and Description |
---|---|
private static int |
AUTH_REQ_CRYPT |
private static int |
AUTH_REQ_GSS |
private static int |
AUTH_REQ_GSS_CONTINUE |
private static int |
AUTH_REQ_KRB4 |
private static int |
AUTH_REQ_KRB5 |
private static int |
AUTH_REQ_MD5 |
private static int |
AUTH_REQ_OK |
private static int |
AUTH_REQ_PASSWORD |
private static int |
AUTH_REQ_SASL |
private static int |
AUTH_REQ_SASL_CONTINUE |
private static int |
AUTH_REQ_SASL_FINAL |
private static int |
AUTH_REQ_SCM |
private static int |
AUTH_REQ_SSPI |
private static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
ConnectionFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
createPostgresTimeZone()
Convert Java time zone to postgres time zone.
|
private ISSPIClient |
createSSPI(PGStream pgStream,
java.lang.String spnServiceClass,
boolean enableNegotiate) |
private void |
doAuthentication(PGStream pgStream,
java.lang.String host,
java.lang.String user,
java.util.Properties info) |
private PGStream |
enableSSL(PGStream pgStream,
SslMode sslMode,
java.util.Properties info,
int connectTimeout) |
private java.util.List<java.lang.String[]> |
getParametersForStartup(java.lang.String user,
java.lang.String database,
java.util.Properties info) |
private boolean |
isPrimary(QueryExecutor queryExecutor) |
private static void |
log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable thrown,
java.lang.Object... params) |
QueryExecutor |
openConnectionImpl(HostSpec[] hostSpecs,
java.lang.String user,
java.lang.String database,
java.util.Properties info)
Implementation of
ConnectionFactory.openConnection(org.postgresql.util.HostSpec[], java.lang.String, java.lang.String, java.util.Properties) for a particular protocol version. |
private void |
runInitialQueries(QueryExecutor queryExecutor,
java.util.Properties info) |
private void |
sendStartupPacket(PGStream pgStream,
java.util.List<java.lang.String[]> params) |
private PGStream |
tryConnect(java.lang.String user,
java.lang.String database,
java.util.Properties info,
javax.net.SocketFactory socketFactory,
HostSpec hostSpec,
SslMode sslMode) |
closeStream, openConnection
private static final java.util.logging.Logger LOGGER
private static final int AUTH_REQ_OK
private static final int AUTH_REQ_KRB4
private static final int AUTH_REQ_KRB5
private static final int AUTH_REQ_PASSWORD
private static final int AUTH_REQ_CRYPT
private static final int AUTH_REQ_MD5
private static final int AUTH_REQ_SCM
private static final int AUTH_REQ_GSS
private static final int AUTH_REQ_GSS_CONTINUE
private static final int AUTH_REQ_SSPI
private static final int AUTH_REQ_SASL
private static final int AUTH_REQ_SASL_CONTINUE
private static final int AUTH_REQ_SASL_FINAL
private ISSPIClient createSSPI(PGStream pgStream, java.lang.String spnServiceClass, boolean enableNegotiate)
private PGStream tryConnect(java.lang.String user, java.lang.String database, java.util.Properties info, javax.net.SocketFactory socketFactory, HostSpec hostSpec, SslMode sslMode) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public QueryExecutor openConnectionImpl(HostSpec[] hostSpecs, java.lang.String user, java.lang.String database, java.util.Properties info) throws java.sql.SQLException
ConnectionFactory
ConnectionFactory.openConnection(org.postgresql.util.HostSpec[], java.lang.String, java.lang.String, java.util.Properties)
for a particular protocol version. Implemented by
subclasses of ConnectionFactory
.openConnectionImpl
in class ConnectionFactory
hostSpecs
- at least one host and port to connect to; multiple elements for round-robin
failoveruser
- the username to authenticate with; may not be null.database
- the database on the server to connect to; may not be null.info
- extra properties controlling the connection; notably, "password" if present
supplies the password to authenticate with.null
if this protocol version is not
supported by the server.java.sql.SQLException
- if the connection could not be established for a reason other than
protocol version incompatibility.private java.util.List<java.lang.String[]> getParametersForStartup(java.lang.String user, java.lang.String database, java.util.Properties info)
private static void log(java.util.logging.Level level, java.lang.String msg, java.lang.Throwable thrown, java.lang.Object... params)
private static java.lang.String createPostgresTimeZone()
private PGStream enableSSL(PGStream pgStream, SslMode sslMode, java.util.Properties info, int connectTimeout) throws java.io.IOException, PSQLException
java.io.IOException
PSQLException
private void sendStartupPacket(PGStream pgStream, java.util.List<java.lang.String[]> params) throws java.io.IOException
java.io.IOException
private void doAuthentication(PGStream pgStream, java.lang.String host, java.lang.String user, java.util.Properties info) throws java.io.IOException, java.sql.SQLException
java.io.IOException
java.sql.SQLException
private void runInitialQueries(QueryExecutor queryExecutor, java.util.Properties info) throws java.sql.SQLException
java.sql.SQLException
private boolean isPrimary(QueryExecutor queryExecutor) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException