Package adams.db.mirrored
Class LogT
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.db.wrapper.AbstractWrapper<LogIntf>
-
- adams.db.mirrored.LogT
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,LogIntf
,TableInterface
,Serializable
public class LogT extends AbstractWrapper<LogIntf> implements LogIntf
Allows mirroring to another database.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LogIntf
m_DB
the non-mirrored backend.protected static WrapperManager<LogT>
m_TableManager
the table manager.protected String
m_Updating
object for blocking polling/removal of fully processed.-
Fields inherited from class adams.db.wrapper.AbstractWrapper
m_Connection, m_TableName, m_Wrapped
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.db.LogIntf
TABLE_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LogT(AbstractDatabaseConnection dbcon, LogIntf wrapped)
Initializes the mirroring.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(LogEntry log)
Adds a log entry.boolean
exists(LogEntry log)
Looks for a log entry in the DB, looking for the auto_id.static LogT
getSingleton(AbstractDatabaseConnection dbcon, LogIntf mirror)
Returns the singleton of the table.LogEntry
load(long auto_id)
Loads a log entry from db, using the database ID.List<LogEntry>
load(LogEntryConditions cond)
Loads log entries from the database that match the conditions.boolean
remove(LogEntry log)
Removes a log entry from the DB.boolean
update(LogEntry log)
Updates a log entry.-
Methods inherited from class adams.db.wrapper.AbstractWrapper
getDatabaseConnection, getTableName, getWrapped
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface adams.db.TableInterface
getTableName
-
-
-
-
Field Detail
-
m_TableManager
protected static WrapperManager<LogT> m_TableManager
the table manager.
-
m_DB
protected LogIntf m_DB
the non-mirrored backend.
-
m_Updating
protected final String m_Updating
object for blocking polling/removal of fully processed.
-
-
Constructor Detail
-
LogT
protected LogT(AbstractDatabaseConnection dbcon, LogIntf wrapped)
Initializes the mirroring.- Parameters:
dbcon
- the database connectionwrapped
- the mirror
-
-
Method Detail
-
load
public LogEntry load(long auto_id)
Loads a log entry from db, using the database ID.
-
load
public List<LogEntry> load(LogEntryConditions cond)
Loads log entries from the database that match the conditions.
-
exists
public boolean exists(LogEntry log)
Looks for a log entry in the DB, looking for the auto_id.
-
add
public boolean add(LogEntry log)
Adds a log entry.
-
update
public boolean update(LogEntry log)
Updates a log entry.
-
remove
public boolean remove(LogEntry log)
Removes a log entry from the DB.
-
getSingleton
public static LogT getSingleton(AbstractDatabaseConnection dbcon, LogIntf mirror)
Returns the singleton of the table.- Parameters:
dbcon
- the database connection to get the singleton formirror
- the mirror- Returns:
- the singleton
-
-