public class JTSQLTableLogger extends GenericService implements DataCollector, Schedulable, LogListener, atg.service.jdbc.DataSourceShutdownListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
JTSQLTableLogger()
Construct an JTSQLTableLogger
|
Modifier and Type | Method and Description |
---|---|
void |
addDataItem(java.lang.Object pDataItem)
Add the given data item to the aggregate
|
void |
dataSourceShutdown(atg.service.jdbc.DataSourceShutdownEvent pEvent)
Method called before a DataSource is stopped.
|
void |
doStartService()
Perform any necessary initializations to startup service.
If a schedule is provided, then it is started. |
void |
doStopService()
Performs tasks required to shutdown service.
|
void |
flush()
Flush our data buffer by writing all of the
data to the SQL table and resetting our internal
state accordingly.
|
int |
getBufferSize()
Get property BufferSize
|
long |
getConnectRetryInterval()
Get property ConnectRetryInterval
|
int |
getDataItemCount()
Returns property DataItemCount
|
int |
getDataItemThreshold()
Returns property DataItemThreshold
|
javax.sql.DataSource |
getDataSource()
Returns property DataSource
|
java.lang.String |
getInsertSQL()
Returns property InsertSQL
|
java.lang.String |
getJobDescription()
Returns property JobDescription
|
java.lang.String |
getJobName()
Returns property JobName
|
boolean |
getLocalTransactionModeInitialization()
Get property
localTransactionModeInitialization |
java.lang.String |
getMetaDataCatalogName()
Get the catalog name
|
java.lang.String |
getMetaDataSchemaPattern()
Get the schema name
|
long |
getMinimumErrorReportInterval()
Get property MinimumErrorReportInterval
|
protected java.lang.String |
getQualifiedTableName()
A convenience method to set and retrieve the qualified table name.
|
Schedule |
getSchedule()
Returns property Schedule
|
Scheduler |
getScheduler()
Returns property Scheduler
|
SQLColumnMapping[] |
getSQLColumnMappings()
Returns property SQLColumnMappings
|
int[] |
getSQLColumnSizes()
Returns property SQLColumnSizes
|
java.lang.String |
getTableName()
Returns property TableName
|
java.lang.String |
getTablePrefix()
Returns property TablePrefix
|
javax.transaction.TransactionManager |
getTransactionManager()
Returns property TransactionManager
|
int |
getTransactionSize()
Get property TransactionSize
|
protected java.lang.Object[] |
getValueArray(java.lang.Object pDataItem,
java.lang.Object[] buffer) |
boolean |
isAutoCommitInitialization()
Returns property AutoCommitInitialization
|
boolean |
isBlocking()
Get property Blocking
|
boolean |
isEnableSQLbatch()
Returns property EnableSQLbatch
|
boolean |
isEnableTruncation()
Returns property EnableTruncation
|
boolean |
isLocalTransactionModeInitialization()
Test property
localTransactionModeInitialization |
boolean |
isSetAutoCommit()
Returns property SetAutoCommit
|
void |
logEvent(LogEvent pLogEvent)
Log an event.
|
void |
performScheduledTask(Scheduler pScheduler,
ScheduledJob pJob)
Callback method for the scheduler.
|
void |
sanitizeSQLColumnMappings()
Filter out invalid column mappings
|
void |
setAutoCommitInitialization(boolean pAutoCommitInitialization)
Sets property AutoCommitInitialization
|
void |
setBlocking(boolean pBlocking)
Set property Blocking
|
void |
setBufferSize(int pBufferSize)
Set property BufferSize, which may cause the buffer
to be flushed and reconstructed.
|
void |
setConnectRetryInterval(long pConnectRetryInterval)
Set property ConnectRetryInterval
|
void |
setDataItemThreshold(int pDataItemThreshold)
Sets property DataItemThreshold
|
void |
setDataSource(javax.sql.DataSource pDataSource)
Sets property DataSource
|
void |
setEnableSQLbatch(boolean pEnableSQLbatch)
Sets property EnableSQLbatch
|
void |
setEnableTruncation(boolean pEnableTruncation)
Sets property EnableTruncation
|
void |
setJobDescription(java.lang.String pJobDescription)
Sets property JobDescription
|
void |
setJobName(java.lang.String pJobName)
Sets property JobName
|
void |
setLocalTransactionModeInitialization(boolean pLocalTransactionModeInitialization)
Set property
localTransactionModeInitialization |
void |
setMetaDataCatalogName(java.lang.String pMetaDataCatalogName)
The name of a catalog
|
void |
setMetaDataSchemaPattern(java.lang.String pMetaDataSchemaPattern)
Set the schema name
|
void |
setMinimumErrorReportInterval(long pMinimumErrorReportInterval)
Set property MinimumErrorReportInterval
|
void |
setSchedule(Schedule pSchedule)
Sets property Schedule
|
void |
setScheduler(Scheduler pScheduler)
Sets property Scheduler
|
void |
setSetAutoCommit(boolean pSetAutoCommit)
Sets property SetAutoCommit
|
void |
setSQLColumnMappings(SQLColumnMapping[] pSQLColumnMappings)
Sets property SQLColumnMappings
|
void |
setSQLColumnSizes(int[] pSQLColumnSizes)
Sets property SQLColumnSizes
|
void |
setTableName(java.lang.String pTableName)
Sets property TableName
|
void |
setTablePrefix(java.lang.String pTablePrefix)
Sets property TablePrefix
|
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets property TransactionManager
|
void |
setTransactionSize(int pTransactionSize)
Set property TransactionSize
|
protected void |
startScheduledJob()
If we have a schedule, start scheduled job
|
java.lang.String |
toString() |
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public void setLocalTransactionModeInitialization(boolean pLocalTransactionModeInitialization)
localTransactionModeInitialization
pLocalTransactionModeInitialization
- new value to setpublic boolean getLocalTransactionModeInitialization()
localTransactionModeInitialization
localTransactionModeInitialization
public boolean isLocalTransactionModeInitialization()
localTransactionModeInitialization
localTransactionModeInitialization
public void setSQLColumnSizes(int[] pSQLColumnSizes)
public int[] getSQLColumnSizes()
public void setScheduler(Scheduler pScheduler)
public Scheduler getScheduler()
public void setSchedule(Schedule pSchedule)
public Schedule getSchedule()
public void setJobName(java.lang.String pJobName)
public java.lang.String getJobName()
public void setJobDescription(java.lang.String pJobDescription)
public java.lang.String getJobDescription()
public void setDataSource(javax.sql.DataSource pDataSource)
public javax.sql.DataSource getDataSource()
public int getDataItemCount()
public void setDataItemThreshold(int pDataItemThreshold)
public int getDataItemThreshold()
public java.lang.String getInsertSQL()
public void setTableName(java.lang.String pTableName)
public java.lang.String getTableName()
public void setSQLColumnMappings(SQLColumnMapping[] pSQLColumnMappings)
public SQLColumnMapping[] getSQLColumnMappings()
public void setBufferSize(int pBufferSize)
pBufferSize
- new value to setpublic int getBufferSize()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionSize(int pTransactionSize)
pTransactionSize
- new value to setpublic int getTransactionSize()
public void setBlocking(boolean pBlocking)
pBlocking
- new value to setpublic boolean isBlocking()
public void setConnectRetryInterval(long pConnectRetryInterval)
pConnectRetryInterval
- new value to setpublic long getConnectRetryInterval()
public void setMinimumErrorReportInterval(long pMinimumErrorReportInterval)
pMinimumErrorReportInterval
- new value to setpublic long getMinimumErrorReportInterval()
public void setEnableTruncation(boolean pEnableTruncation)
public boolean isEnableTruncation()
public void setEnableSQLbatch(boolean pEnableSQLbatch)
public boolean isEnableSQLbatch()
public void setMetaDataCatalogName(java.lang.String pMetaDataCatalogName)
String
- the name of a catalogpublic java.lang.String getMetaDataCatalogName()
public void setMetaDataSchemaPattern(java.lang.String pMetaDataSchemaPattern)
String
- the schema namepublic java.lang.String getMetaDataSchemaPattern()
public void setTablePrefix(java.lang.String pTablePrefix)
public java.lang.String getTablePrefix()
protected java.lang.String getQualifiedTableName()
public void setSetAutoCommit(boolean pSetAutoCommit)
public boolean isSetAutoCommit()
public void setAutoCommitInitialization(boolean pAutoCommitInitialization)
public boolean isAutoCommitInitialization()
public void logEvent(LogEvent pLogEvent)
logEvent
in interface LogListener
pLogEvent
- the log eventpublic void addDataItem(java.lang.Object pDataItem)
addDataItem
in interface DataListener
pDataItem
- protected java.lang.Object[] getValueArray(java.lang.Object pDataItem, java.lang.Object[] buffer)
public void sanitizeSQLColumnMappings()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void doStopService() throws ServiceException
doStopService
in class GenericService
ServiceException
- if the Service had a problem shutting downpublic void dataSourceShutdown(atg.service.jdbc.DataSourceShutdownEvent pEvent)
dataSourceShutdown
in interface atg.service.jdbc.DataSourceShutdownListener
pEvent
- event containing the shutting down DataSourceprotected void startScheduledJob()
public void performScheduledTask(Scheduler pScheduler, ScheduledJob pJob)
performScheduledTask
in interface Schedulable
pScheduler
- calling the jobpJob
- the ScheduledJobpublic void flush()
flush
in interface DataCollector
public java.lang.String toString()
toString
in class java.lang.Object