protected Content activeParticipant(ActiveParticipantType activeParticipant) { Element element = new Element("ActiveParticipant"); element.setAttribute("UserID", activeParticipant.getUserID()); conditionallyAddAttribute(element, "AlternativeUserID", activeParticipant.getAlternativeUserID()); conditionallyAddAttribute(element, "UserName", activeParticipant.getUserName()); element.setAttribute("UserIsRequestor", Boolean.toString(activeParticipant.isUserIsRequestor())); conditionallyAddAttribute(element, "NetworkAccessPointID", activeParticipant.getNetworkAccessPointID()); conditionallyAddAttribute(element, "NetworkAccessPointTypeCode", activeParticipant.getNetworkAccessPointTypeCode()); if (activeParticipant.getMediaType() != null) { element.addContent( new Element("MediaIdentifier") .addContent(codedValueType("MediaType", activeParticipant.getMediaType()))); } if (activeParticipant.getRoleIDCodes() != null) { activeParticipant.getRoleIDCodes().stream() .map(roleIdCode -> codedValueType("RoleIDCode", roleIdCode)) .forEach(element::addContent); } return element; }
protected AuditEvent.AuditEventAgentComponent activeParticipantToAgent(ActiveParticipantType ap) { AuditEvent.AuditEventAgentComponent agent = new AuditEvent.AuditEventAgentComponent() .setUserId(new Identifier().setValue(ap.getUserID())) .setAltId(ap.getAlternativeUserID()) .setName(ap.getUserName()) .setRequestor(ap.isUserIsRequestor()) .setMedia(codedValueTypeToCoding(ap.getMediaType())) .setNetwork(new AuditEvent.AuditEventAgentNetworkComponent() .setAddress(ap.getNetworkAccessPointID()) .setType(auditEventNetworkType(ap.getNetworkAccessPointTypeCode()))); ap.getRoleIDCodes().forEach(roleID -> agent.addPolicy(roleID.getCode())); return agent; }
.filter(apt -> apt.getUserName() != null) .findFirst().orElse(null);
protected AuditEvent.AuditEventAgentComponent activeParticipantToAgent(ActiveParticipantType ap) { AuditEvent.AuditEventAgentComponent agent = new AuditEvent.AuditEventAgentComponent() .setWho(new Reference().setIdentifier(new Identifier().setValue(ap.getUserID()))) .setAltId(ap.getAlternativeUserID()) .setName(ap.getUserName()) .setRequestor(ap.isUserIsRequestor()) .setMedia(codedValueTypeToCoding(ap.getMediaType())) .setNetwork(new AuditEvent.AuditEventAgentNetworkComponent() .setAddress(ap.getNetworkAccessPointID()) .setType(auditEventNetworkType(ap.getNetworkAccessPointTypeCode()))); ap.getRoleIDCodes().forEach(roleID -> agent.addPolicy(roleID.getCode())); return agent; }