public abstract class CoreSession extends java.lang.Object implements Session
Session.SessionEventListener
Modifier and Type | Field and Description |
---|---|
protected RuntimeProperty<java.lang.Boolean> |
autoReconnect |
protected RuntimeProperty<java.lang.Boolean> |
autoReconnectForPools |
protected RuntimeProperty<java.lang.Boolean> |
cacheServerConfiguration |
protected RuntimeProperty<java.lang.String> |
characterEncoding |
protected long |
connectionCreationTimeMillis
The point in time when this connection was created
|
protected RuntimeProperty<java.lang.Boolean> |
disconnectOnExpiredPasswords |
protected ExceptionInterceptor |
exceptionInterceptor |
protected RuntimeProperty<java.lang.Boolean> |
gatherPerfMetrics |
protected HostInfo |
hostInfo |
protected Log |
log
The logger we're going to use
|
protected RuntimeProperty<java.lang.Boolean> |
maintainTimeStats |
protected MessageBuilder<? extends Message> |
messageBuilder |
protected static Log |
NULL_LOGGER
Null logger shared by all connections at startup
|
protected PropertySet |
propertySet |
protected Protocol<? extends Message> |
protocol |
protected int |
sessionMaxRows
The max-rows setting for current session
|
Constructor and Description |
---|
CoreSession(HostInfo hostInfo,
PropertySet propSet) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Session.SessionEventListener l)
Add listener for this session status changes.
|
void |
changeUser(java.lang.String user,
java.lang.String password,
java.lang.String database)
Re-authenticates as the given user and password
|
void |
forceClose()
Clobbers the physical network connection and marks this session as closed.
|
DataStoreMetadata |
getDataStoreMetadata() |
ExceptionInterceptor |
getExceptionInterceptor() |
HostInfo |
getHostInfo() |
java.lang.String |
getIdentifierQuoteString() |
Log |
getLog()
Returns the log mechanism that should be used to log information from/for this Session.
|
<M extends Message> |
getMessageBuilder() |
ProfilerEventHandler |
getProfilerEventHandler()
Returns the current ProfilerEventHandler or initializes a new one if none exists.
|
PropertySet |
getPropertySet() |
java.lang.String |
getQueryTimingUnits() |
java.net.SocketAddress |
getRemoteSocketAddress() |
ServerSession |
getServerSession() |
long |
getThreadId() |
boolean |
isSetNeededForAutoCommitMode(boolean autoCommitFlag) |
boolean |
isSSLEstablished() |
void |
quit()
Log-off of the MySQL server and close the socket.
|
void |
removeListener(Session.SessionEventListener l)
Remove session listener.
|
void |
setExceptionInterceptor(ExceptionInterceptor exceptionInterceptor) |
boolean |
versionMeetsMinimum(int major,
int minor,
int subminor)
Does the version of the MySQL server we are connected to meet the given
minimums?
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProcessHost, isClosed, query, query, queryAsync
protected PropertySet propertySet
protected ExceptionInterceptor exceptionInterceptor
protected transient Log log
protected static final Log NULL_LOGGER
protected MessageBuilder<? extends Message> messageBuilder
protected long connectionCreationTimeMillis
protected HostInfo hostInfo
protected RuntimeProperty<java.lang.Boolean> gatherPerfMetrics
protected RuntimeProperty<java.lang.String> characterEncoding
protected RuntimeProperty<java.lang.Boolean> disconnectOnExpiredPasswords
protected RuntimeProperty<java.lang.Boolean> cacheServerConfiguration
protected RuntimeProperty<java.lang.Boolean> autoReconnect
protected RuntimeProperty<java.lang.Boolean> autoReconnectForPools
protected RuntimeProperty<java.lang.Boolean> maintainTimeStats
protected int sessionMaxRows
public CoreSession(HostInfo hostInfo, PropertySet propSet)
public void changeUser(java.lang.String user, java.lang.String password, java.lang.String database)
Session
changeUser
in interface Session
user
- DB user namepassword
- DB user passworddatabase
- database namepublic PropertySet getPropertySet()
getPropertySet
in interface Session
public ExceptionInterceptor getExceptionInterceptor()
getExceptionInterceptor
in interface Session
public void setExceptionInterceptor(ExceptionInterceptor exceptionInterceptor)
setExceptionInterceptor
in interface Session
public Log getLog()
Session
public HostInfo getHostInfo()
getHostInfo
in interface Session
public <M extends Message> MessageBuilder<M> getMessageBuilder()
getMessageBuilder
in interface Session
public ServerSession getServerSession()
getServerSession
in interface Session
public boolean versionMeetsMinimum(int major, int minor, int subminor)
Session
versionMeetsMinimum
in interface Session
major
- major version numberminor
- minor version numbersubminor
- sub-minor version numberpublic long getThreadId()
getThreadId
in interface Session
public void quit()
Session
public void forceClose()
Session
forceClose
in interface Session
public boolean isSetNeededForAutoCommitMode(boolean autoCommitFlag)
isSetNeededForAutoCommitMode
in interface Session
public ProfilerEventHandler getProfilerEventHandler()
Session
getProfilerEventHandler
in interface Session
ProfilerEventHandler
object.public boolean isSSLEstablished()
isSSLEstablished
in interface Session
public java.net.SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in interface Session
public void addListener(Session.SessionEventListener l)
Session
addListener
in interface Session
l
- Session.SessionEventListener
instance.public void removeListener(Session.SessionEventListener l)
Session
removeListener
in interface Session
l
- Session.SessionEventListener
instance.public java.lang.String getIdentifierQuoteString()
getIdentifierQuoteString
in interface Session
public DataStoreMetadata getDataStoreMetadata()
getDataStoreMetadata
in interface Session
public java.lang.String getQueryTimingUnits()
getQueryTimingUnits
in interface Session