Package generalDatabase
Class BufferedSQLLogging
java.lang.Object
generalDatabase.SQLLogging
generalDatabase.BufferedSQLLogging
- Direct Known Subclasses:
 QASoundLogging
Version of SQLLogging which buffers up the data units for a few seconds before writing them
 so that other parts of PAMguard get a chance to modify them before they go into the 
 database. If a unit is updated AFTER it's been written, it will still get updated in the 
 normal way  
 
This is causing a few issues with the need to subclass
- Author:
 - dg50
 
- 
Field Summary
Fields inherited from class generalDatabase.SQLLogging
superDetLogging, UPDATE_POLICY_OVERWRITE, UPDATE_POLICY_WRITENEW - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidFlush the buffer, writing everything to the database.intbooleanlogData(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection) Called when a new PamDataUnit is added to a PamDataBlock to write those data to the database.booleanreLogData(PamConnection con, PamDataUnit dataUnit) Called when an old PamDataUnit is updated.voidsetBufferSeconds(int bufferSeconds) Methods inherited from class generalDatabase.SQLLogging
addAddOn, clearAllAddOns, countTableItems, countTableItems, createDataUnit, createEarlyResultSet, createInClause, createViewResultSet, createViewResultSet, deleteData, deleteData, deleteData, deleteIndexedItems, deleteSubtableItem, deleteSubtableItems, doExtraChecks, double2Float, fillTableData, finalize, findClosestDataPoint, findLogger, getBaseTableDefinition, getEarlyLoadClause, getIdListUpdatClause, getLastLoadIndex, getLastLoadUID, getLastTime, getLoggingAddOns, getPamDataBlock, getTableDefinition, getTimesUpdateClause, getUIDMatchClause, getUpdatePolicy, getViewerCursorFinder, getViewerEverythingClause, getViewerLessThanClause, getViewerLoadClause, getViewerOverlapClause, getViewerUpdateClause, insertCursorRow, isCanView, isLoadViewData, loadDataFrom, loadEarlyData, loadEarlyData, loadLastDataUnit, loadSubtableData, loadSubtableData, loadViewData, loadViewData, loadViewerData, logData, logSubtableData, prepareEmulation, prepareForMixedMode, readLastData, readMixedModeData, readNextEmulation, reCheckTable, reLogData, removeAddOn, removeAddOn, reset, saveOfflineData, setCanView, setColumnData, setLoadViewData, setTableData, setTableDefinition, setUpdatePolicy, transferDataFromResult, updateCursorRow, updateSubtable 
- 
Constructor Details
- 
BufferedSQLLogging
 
 - 
 - 
Method Details
- 
flushBuffer
public void flushBuffer()Flush the buffer, writing everything to the database. This will have to be called explicitly by anything using buffered logging to ensure all data are written, otherwise data may still be in the buffer when the database closes. - 
logData
Description copied from class:SQLLoggingCalled when a new PamDataUnit is added to a PamDataBlock to write those data to the database. Functionality moved down to PamCursor so that exact writing method can become database specific if necessary.- Overrides:
 logDatain classSQLLogging- Parameters:
 con- Database ConnectiondataUnit- Pamguard Data unit.superDetection- reference to a super detection so additional cross referencing can be filled- Returns:
 - true if written and new index of dataUnit retrieved OK
 - See Also:
 
 - 
reLogData
Description copied from class:SQLLoggingCalled when an old PamDataUnit is updated. The record is either updated or a new record is written, but cross referenced to the old unit for bookkeeping purposes based on the updatePolicy flag.- Overrides:
 reLogDatain classSQLLogging- Parameters:
 con- Database ConnectiondataUnit- Pamguard Data unit.- Returns:
 - the number of rows written to the database.
 - See Also:
 
 - 
getBufferSeconds
public int getBufferSeconds()- Returns:
 - the bufferSeconds
 
 - 
setBufferSeconds
public void setBufferSeconds(int bufferSeconds) - Parameters:
 bufferSeconds- the bufferSeconds to set
 
 -