Class AbstractFhirAuditStrategy<AuditDatasetType extends FhirAuditDataset, O extends IBaseOperationOutcome>
java.lang.Object
org.openehealth.ipf.commons.ihe.core.atna.AuditStrategySupport<AuditDatasetType>
org.openehealth.ipf.commons.ihe.fhir.audit.AbstractFhirAuditStrategy<AuditDatasetType, O>
- All Implemented Interfaces:
AuditStrategy<AuditDatasetType>
- Direct Known Subclasses:
FhirAuditStrategy
public abstract class AbstractFhirAuditStrategy<AuditDatasetType extends FhirAuditDataset, O extends IBaseOperationOutcome>
extends AuditStrategySupport<AuditDatasetType>
Generic Audit Strategy for FHIR transactions
- Since:
- 3.2
- Author:
- Christian Ohr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAudit(AuditContext auditContext, AuditDatasetType auditDataset) Builds the audit message and hands it to the audit context.enrichAuditDatasetFromRequest(AuditDatasetType auditDataset, Object request, Map<String, Object> parameters) Enriches the given audit dataset with transaction-specific contents of the request message and Camel exchange.booleanenrichAuditDatasetFromResponse(AuditDatasetType auditDataset, Object response, AuditContext auditContext) Enriches the given audit dataset with transaction-specific contents of the response message.abstract EventOutcomeIndicatorgetEventOutcomeCodeFromOperationOutcome(FhirContext fhirContext, O response) Operation Outcomes are sets of error, warning and information messages that provide detailed information about the outcome of some attempted system operation.protected EventOutcomeIndicatorgetEventOutcomeCodeFromResource(AuditDatasetType auditDataset, IBaseResource resource) A resource is returned from the business logic.getEventOutcomeDescription(AuditDatasetType auditDataset, Object response) Determines which event outcome description corresponds with the provided response POJOabstract StringgetEventOutcomeDescriptionFromOperationOutcome(FhirContext fhirContext, O response) getEventOutcomeIndicator(AuditDatasetType auditDataset, Object response) Determines which event outcome corresponds with the provided response POJOMethods inherited from class AuditStrategySupport
isAuditableResponse, isServerSide, makeAuditMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AuditStrategy
createAuditDataset, enrichAuditDatasetFromResponse
-
Constructor Details
-
AbstractFhirAuditStrategy
protected AbstractFhirAuditStrategy(boolean serverSide)
-
-
Method Details
-
doAudit
Description copied from class:AuditStrategySupportBuilds the audit message and hands it to the audit context.Nothing that goes wrong on the way out of here reaches the caller. Auditing runs in the
finallyof the interceptors, where a thrown exception would replace the outcome of the transaction being audited -- so a malformed access token, a participant the builder cannot make sense of, or any other defect in assembling the record would turn a served request into a server error. Failures go to the configuredAuditExceptionHandlerinstead, the same place a failed serialization or delivery ends up; deployments that want auditing to be fatal can plug a rethrowing handler.- Specified by:
doAuditin interfaceAuditStrategy<AuditDatasetType extends FhirAuditDataset>- Overrides:
doAuditin classAuditStrategySupport<AuditDatasetType extends FhirAuditDataset>- Parameters:
auditContext- audit contextauditDataset- audit dataset
-
enrichAuditDatasetFromRequest
public AuditDatasetType enrichAuditDatasetFromRequest(AuditDatasetType auditDataset, Object request, Map<String, Object> parameters) Description copied from interface:AuditStrategyEnriches the given audit dataset with transaction-specific contents of the request message and Camel exchange.- Specified by:
enrichAuditDatasetFromRequestin interfaceAuditStrategy<AuditDatasetType extends FhirAuditDataset>- Overrides:
enrichAuditDatasetFromRequestin classAuditStrategySupport<AuditDatasetType extends FhirAuditDataset>- Parameters:
auditDataset- audit dataset to be enriched.request-Objectrepresenting the request.parameters- additional parameters
-
enrichAuditDatasetFromResponse
public boolean enrichAuditDatasetFromResponse(AuditDatasetType auditDataset, Object response, AuditContext auditContext) Description copied from interface:AuditStrategyEnriches the given audit dataset with transaction-specific contents of the response message.- Specified by:
enrichAuditDatasetFromResponsein interfaceAuditStrategy<AuditDatasetType extends FhirAuditDataset>- Overrides:
enrichAuditDatasetFromResponsein classAuditStrategySupport<AuditDatasetType extends FhirAuditDataset>- Parameters:
auditDataset- audit dataset to be enriched.response-Objectrepresenting the responded resource.auditContext- audit context, if relevant- Returns:
- true if response indicates success, false otherwise
-
getEventOutcomeIndicator
public EventOutcomeIndicator getEventOutcomeIndicator(AuditDatasetType auditDataset, Object response) Description copied from interface:AuditStrategyDetermines which event outcome corresponds with the provided response POJO- Parameters:
auditDataset- Audit datasetresponse- POJO- Returns:
- event outcome code
-
getEventOutcomeCodeFromResource
protected EventOutcomeIndicator getEventOutcomeCodeFromResource(AuditDatasetType auditDataset, IBaseResource resource) A resource is returned from the business logic. This may usually success unless it's OperationOutcome- Parameters:
resource- FHIR resource- Returns:
- event outcome code
-
getEventOutcomeDescription
Description copied from interface:AuditStrategyDetermines which event outcome description corresponds with the provided response POJO- Parameters:
auditDataset- Audit datasetresponse- POJO- Returns:
- event outcome description
-
getEventOutcomeCodeFromOperationOutcome
public abstract EventOutcomeIndicator getEventOutcomeCodeFromOperationOutcome(FhirContext fhirContext, O response) Operation Outcomes are sets of error, warning and information messages that provide detailed information about the outcome of some attempted system operation. They are provided as a direct system response, or component of one, where they provide information about the outcome of the operation.- Parameters:
response-IBaseOperationOutcometo be analyzed- Returns:
- ATNA outcome code
-
getEventOutcomeDescriptionFromOperationOutcome
public abstract String getEventOutcomeDescriptionFromOperationOutcome(FhirContext fhirContext, O response)
-