public final class ConnectTableUpdater extends java.lang.Object implements ConnectionListener
database connection listener implementation
which receives notifications of database connection events (at a 4GL level, not the JDBC level) and
updates the metadata connect and myconnection tables accordingly. User table statistics are also gathered
for disconnect events, if the _Usertablestat
metadata table used by the application.
This involves the creation, lookup, and deletion of metadata connect and myconnection records. Since such events are minimized in real applications (it is a relatively expensive operation), this work is done inline (as opposed to offloaded into a worker thread).
One instance of this class is created per database, per user session.
Modifier and Type | Class and Description |
---|---|
static class |
ConnectTableUpdater.Empty
Dummy empty class to be used as the super class for creating proxies
|
private static class |
ConnectTableUpdater.Handler
Invocation handler which delegates calls to the
ConnectTableUpdater.MinimalConnect connProxy methods to
the backing DMO instance. |
static interface |
ConnectTableUpdater.MinimalConnect
Interface which defines the minimally required methods of the
MetaConnect
interface. |
static interface |
ConnectTableUpdater.MinimalMyconnection
Interface which defines the minimally required methods of the
MetaMyconnection
interface. |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CONNECT_TABLE
Metadata connect primary table name
|
private ConnectTableUpdater.MinimalConnect |
connProxy
Proxy object for the current metadata connect DMO
|
private static java.lang.Class<? extends Record> |
dmoConnectClass
MetaConnectImpl DMO implementation class
|
private static java.lang.Class<? extends Record> |
dmoMyconnClass
MetaMyconnectionImpl DMO implementation class
|
private ConnectTableUpdater.Handler |
handler
Invocation handler which maps proxy method calls to underlying DMO methods
|
private static java.util.logging.Logger |
log
Logger
|
private static java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> |
methodMap
Map of
MinimalConnect methods to MetaConnectImpl methods |
private static java.lang.String |
MYCONNECTION_TABLE
Metadata myconnection table name
|
private ConnectTableUpdater.MinimalMyconnection |
myconnProxy
Proxy object for the current metadata myconnection DMO
|
private Persistence |
persistence
Persistence helper object for metadata database
|
private SecurityManager |
securityManager
Security manager
|
private UserTableStatUpdater |
userTableStatUpdater
Optional object which updates user table stats metadata.
|
Constructor and Description |
---|
ConnectTableUpdater(Database database)
Constructor which stores a persistence object for the associated metadata database, and
initializes proxies for the application-specific DMOs.
|
Modifier and Type | Method and Description |
---|---|
void |
databaseConnected(int64 connectID)
Update the metadata database to reflect a legacy, database connection event.
|
void |
databaseDisconnected(int64 connectID)
Update the metadata database to reflect a legacy, database disconnection event.
|
private static final java.util.logging.Logger log
private static java.lang.String CONNECT_TABLE
private static java.lang.String MYCONNECTION_TABLE
private static final java.lang.Class<? extends Record> dmoConnectClass
private static final java.lang.Class<? extends Record> dmoMyconnClass
private static final java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> methodMap
MinimalConnect
methods to MetaConnectImpl
methodsprivate final Persistence persistence
private final SecurityManager securityManager
private final ConnectTableUpdater.MinimalConnect connProxy
private final ConnectTableUpdater.MinimalMyconnection myconnProxy
private final ConnectTableUpdater.Handler handler
private final UserTableStatUpdater userTableStatUpdater
null
.public ConnectTableUpdater(Database database)
database
- Primary database.public void databaseConnected(int64 connectID)
databaseConnected
in interface ConnectionListener
connectID
- Unique identifier for the database connection.public void databaseDisconnected(int64 connectID)
databaseDisconnected
in interface ConnectionListener
connectID
- Unique identifier for the database disconnection.