The FileAuditStore example code is shown below:
public class FileAuditStore implements AuditStore
{
/** default constructor */
public FileAuditStore()
{
}
/**
*method to implement be provides, this will allow custom audit
* mechanism to perform its task of auditing
*
* @param sessionProfile - a handle to the session profile of
* the component calling the external auditing class
* @param auditVO - the audit value object that would otherwise
* be persisted by the product
* @throws BaseException
*/
public void addAuditRecord(SessionProfile sessionProfile,
AuditVO auditVO) throws BaseException
{
try
{
PrintWriter pw =
new PrintWriter(new FileWriter("fileaudit.log",true));
pw.println(auditVO.toXML());
pw.close();
}
catch ( Exception e )
{
AuditManager.error(
"file.audit","addAuditRecord exception",e);
}
}
}
The AuditStore interface is defined as follows:
public interface AuditStore
{
/**
* method to implement be provides, this will allow custom
* audit mechanism to perform its task of auditing
*
* @param sessionProfile - a handle to the session profile
* of the component calling the external auditing class
* @param auditVO - the audit value object that would
* otherwise be persisted by the product
* @throws BaseException
*/
public void addAuditRecord(
SessionProfile sessionProfile,AuditVO auditVO)
throws BaseException;
}