// Get the Organization entries
ArrayList namePatterns = new ArrayList();
namePatterns.add("%");
BulkResponse res = bqm.findOrganizations(null, namePatterns, null, null, null, null);
// Process the results
Collection coll = res.getCollection();
if (!coll.isEmpty()) {
Iterator iter = coll.iterator();
while (iter.hasNext()) {
Organization org = (Organization)iter.next();
coll = org.getAuditTrail();
System.out.println("Events for " + org.getName().getValue() + ": " + coll.size());
Iterator aIter = coll.iterator();
while (aIter.hasNext()) {
showAuditableEvent((AuditableEvent)aIter.next());
}
}
}
// Get all the auditable events
res = bqm.getRegistryObjects(LifeCycleManager.AUDITABLE_EVENT);
if (res != null) {
coll = res.getCollection();
System.out.println("Events for current user: " + coll.size());
Iterator aIter = coll.iterator();
while (aIter.hasNext()) {
showAuditableEvent((AuditableEvent)aIter.next());
}
}