public abstract class SQLLogging
extends java.lang.Object
Each SQLLogging object is Associated with a PamDataBlock.
When a database is first connected, the last values entered into the database will be read back into Pamguard.
When a PamDataUnit is added to a PamDataBlock, Pamguard will automatically call the fillTableData function. This will automatically fill in any database columns that are cross referenced to data from other tables. It will then call the abstract function setTableData where the programmer is responsible for filling data for other columns.
PamDataBlock
,
PamTableDefinition
,
PamTableItem
Modifier and Type | Field and Description |
---|---|
static int |
UPDATE_POLICY_OVERWRITE |
static int |
UPDATE_POLICY_WRITENEW |
Modifier and Type | Method and Description |
---|---|
void |
addAddOn(SQLLoggingAddon sqlLoggingAddon)
Add an SQL Logging addon - something which adds some standard colums
to what it probably a non standard table, e.g.
|
java.lang.String |
createInClause(int[] idList)
Make an SQL clause in the from IN ( ...
|
void |
deleteData(long dataStart,
long dataEnd) |
boolean |
doExtraChecks(DBProcess dbProcess,
java.sql.Connection connection)
Gives each module a chance to do additional checks and alterations
to the database table at connection time.
|
java.lang.Float |
double2Float(java.lang.Double val)
Convert a Double to a Float, dealing with null
|
static SQLLogging |
findLogger(java.lang.String tableName)
Searches the Pamguard system for a SQLLogger with a given table name.
|
java.lang.String |
getEarlyLoadClause(PamViewParameters pvp)
clause for loading data just prior to the normal viewer load time.
|
java.lang.String |
getIdListUpdatClause(SaveRequirements sr) |
long |
getLastTime() |
PamDataBlock |
getPamDataBlock() |
PamTableDefinition |
getTableDefinition()
Each SQLLogging class must provide a valid Pamguard database definition
object
|
java.lang.String |
getTimesUpdateClause(SaveRequirements sr)
Get a select clause for viewer updates.
|
int |
getUpdatePolicy() |
CursorFinder |
getViewerCursorFinder() |
java.lang.String |
getViewerLoadClause(PamViewParameters pvp) |
java.lang.String |
getViewerUpdateClause(SaveRequirements sr)
Get a select clause for viewer updates.
|
boolean |
isCanView() |
boolean |
isLoadViewData() |
boolean |
loadViewData(java.sql.Connection con,
PamViewParameters pamViewParameters,
ViewLoadObserver loadObserver)
Load viewer data for a single datablock.
|
boolean |
loadViewerData(long dataStart,
long dataEnd,
ViewLoadObserver loadObserver) |
boolean |
logData(java.sql.Connection con,
PamDataUnit dataUnit)
Called when a new PamDataUnit is added to a PamDataBlock to write those
data to the database.
|
boolean |
prepareEmulation(long[] times)
Written to prepare the AIS module for general data emulation - will try
to put it in this higher level class, but will move to
AISLogger if there are any problems with it.
|
boolean |
prepareForMixedMode(java.sql.Connection con) |
boolean |
readLastData(java.sql.Connection con)
Called when a new database is connected to read the last values back in
from the database.
|
boolean |
readMixedModeData(long timeTo)
always creates the data unit on the next pass through each loop so that they are only
created AFTER the tiem cut off ahs passed.
|
boolean |
readNextEmulation() |
boolean |
reCheckTable()
Re-check the database tables associated with this
Logger.
|
boolean |
reLogData(java.sql.Connection con,
PamDataUnit dataUnit)
Called when an old PamDataUnit is updated.
|
void |
reset()
Reset anything needing resetting in the binary data source.
|
boolean |
saveOfflineData(DBControlUnit dbControlUnit,
java.sql.Connection connection)
Save offline data in viewer mode.
|
void |
setCanView(boolean canView) |
void |
setColumnData(int iCol,
java.lang.Object data)
Data values going in and out of the database are stored with their
respective PamTableItems.
|
void |
setLoadViewData(boolean loadViewData) |
abstract void |
setTableData(PamDataUnit pamDataUnit)
Callback function when new data are created that allows the user to set
the data for each column.
|
void |
setTableDefinition(PamTableDefinition pamTableDefinition) |
void |
setUpdatePolicy(int updatePolicy) |
boolean |
transferDataFromResult(java.sql.ResultSet resultSet) |
public static final int UPDATE_POLICY_OVERWRITE
public static final int UPDATE_POLICY_WRITENEW