This example program will create a new audit log entry, and will then perform a retrieval of audit log records according to some criteria. There are no additional program parameters for this example other than those specified in the LoginExample program.
For example:
C:\Enterworks\EPX\examples\api\run.bat AuditExample
-server EPX_somehost -user system -password system
public static void main(String args[]) throws Exception
{
try
{
String serverUID = null;
String user = "system";
String password = "system";
for ( int i=0 ; i < args.length; i++)
{
String arg = args[i];
if (arg.startsWith("-"))
{
if (arg.substring(1).equals("server"))
serverUID = args[++i];
else if (arg.substring(1).equals("user"))
user = args[++i];
else if (arg.substring(1).equals("password"))
password = args[++i];
}
}
// create a new work item purge example and login
AuditExample auditExample;
auditExample = new AuditExample(serverUID,user,password);
auditExample.login();
// create a custom audit log entry
auditExample.createAuditEntry();
// perform a query on existing audit log entries
auditExample.queryAuditLog();
auditExample.logout();
}
catch( Exception e )
{
System.err.println
( "AuditExample.main(exception):" +e );
e.printStackTrace();
}