public class DelegatingAuroraConnection extends AbstractDelegatingConnection implements java.sql.Connection
Connection which under the hood delegates to one of several
connections to an Aurora server. This uses the AuroraClusterMonitor to monitor the
provided cluster, and intelligently choose which connection to delegate to.
From an external perspective this is just a single connection doing some magic to fairly distribute load if possible, and to handle fail over conditions with minimal impact.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
URL_PREFIX |
| Constructor and Description |
|---|
DelegatingAuroraConnection(java.lang.String url,
java.util.Properties info)
Construct a new connection with the provided url and info.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.util.concurrent.Executor executor) |
static boolean |
acceptsURL(java.lang.String url) |
void |
clearWarnings() |
void |
close() |
boolean |
getAutoCommit() |
int |
getTransactionIsolation() |
java.sql.SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isReadOnly() |
boolean |
isValid(int timeout) |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(java.lang.String catalog) |
void |
setClientInfo(java.util.Properties properties) |
void |
setClientInfo(java.lang.String name,
java.lang.String value) |
void |
setHoldability(int holdability) |
void |
setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds) |
void |
setReadOnly(boolean readOnly) |
void |
setSchema(java.lang.String schema) |
void |
setTransactionIsolation(int level) |
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) |
java.lang.String |
toString() |
commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTypeMap, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setSavepoint, setSavepoint, unwrapequals, getClass, hashCode, notify, notifyAll, wait, wait, waitcommit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTypeMap, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setSavepoint, setSavepointpublic static final java.lang.String URL_PREFIX
public DelegatingAuroraConnection(java.lang.String url,
java.util.Properties info)
throws java.sql.SQLException
URL_PREFIX. Aurora servers should be delineated by ','.url - Servers and connect properties to connect toinfo - Info propertiesjava.sql.SQLException - Thrown if issue in establishing delegate connectionspublic static boolean acceptsURL(java.lang.String url)
public java.lang.String toString()
toString in class java.lang.Objectpublic void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isClosed()
isClosed in interface java.sql.Connectionpublic void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isReadOnly()
isReadOnly in interface java.sql.Connectionpublic void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic void setSchema(java.lang.String schema)
throws java.sql.SQLException
setSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic void abort(java.util.concurrent.Executor executor)
throws java.sql.SQLException
abort in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds)
throws java.sql.SQLException
setNetworkTimeout in interface java.sql.Connectionjava.sql.SQLException