public static AuditMessage createMessage( EventIdentificationBuilder eventIdentificationBuilder, ActiveParticipantBuilder[] activeParticipantBuilders, ParticipantObjectIdentificationBuilder... participantObjectIdentificationBuilders) { AuditMessage msg = new AuditMessage(); msg.setEventIdentification(toEventIdentification(eventIdentificationBuilder)); for (ActiveParticipantBuilder activeParticipantBuilder : activeParticipantBuilders) if (activeParticipantBuilder != null) msg.getActiveParticipant().add(toActiveParticipant(activeParticipantBuilder)); for (ParticipantObjectIdentificationBuilder participantObjectIdentificationBuilder : participantObjectIdentificationBuilders) msg.getParticipantObjectIdentification().add(toParticipantObjectIdentification(participantObjectIdentificationBuilder)); return msg; }
public boolean match(AuditMessage msg) { if (!match(msg.getEventIdentification())) return false; if (!match(msg.getActiveParticipant())) return false; return true; }
private static void emitAudit(AuditLogger auditLogger, AuditMessage auditMsg) { auditMsg.getAuditSourceIdentification().add(auditLogger.createAuditSourceIdentification()); try { AuditLogger.SendStatus write = auditLogger.write(auditLogger.timeStamp(), auditMsg); System.out.println("log send status: " + write); } catch (Exception e) { LOG.warn("Failed to emit audit message", e); } }
/** * Create an instance of {@link AuditMessage } * */ public AuditMessage createAuditMessage() { return new AuditMessage(); }
private Severity severityOf(AuditMessage msg) { String eventOutcomeIndicator = msg.getEventIdentification() .getEventOutcomeIndicator(); if (eventOutcomeIndicator.length() == 1) switch(eventOutcomeIndicator.charAt(0)) { case '0': return successSeverity; case '4': return minorFailureSeverity; case '8': return seriousFailureSeverity; } else if (eventOutcomeIndicator.equals("12")) return majorFailureSeverity; throw new IllegalArgumentException( "Illegal eventOutcomeIndicator: " + eventOutcomeIndicator); }
public boolean match(AuditMessage msg) { if (!match(msg.getEventIdentification())) return false; if (!match(msg.getActiveParticipant())) return false; return true; }
private static void emitAudit(AuditLogger auditLogger, AuditMessage auditMsg) { auditMsg.getAuditSourceIdentification().add(auditLogger.createAuditSourceIdentification()); try { AuditLogger.SendStatus write = auditLogger.write(auditLogger.timeStamp(), auditMsg); System.out.println("log send status: " + write); } catch (Exception e) { LOG.warn("Failed to emit audit message", e); } }
/** * Create an instance of {@link AuditMessage } * */ public AuditMessage createAuditMessage() { return new AuditMessage(); }
private Severity severityOf(AuditMessage msg) { String eventOutcomeIndicator = msg.getEventIdentification() .getEventOutcomeIndicator(); if (eventOutcomeIndicator.length() == 1) switch(eventOutcomeIndicator.charAt(0)) { case '0': return successSeverity; case '4': return minorFailureSeverity; case '8': return seriousFailureSeverity; } else if (eventOutcomeIndicator.equals("12")) return majorFailureSeverity; throw new IllegalArgumentException( "Illegal eventOutcomeIndicator: " + eventOutcomeIndicator); }
public static AuditMessage createMessage( EventIdentificationBuilder eventIdentificationBuilder, ActiveParticipantBuilder[] activeParticipantBuilders, ParticipantObjectIdentificationBuilder... participantObjectIdentificationBuilders) { AuditMessage msg = new AuditMessage(); msg.setEventIdentification(toEventIdentification(eventIdentificationBuilder)); for (ActiveParticipantBuilder activeParticipantBuilder : activeParticipantBuilders) if (activeParticipantBuilder != null) msg.getActiveParticipant().add(toActiveParticipant(activeParticipantBuilder)); for (ParticipantObjectIdentificationBuilder participantObjectIdentificationBuilder : participantObjectIdentificationBuilders) msg.getParticipantObjectIdentification().add(toParticipantObjectIdentification(participantObjectIdentificationBuilder)); return msg; }
private static void emitAudit( AuditLogger log, EventIdentificationBuilder eventID, ActiveParticipantBuilder[] activeParticipants) { AuditMessage msg = AuditMessages.createMessage(eventID, activeParticipants); msg.getAuditSourceIdentification().add(log.createAuditSourceIdentification()); try { AuditLogger.SendStatus write = log.write(log.timeStamp(), msg); System.out.println("log send status: " + write); } catch (Exception e) { LOG.warn("Failed to emit audit message", e); } }
private static void emitAudit( AuditLogger log, EventIdentificationBuilder eventID, ActiveParticipantBuilder[] activeParticipants) { AuditMessage msg = AuditMessages.createMessage(eventID, activeParticipants); msg.getAuditSourceIdentification().add(log.createAuditSourceIdentification()); try { AuditLogger.SendStatus write = log.write(log.timeStamp(), msg); System.out.println("log send status: " + write); } catch (Exception e) { LOG.warn("Failed to emit audit message", e); } }