Package com.ibm.fhir.bulkdata.audit
Class BulkAuditLogger
- java.lang.Object
-
- com.ibm.fhir.bulkdata.audit.BulkAuditLogger
-
public class BulkAuditLogger extends Object
This class provides convenience methods for FHIR Java Batch Jobs that access and manipulate FHIR Data, thus needing to write FHIR audit log entries.
-
-
Constructor Summary
Constructors Constructor Description BulkAuditLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
logCreateOnImport(Resource newResource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for a 'create' in a bulkdata service invocation.void
logFastOnExport(String resource, String queryParm, int totalSearch, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for a 'search' in a bulkdata service invocation.void
logReadOnExport(Resource resource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for a 'read' in a bulkdata service invocation.void
logSearchOnExport(String resource, Map<String,List<String>> queryParms, int totalSearch, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for a 'search' in a bulkdata service invocation.void
logUpdateOnImport(Resource oldResource, Resource updatedResource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for an 'update' in a bulkdata service invocation.void
logUpdateOnImportSkipped(Resource resource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for an 'update' skipped in a bulkdata service invocation.void
logValidateOnImport(Resource newResource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users)
Builds an audit log entry for a 'validate' in a bulkdata service invocation.boolean
shouldLog()
-
-
-
Method Detail
-
shouldLog
public boolean shouldLog()
-
logCreateOnImport
public void logCreateOnImport(Resource newResource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for a 'create' in a bulkdata service invocation.- Parameters:
newResource
- The Resource object being created.startTime
- The start time of the create request execution.endTime
- The end time of the create request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
logValidateOnImport
public void logValidateOnImport(Resource newResource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for a 'validate' in a bulkdata service invocation.- Parameters:
newResource
- The Resource object being created.startTime
- The start time of the create request execution.endTime
- The end time of the create request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
logUpdateOnImport
public void logUpdateOnImport(Resource oldResource, Resource updatedResource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for an 'update' in a bulkdata service invocation.- Parameters:
oldResource
- The previous version of the Resource, before it was updated.updatedResource
- The updated version of the Resource.startTime
- The start time of the update request execution.endTime
- The end time of the update request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
logUpdateOnImportSkipped
public void logUpdateOnImportSkipped(Resource resource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for an 'update' skipped in a bulkdata service invocation.- Parameters:
resource
- The updated version of the Resource.startTime
- The start time of the update request execution.endTime
- The end time of the update request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
logReadOnExport
public void logReadOnExport(Resource resource, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for a 'read' in a bulkdata service invocation.- Parameters:
resource
- The Resource object being read.startTime
- The start time of the read request execution.endTime
- The end time of the read request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
logSearchOnExport
public void logSearchOnExport(String resource, Map<String,List<String>> queryParms, int totalSearch, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for a 'search' in a bulkdata service invocation.- Parameters:
resource
- the resourcequeryParms
- The query parameters passed to the search service.totalSearch
- The total retrievedstartTime
- The start time of the bundle request execution.endTime
- The end time of the bundle request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
logFastOnExport
public void logFastOnExport(String resource, String queryParm, int totalSearch, Date startTime, Date endTime, javax.ws.rs.core.Response.Status responseStatus, String location, String users) throws Exception
Builds an audit log entry for a 'search' in a bulkdata service invocation.- Parameters:
resource
- the resourcequeryParm
- The query parameter passed to the search service.totalSearch
- The total retrievedstartTime
- The start time of the bundle request execution.endTime
- The end time of the bundle request execution.responseStatus
- The response status.location
- the destination or source for the export or importusers
- the principals that initiated the request- Throws:
Exception
-
-