Class BaseAuditMessageBuilder<T extends BaseAuditMessageBuilder<T>>
java.lang.Object
org.openehealth.ipf.commons.audit.event.BaseAuditMessageBuilder<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
AuditMessageBuilder<T>
,Validateable
- Direct Known Subclasses:
ApplicationActivityBuilder
,AuditLogUsedBuilder
,BeginTransferringDicomInstancesBuilder
,CustomAuditMessageBuilder
,DataExportBuilder
,DataImportBuilder
,DicomInstancesAccessedBuilder
,DicomInstancesTransferredBuilder
,DicomStudyDeletedBuilder
,NetworkEntryBuilder
,OrderRecordBuilder
,PatientRecordBuilder
,ProcedureRecordBuilder
,QueryBuilder
,SecurityAlertBuilder
,UserAuthenticationBuilder
public abstract class BaseAuditMessageBuilder<T extends BaseAuditMessageBuilder<T>>
extends Object
implements AuditMessageBuilder<T>
AuditMessage builder with some protected helper methods that are called by subclasses in order to add
e.g. participants and participating objects of the audit event.
- Since:
- 3.5
- Author:
- Christian Ohr
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddActiveParticipant
(String userID, String altUserID, String userName, Boolean userIsRequestor, List<ActiveParticipantRoleId> roleIdCodes, String networkAccessPointID) Create and add an Active Participant to this audit event message but automatically determine the Network Access Point ID Type CodeaddActiveParticipant
(String userID, String altUserID, String userName, Boolean userIsRequestor, List<ActiveParticipantRoleId> roleIdCodes, String networkAccessPointID, NetworkAccessPointTypeCode networkAccessPointTypeCode, String mediaIdentifier, MediaType mediaType) Create and add an Active Participant block to this audit event messageaddActiveParticipant
(ActiveParticipantType activeParticipantType) addDestinationActiveParticipant
(String userId, String altUserId, String userName, String networkAccessPointId, boolean userIsRequestor) Adds an Active Participant representing destination participantaddParticipantObjectIdentification
(ParticipantObjectIdType objectIDTypeCode, String objectName, byte[] objectQuery, List<TypeValuePairType> objectDetails, String objectID, ParticipantObjectTypeCode objectTypeCode, ParticipantObjectTypeCodeRole objectTypeCodeRole, ParticipantObjectDataLifeCycle objectDataLifeCycle, String objectSensitivity) Create and add an Participant Object Identification block to this audit event messageaddParticipantObjectIdentification
(ParticipantObjectIdType objectIDTypeCode, String objectName, byte[] objectQuery, List<TypeValuePairType> objectDetails, String objectID, ParticipantObjectTypeCode objectTypeCode, ParticipantObjectTypeCodeRole objectTypeCodeRole, ParticipantObjectDataLifeCycle objectDataLifeCycle, String objectSensitivity, List<DicomObjectDescriptionType> dicomDescriptions) Create and add an Participant Object Identification block to this audit event messageaddPatientParticipantObject
(String patientId, String patientName, List<TypeValuePairType> details, ParticipantObjectDataLifeCycle lifecycle) Adds a Participant Object representing a patient involved in the eventaddSourceActiveParticipant
(String userId, String altUserId, String userName, String networkId, boolean isRequestor) Adds an Active Participant representing the source participantaddStudyParticipantObject
(String studyId, List<TypeValuePairType> objectDetails) Adds a Participant Object representing a study involved in the eventprotected NetworkAccessPointTypeCode
setAuditSource
(String sourceId) Sets aAuditSourceIdentificationType
for a given Audit Source IDsetAuditSource
(String sourceId, String enterpriseSiteId) Sets aAuditSourceIdentificationType
for a given Audit Source ID and Audit Source Enterprise Site IDsetAuditSource
(String sourceId, String enterpriseSiteId, AuditSource... typeCodes) Sets aAuditSourceIdentificationType
for a given Audit Source ID, Audit Source Enterprise Site ID, and a list of audit source type codessetAuditSource
(AuditContext auditContext) Sets the audit source from the audit contextsetAuditSourceIdentification
(String sourceID, String enterpriseSiteID, Collection<AuditSource> typeCodes) Create and add an Audit Source Identification to this audit event messagesetAuditSourceIdentification
(String sourceID, String enterpriseSiteID, AuditSource... typeCodes) Create and add an Audit Source Identification to this audit event messagesetAuditSourceIdentification
(AuditSourceIdentificationType auditSourceIdentificationType) setEventIdentification
(EventOutcomeIndicator outcome, String eventOutcomeDescription, EventActionCode action, EventId id, EventType type, Collection<PurposeOfUse> purposesOfUse) Create and set an Event Identification block for this audit event messagesetEventIdentification
(EventOutcomeIndicator outcome, String eventOutcomeDescription, EventActionCode action, EventId id, EventType type, PurposeOfUse... purposesOfUse) Create and set an Event Identification block for this audit event messagevoid
validate()
Validates the constructed audit message against the specification, because API does not completely prevent constructing incomplete or inconsistent messages.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openehealth.ipf.commons.audit.event.AuditMessageBuilder
getMessages, getTypeValuePair, getTypeValuePair, getTypeValuePair, getTypeValuePair, self
-
Constructor Details
-
BaseAuditMessageBuilder
public BaseAuditMessageBuilder()
-
-
Method Details
-
validate
public void validate()Description copied from interface:Validateable
Validates the constructed audit message against the specification, because API does not completely prevent constructing incomplete or inconsistent messages.- Specified by:
validate
in interfaceValidateable
-
getMessage
- Specified by:
getMessage
in interfaceAuditMessageBuilder<T extends BaseAuditMessageBuilder<T>>
- Returns:
- the AuditMessage built
-
setAuditSource
Sets aAuditSourceIdentificationType
for a given Audit Source ID- Parameters:
sourceId
- The Audit Source ID to use- Returns:
- this
-
setAuditSource
Sets aAuditSourceIdentificationType
for a given Audit Source ID and Audit Source Enterprise Site ID- Parameters:
sourceId
- The Audit Source ID to useenterpriseSiteId
- The Audit Enterprise Site ID to use- Returns:
- this
-
setAuditSource
Sets aAuditSourceIdentificationType
for a given Audit Source ID, Audit Source Enterprise Site ID, and a list of audit source type codes- Parameters:
sourceId
- The Audit Source ID to useenterpriseSiteId
- The Audit Enterprise Site ID to usetypeCodes
- The RFC 3881 Audit Source Type codes to use- Returns:
- this
-
setAuditSource
Sets the audit source from the audit context- Parameters:
auditContext
- audit context- Returns:
- this
-
setEventIdentification
public T setEventIdentification(EventOutcomeIndicator outcome, String eventOutcomeDescription, EventActionCode action, EventId id, EventType type, PurposeOfUse... purposesOfUse) Create and set an Event Identification block for this audit event message- Parameters:
outcome
- The Event Outcome Indicatoraction
- The Event Action Codeid
- The Event IDtype
- The Event Type Code- Returns:
- this
-
setEventIdentification
public T setEventIdentification(EventOutcomeIndicator outcome, String eventOutcomeDescription, EventActionCode action, EventId id, EventType type, Collection<PurposeOfUse> purposesOfUse) Create and set an Event Identification block for this audit event message- Parameters:
outcome
- The Event Outcome Indicatoraction
- The Event Action Codeid
- The Event IDtype
- The Event Type Code- Returns:
- this
-
setAuditSourceIdentification
public T setAuditSourceIdentification(String sourceID, String enterpriseSiteID, AuditSource... typeCodes) Create and add an Audit Source Identification to this audit event message- Parameters:
sourceID
- The Audit Source IDenterpriseSiteID
- The Audit Enterprise Site IDtypeCodes
- The Audit Source Type Codes- Returns:
- this
-
setAuditSourceIdentification
public T setAuditSourceIdentification(String sourceID, String enterpriseSiteID, Collection<AuditSource> typeCodes) Create and add an Audit Source Identification to this audit event message- Parameters:
sourceID
- The Audit Source IDenterpriseSiteID
- The Audit Enterprise Site IDtypeCodes
- The Audit Source Type Codes- Returns:
- this
-
setAuditSourceIdentification
-
addSourceActiveParticipant
public T addSourceActiveParticipant(String userId, String altUserId, String userName, String networkId, boolean isRequestor) Adds an Active Participant representing the source participant- Parameters:
userId
- The identity of the local user or process exporting the data. If both are known, then two active participants shall be included (both the person and the process).altUserId
- The Active Participant's Alternate UserIDuserName
- The Active Participant's UserNamenetworkId
- The Active Participant's Network Access Point IDisRequestor
- Whether the participant represents the requestor (i.e. push request)- Returns:
- this
-
addDestinationActiveParticipant
public T addDestinationActiveParticipant(String userId, String altUserId, String userName, String networkAccessPointId, boolean userIsRequestor) Adds an Active Participant representing destination participant- Parameters:
userId
- The identity of the remote user or process receiving the dataaltUserId
- The Active Participant's Alternate UserIDuserName
- The Active Participant's UserNamenetworkAccessPointId
- The Active Participant's Network Access Point IDuserIsRequestor
- Whether the destination participant represents the requestor (i.e. pull request)- Returns:
- this
-
addActiveParticipant
public T addActiveParticipant(String userID, String altUserID, String userName, Boolean userIsRequestor, List<ActiveParticipantRoleId> roleIdCodes, String networkAccessPointID) Create and add an Active Participant to this audit event message but automatically determine the Network Access Point ID Type Code- Parameters:
userID
- The Active Participant's UserIDaltUserID
- The Active Participant's Alternate UserIDuserName
- The Active Participant's UserNameuserIsRequestor
- Whether this Active Participant is a requestorroleIdCodes
- The Active Participant's Role CodesnetworkAccessPointID
- The Active Participant's Network Access Point ID (IP / Hostname)- Returns:
- this
-
addActiveParticipant
public T addActiveParticipant(String userID, String altUserID, String userName, Boolean userIsRequestor, List<ActiveParticipantRoleId> roleIdCodes, String networkAccessPointID, NetworkAccessPointTypeCode networkAccessPointTypeCode, String mediaIdentifier, MediaType mediaType) Create and add an Active Participant block to this audit event message- Parameters:
userID
- The Active Participant's UserIDaltUserID
- The Active Participant's Alternate UserIDuserName
- The Active Participant's UserNameuserIsRequestor
- Whether this Active Participant is a requestorroleIdCodes
- The Active Participant's Role CodesnetworkAccessPointID
- The Active Participant's Network Access Point ID (IP / Hostname)networkAccessPointTypeCode
- The type code for the Network Access Point ID- Returns:
- this
-
addActiveParticipant
-
addPatientParticipantObject
public T addPatientParticipantObject(String patientId, String patientName, List<TypeValuePairType> details, ParticipantObjectDataLifeCycle lifecycle) Adds a Participant Object representing a patient involved in the event- Parameters:
patientId
- Identifier of the involved patientpatientName
- name of the involved patient- Returns:
- this
-
addStudyParticipantObject
Adds a Participant Object representing a study involved in the event- Parameters:
studyId
- Identifier of the involved studyobjectDetails
- objectDetails- Returns:
- this
-
addParticipantObjectIdentification
public T addParticipantObjectIdentification(ParticipantObjectIdType objectIDTypeCode, String objectName, byte[] objectQuery, List<TypeValuePairType> objectDetails, String objectID, ParticipantObjectTypeCode objectTypeCode, ParticipantObjectTypeCodeRole objectTypeCodeRole, ParticipantObjectDataLifeCycle objectDataLifeCycle, String objectSensitivity) Create and add an Participant Object Identification block to this audit event message- Parameters:
objectIDTypeCode
- The Participant Object ID Type codeobjectName
- The Participant Object NameobjectQuery
- The Participant Object Query dataobjectDetails
- The Participant Object detailobjectID
- The Participant Object IDobjectTypeCode
- The Participant Object Type CodeobjectTypeCodeRole
- The Participant Object Type Code's ROleobjectDataLifeCycle
- The Participant Object Data Life CycleobjectSensitivity
- The Participant Object sensitivity- Returns:
- this
-
addParticipantObjectIdentification
public T addParticipantObjectIdentification(ParticipantObjectIdType objectIDTypeCode, String objectName, byte[] objectQuery, List<TypeValuePairType> objectDetails, String objectID, ParticipantObjectTypeCode objectTypeCode, ParticipantObjectTypeCodeRole objectTypeCodeRole, ParticipantObjectDataLifeCycle objectDataLifeCycle, String objectSensitivity, List<DicomObjectDescriptionType> dicomDescriptions) Create and add an Participant Object Identification block to this audit event message- Parameters:
objectIDTypeCode
- The Participant Object ID Type codeobjectName
- The Participant Object NameobjectQuery
- The Participant Object Query dataobjectDetails
- The Participant Object detailobjectID
- The Participant Object IDobjectTypeCode
- The Participant Object Type CodeobjectTypeCodeRole
- The Participant Object Type Code's ROleobjectDataLifeCycle
- The Participant Object Data Life CycleobjectSensitivity
- The Participant Object sensitivitydicomDescriptions
- The Participant Object DICOM descriptions- Returns:
- this
-
addParticipantObjectIdentification
-
getNetworkAccessPointCodeFromAddress
-