AuditEventMessage[] msgs = new AuditEventMessage[evts
.size()];
for (int i = 0; i < evts.size(); i++) {
IronBeeEventMessage ib = new IronBeeEventMessage();
log.debug("events[{}] = {}", i, evts.get(i));
JSONObject event = (JSONObject) evts.get(i);
log.debug(" message: {}", event);
for (String k : event.keySet()) {
log.debug(" message[{}] = {}", k,
event.get(k));
Object obj = event.get(k);
if (obj instanceof JSONArray) {
JSONArray arr = (JSONArray) obj;
String[] d = new String[arr.size()];
for (int idx = 0; idx < arr.size(); idx++) {
d[idx] = arr.get(idx)
.toString();
}
log.debug("Setting {} = {}", k, d);
ib.set(k, d);
} else {
ib.set(k, event.get(k).toString());
}
}
msgs[i] = ib;
}