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 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 interface Validateable
    • getMessage

      public AuditMessage getMessage()
      Specified by:
      getMessage in interface AuditMessageBuilder<T extends BaseAuditMessageBuilder<T>>
      Returns:
      the AuditMessage built
    • setAuditSource

      public T setAuditSource(String sourceId)
      Sets a AuditSourceIdentificationType for a given Audit Source ID
      Parameters:
      sourceId - The Audit Source ID to use
      Returns:
      this
    • setAuditSource

      public T setAuditSource(String sourceId, String enterpriseSiteId)
      Sets a AuditSourceIdentificationType for a given Audit Source ID and Audit Source Enterprise Site ID
      Parameters:
      sourceId - The Audit Source ID to use
      enterpriseSiteId - The Audit Enterprise Site ID to use
      Returns:
      this
    • setAuditSource

      public T setAuditSource(String sourceId, String enterpriseSiteId, AuditSource... typeCodes)
      Sets a AuditSourceIdentificationType 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 use
      enterpriseSiteId - The Audit Enterprise Site ID to use
      typeCodes - The RFC 3881 Audit Source Type codes to use
      Returns:
      this
    • setAuditSource

      public T setAuditSource(AuditContext auditContext)
      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 Indicator
      action - The Event Action Code
      id - The Event ID
      type - 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 Indicator
      action - The Event Action Code
      id - The Event ID
      type - 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 ID
      enterpriseSiteID - The Audit Enterprise Site ID
      typeCodes - 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 ID
      enterpriseSiteID - The Audit Enterprise Site ID
      typeCodes - The Audit Source Type Codes
      Returns:
      this
    • setAuditSourceIdentification

      public T setAuditSourceIdentification(AuditSourceIdentificationType auditSourceIdentificationType)
    • 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 UserID
      userName - The Active Participant's UserName
      networkId - The Active Participant's Network Access Point ID
      isRequestor - 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 data
      altUserId - The Active Participant's Alternate UserID
      userName - The Active Participant's UserName
      networkAccessPointId - The Active Participant's Network Access Point ID
      userIsRequestor - 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 UserID
      altUserID - The Active Participant's Alternate UserID
      userName - The Active Participant's UserName
      userIsRequestor - Whether this Active Participant is a requestor
      roleIdCodes - The Active Participant's Role Codes
      networkAccessPointID - 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 UserID
      altUserID - The Active Participant's Alternate UserID
      userName - The Active Participant's UserName
      userIsRequestor - Whether this Active Participant is a requestor
      roleIdCodes - The Active Participant's Role Codes
      networkAccessPointID - The Active Participant's Network Access Point ID (IP / Hostname)
      networkAccessPointTypeCode - The type code for the Network Access Point ID
      Returns:
      this
    • addActiveParticipant

      public T addActiveParticipant(ActiveParticipantType activeParticipantType)
    • 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 patient
      patientName - name of the involved patient
      Returns:
      this
    • addStudyParticipantObject

      public T addStudyParticipantObject(String studyId, List<TypeValuePairType> objectDetails)
      Adds a Participant Object representing a study involved in the event
      Parameters:
      studyId - Identifier of the involved study
      objectDetails - 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 code
      objectName - The Participant Object Name
      objectQuery - The Participant Object Query data
      objectDetails - The Participant Object detail
      objectID - The Participant Object ID
      objectTypeCode - The Participant Object Type Code
      objectTypeCodeRole - The Participant Object Type Code's ROle
      objectDataLifeCycle - The Participant Object Data Life Cycle
      objectSensitivity - 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 code
      objectName - The Participant Object Name
      objectQuery - The Participant Object Query data
      objectDetails - The Participant Object detail
      objectID - The Participant Object ID
      objectTypeCode - The Participant Object Type Code
      objectTypeCodeRole - The Participant Object Type Code's ROle
      objectDataLifeCycle - The Participant Object Data Life Cycle
      objectSensitivity - The Participant Object sensitivity
      dicomDescriptions - The Participant Object DICOM descriptions
      Returns:
      this
    • addParticipantObjectIdentification

      public T addParticipantObjectIdentification(ParticipantObjectIdentificationType poit)
    • getNetworkAccessPointCodeFromAddress

      protected NetworkAccessPointTypeCode getNetworkAccessPointCodeFromAddress(String address)