public static AuditMessages.UserIDTypeCode userIDTypeCode(String userID) { return AuditMessages.isIP(userID) ? AuditMessages.UserIDTypeCode.NodeID : AuditMessages.UserIDTypeCode.PersonID; } }
public static String toXML(AuditMessage message, boolean format) throws IOException { return toXML(message, format, "UTF-8", SCHEMA_URI); }
private static ParticipantObjectDescription toParticipantObjectDescription(ParticipantObjectDescriptionBuilder poDesc) { ParticipantObjectDescription pod = new ParticipantObjectDescription(); for (String acc : poDesc.acc) pod.getAccession().add(AuditMessages.createAccession(acc)); for (String mpps : poDesc.mpps) pod.getMPPS().add(AuditMessages.createMPPS(mpps)); for (SOPClass sopC : poDesc.sopC) pod.getSOPClass().add(sopC); pod.setEncrypted(poDesc.encrypted); pod.setAnonymized(poDesc.anonymized); if (poDesc.pocsStudyUIDs.length > 1) pod.setParticipantObjectContainsStudy( AuditMessages.createParticipantObjectContainsStudy( AuditMessages.createStudyIDs(poDesc.pocsStudyUIDs))); return pod; }
public static void toXML(AuditMessage message, OutputStream os, boolean format, String encoding, String schemaURI) throws IOException { try { Marshaller m = jc().createMarshaller(); if (format) m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); if (schemaURI != null) m.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, schemaURI); if (encoding != null) m.setProperty(Marshaller.JAXB_ENCODING, encoding); m.marshal(of.createAuditMessage(message), os ); } catch( JAXBException jbe ){ if (jbe.getLinkedException() instanceof IOException) throw (IOException) jbe.getLinkedException(); throw new IllegalStateException(jbe); } }
AuditMessages.ParticipantObjectTypeCode.SystemObject, null) .detail(AuditMessages.createParticipantObjectDetail( "Alert Description", "Representation: " + info.getField(AuthInfo.REPRESENTATION) + "\nResourcePath: " + info.getField(AuthInfo.RESOURCE_PATH))) .build(); return AuditMessages.createMessage(eventIdentification, activeParticipants, poi);
public ActiveParticipant createActiveParticipant( boolean requestor, RoleIDCode... roleIDs) { Collection<String> aets = device.getApplicationAETitles(); return createActiveParticipant(requestor, processID(), AuditMessages.alternativeUserIDForAETitle( aets.toArray(new String[aets.size()])), applicationName(), ReverseDNS.hostNameOf(localHost()), roleIDs); }
public static SOPClass createSOPClass(HashSet<String> instances, String uid, Integer numI) { SOPClass sopClass = new SOPClass(); sopClass.setUID(uid); sopClass.setNumberOfInstances(numI); if (null != instances) for (String i : instances) sopClass.getInstance().add(createInstance(i)); return sopClass; }
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 ParticipantObjectDescription toParticipantObjectDescription(ParticipantObjectDescriptionBuilder poDesc) { ParticipantObjectDescription pod = new ParticipantObjectDescription(); for (String acc : poDesc.acc) pod.getAccession().add(AuditMessages.createAccession(acc)); for (String mpps : poDesc.mpps) pod.getMPPS().add(AuditMessages.createMPPS(mpps)); for (SOPClass sopC : poDesc.sopC) pod.getSOPClass().add(sopC); pod.setEncrypted(poDesc.encrypted); pod.setAnonymized(poDesc.anonymized); if (poDesc.pocsStudyUIDs.length > 1) pod.setParticipantObjectContainsStudy( AuditMessages.createParticipantObjectContainsStudy( AuditMessages.createStudyIDs(poDesc.pocsStudyUIDs))); return pod; }
public static void toXML(AuditMessage message, OutputStream os, boolean format, String encoding, String schemaURI) throws IOException { try { Marshaller m = jc().createMarshaller(); if (format) m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); if (schemaURI != null) m.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, schemaURI); if (encoding != null) m.setProperty(Marshaller.JAXB_ENCODING, encoding); m.marshal(of.createAuditMessage(message), os ); } catch( JAXBException jbe ){ if (jbe.getLinkedException() instanceof IOException) throw (IOException) jbe.getLinkedException(); throw new IllegalStateException(jbe); } }
AuditMessages.ParticipantObjectTypeCode.SystemObject, null) .detail(AuditMessages.createParticipantObjectDetail( "Alert Description", "Representation: " + info.getField(AuthInfo.REPRESENTATION) + "\nResourcePath: " + info.getField(AuthInfo.RESOURCE_PATH))) .build(); return AuditMessages.createMessage(eventIdentification, activeParticipants, poi);
public ActiveParticipant createActiveParticipant( boolean requestor, RoleIDCode... roleIDs) { Collection<String> aets = device.getApplicationAETitles(); return createActiveParticipant(requestor, processID(), AuditMessages.alternativeUserIDForAETitle( aets.toArray(new String[aets.size()])), applicationName(), ReverseDNS.hostNameOf(localHost()), roleIDs); }
public static SOPClass createSOPClass(HashSet<String> instances, String uid, Integer numI) { SOPClass sopClass = new SOPClass(); sopClass.setUID(uid); sopClass.setNumberOfInstances(numI); if (null != instances) for (String i : instances) sopClass.getInstance().add(createInstance(i)); return sopClass; }
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); } }
public static String toXML(AuditMessage message, boolean format, String encoding) throws IOException { return toXML(message, format, encoding, SCHEMA_URI); }
public Builder(String userID, String napID) { this.userID = userID; this.napID = napID; this.napTypeCode = napID != null ? AuditMessages.isIP(napID) ? AuditMessages.NetworkAccessPointTypeCode.IPAddress : AuditMessages.NetworkAccessPointTypeCode.MachineName : null; }
public static void toXML(AuditMessage message, OutputStream os) throws IOException { toXML(message, os, false, "UTF-8", SCHEMA_URI); }
public static AuditMessages.UserIDTypeCode userIDTypeCode(String userID) { return AuditMessages.isIP(userID) ? AuditMessages.UserIDTypeCode.NodeID : AuditMessages.UserIDTypeCode.PersonID; } }
public static String toXML(AuditMessage message) throws IOException { return toXML(message, false, "UTF-8", SCHEMA_URI); }
public Builder(String userID, String napID) { this.userID = userID; this.napID = napID; this.napTypeCode = napID != null ? AuditMessages.isIP(napID) ? AuditMessages.NetworkAccessPointTypeCode.IPAddress : AuditMessages.NetworkAccessPointTypeCode.MachineName : null; }