|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.rhi.architecture.batch.AuditAgent
com.rhi.architecture.batch.AbstractAuditAgent
Abstract Audit Agent providing common audit count functionality
| Field Summary | |
static java.lang.String |
INSERT_SQL_KEY
key for audit agent insert sql statement. |
static java.lang.String |
SELECT_SQL_KEY
key for audit agent select sql statement. |
static java.lang.String |
UPDATE_SQL_KEY
key for audit agent update sql statement. |
| Constructor Summary | |
AbstractAuditAgent()
Constructor. |
|
| Method Summary | |
void |
auditCollection(java.util.Collection c,
Transaction t)
Audit the given collection. |
void |
commitAudits()
No op. |
abstract void |
configureRecord(java.util.Properties p)
Allow concrete subclasses a hook to set values on their AuditRecord class. |
void |
createAudits(java.util.Collection c)
Create an appropriate audit /control record. |
protected java.lang.String |
getInsertSQL()
get insert SQL |
protected java.lang.String |
getInsertSQLKey()
Allow subclasses to override config key. |
abstract AuditRecord |
getRecord()
Get concrete AuditRecord Concrete AuditAgent will return the actual audit record being used. |
protected java.lang.String |
getSelectSQL()
get select SQL |
protected java.lang.String |
getSelectSQLKey()
Allow subclasses to override config key. |
protected java.lang.String |
getUpdateSQL()
get update SQL |
protected java.lang.String |
getUpdateSQLKey()
Allow subclasses to override config key. |
void |
init(java.util.Properties p)
Initialization Logic |
protected abstract void |
insertRecord(java.sql.Connection conn)
Insert new audit record |
protected abstract boolean |
loadRecord(java.sql.Connection conn)
Load record (check for existence. |
protected void |
loadSQL(java.util.Properties p)
Helper method called by init() to load the required SQL entries from the properties file. |
Logger |
log()
Get the Logger reference |
protected abstract void |
updateRecord(java.sql.Connection conn)
Update record |
protected void |
updateRecordCounts(java.util.Collection c)
Update record counts based on the new collection. |
| Methods inherited from class com.rhi.architecture.batch.AuditAgent |
getInstance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String INSERT_SQL_KEY
public static final java.lang.String UPDATE_SQL_KEY
public static final java.lang.String SELECT_SQL_KEY
| Constructor Detail |
public AbstractAuditAgent()
| Method Detail |
public void init(java.util.Properties p)
throws InitializationException
init in class AuditAgentp - configuration properties for the audit agent.
InitializationException - thrown when a problem is
encountered configuring the audit agent.
public abstract void configureRecord(java.util.Properties p)
throws InitializationException
p - configuration properties for the audit agent.
InitializationException - error initializing the audit agent
protected void loadSQL(java.util.Properties p)
throws InitializationException
p - configuration properties for the audit agent.
InitializationException - error initializing the audit agent
public void createAudits(java.util.Collection c)
throws AuditException
createAudits in class AuditAgentc - a collection of records that need to be audited.
AuditException - error auditing collection, usually fatal.
public void auditCollection(java.util.Collection c,
Transaction t)
throws AuditException
auditCollection in class AuditAgentc - - records to be audited.t - - the transaction to participate in.
AuditException - thrown when an error occurs auditing the given
collection.
protected void updateRecordCounts(java.util.Collection c)
throws AuditException
c - update counts for this collection
AuditException - thrown if error updating counts.
protected abstract boolean loadRecord(java.sql.Connection conn)
throws AuditException
conn - db connection used for audits. (maintaining a single
db transaction)
AuditException - error retrieving audit record.
protected abstract void insertRecord(java.sql.Connection conn)
throws AuditException
conn - db connection used for audits in order to maintain all data
updates w/in a single transaction.
AuditException - error inserting a new audit record.
protected abstract void updateRecord(java.sql.Connection conn)
throws AuditException
conn - db connection used for audits in order to maintain all data
updates w/in a single transaction.
AuditException - error updating a audit record.
public void commitAudits()
throws AuditException
commitAudits in class AuditAgentAuditException - error commiting the audits.public abstract AuditRecord getRecord()
protected java.lang.String getInsertSQL()
protected java.lang.String getUpdateSQL()
protected java.lang.String getSelectSQL()
protected java.lang.String getInsertSQLKey()
protected java.lang.String getUpdateSQLKey()
protected java.lang.String getSelectSQLKey()
public Logger log()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||