com.rhi.architecture.batch
Class AuditAgent

java.lang.Object
  extended bycom.rhi.architecture.batch.AuditAgent
Direct Known Subclasses:
AbstractAuditAgent, NullAuditAgent

public abstract class AuditAgent
extends java.lang.Object

Audit Agent is responsible for performing all audits for a specific concrete application. All auditing is deferred to this class.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
protected AuditAgent()
          private constructor - use the getInstance factory method to build an audit agent.
 
Method Summary
abstract  void auditCollection(java.util.Collection c, Transaction t)
          Audit the given collection.
abstract  void commitAudits()
          Mark complete & close the current audit record.
abstract  void createAudits(java.util.Collection c)
          Create an appropriate audit /control record.
static AuditAgent getInstance(java.lang.String className)
          Factory method allowing the framework to load any audit agent as long as it's in the classpath.
abstract  void init(java.util.Properties p)
          Initialization Logic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditAgent

protected AuditAgent()
private constructor - use the getInstance factory method to build an audit agent.

Since:
1.0
Method Detail

init

public abstract void init(java.util.Properties p)
                   throws InitializationException
Initialization Logic

Parameters:
p - config properties for audit agent.
Throws:
InitializationException
Since:
1.0

createAudits

public abstract void createAudits(java.util.Collection c)
                           throws AuditException
Create an appropriate audit /control record. This method should create a record w/ only a unprocessed count > 0. The auditCollection method will be called as records are passed through the pipeline & this method will modify the counts; subtracting from the unprocesed, and adding to the errored, valid, or duplicate counts.

Parameters:
c - the collection that will be audited. (all source records)
Throws:
AuditException - - thrown if the audits can't be created.
Since:
1.0

auditCollection

public abstract void auditCollection(java.util.Collection c,
                                     Transaction t)
                              throws AuditException
Audit the given collection. This method should subtract the given collection.size() from the un- processed count for this audit set & add the collection.size() in some manner to the processed columns (valid,errored,duplicate,other)

Parameters:
c - - records to be audited.
t - - the transaction to use when auditing.
Throws:
AuditException - thrown if the collection audit fails.
Since:
1.0

commitAudits

public abstract void commitAudits()
                           throws AuditException
Mark complete & close the current audit record. This method may or may not do anything.

Throws:
AuditException - thrown if the commit fails.
Since:
1.0

getInstance

public static AuditAgent getInstance(java.lang.String className)
                              throws InitializationException
Factory method allowing the framework to load any audit agent as long as it's in the classpath.

Parameters:
className - - fully qualified class name for a concrete audit agent class.
Returns:
AuditAgent - an instance of the audit agent class.
Throws:
InitializationException - - failure creating audit agent.
Since:
1.0


Copyright © 2002-2004 Robert Half International. All Rights Reserved.