Class SqaleAuditService
- java.lang.Object
-
- com.evolveum.midpoint.repo.sqale.SqaleServiceBase
-
- com.evolveum.midpoint.repo.sqale.audit.SqaleAuditService
-
- All Implemented Interfaces:
AuditService
public class SqaleAuditService extends SqaleServiceBase implements AuditService
Audit service using SQL DB as a store, also allows for searching (seesupportsRetrieval()).
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.repo.sqale.SqaleServiceBase
logger, opNamePrefix, performanceMonitor, REPOSITORY_IMPL_NAME, sqlPerformanceMonitorsCollection, sqlRepoContext
-
Fields inherited from interface com.evolveum.midpoint.audit.api.AuditService
MAX_MESSAGE_SIZE, MAX_PROPERTY_SIZE, OP_AUDIT, OP_CLEANUP_AUDIT_MAX_AGE, OP_CLEANUP_AUDIT_MAX_RECORDS, OP_COUNT_OBJECTS, OP_SEARCH_OBJECTS, OP_SEARCH_OBJECTS_ITERATIVE, OP_SEARCH_OBJECTS_ITERATIVE_PAGE
-
-
Constructor Summary
Constructors Constructor Description SqaleAuditService(SqaleRepoContext sqlRepoContext, SqlPerformanceMonitorsCollection sqlPerformanceMonitorsCollection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyAuditConfiguration(@Nullable SystemConfigurationAuditType configuration)Called when audit configuration is established or changed.voidaudit(AuditEventRecord record, Task task, OperationResult parentResult)Emits audit event record, e.g.voidaudit(AuditEventRecordType record, OperationResult parentResult)Emits audit event record provided as a generated Prism bean.voidcleanupAudit(CleanupPolicyType policy, OperationResult parentResult)Clean up audit records that are older than specified.intcountObjects(@Nullable ObjectQuery query, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull OperationResult parentResult)Returns the number of audit events that match the specified query.protected longregisterOperationStart(String kind)@NotNull SearchResultList<AuditEventRecordType>searchObjects(@Nullable ObjectQuery query, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull OperationResult parentResult)Returns the result list of audit events that match the specified query.SearchResultMetadatasearchObjectsIterative(@Nullable ObjectQuery query, @NotNull AuditResultHandler handler, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull OperationResult parentResult)Executes iterative search using the provided `handler` to process each object.booleansupportsRetrieval()Returns true if retrieval of objects from the audit trail is supported.-
Methods inherited from class com.evolveum.midpoint.repo.sqale.SqaleServiceBase
destroy, getPerformanceMonitor, getRepositoryDiag, handledGeneralException, isNoneQuery, logSearchInputParameters, prismContext, recordFatalError, registerOperationFinish, registerOperationStart, registerOperationStart, repositoryConfiguration, simplifyQuery, sqlRepoContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.audit.api.AuditService
getRepositoryDiag
-
-
-
-
Constructor Detail
-
SqaleAuditService
public SqaleAuditService(SqaleRepoContext sqlRepoContext, SqlPerformanceMonitorsCollection sqlPerformanceMonitorsCollection)
-
-
Method Detail
-
audit
public void audit(AuditEventRecord record, Task task, OperationResult parentResult)
Description copied from interface:AuditServiceEmits audit event record, e.g. writes it in the database or logs it to a file. If audit is recorded to the repository,AuditEventRecord.repoIdwill be set, it should not be provided by the client code except for import reasons. This is high-level audit method that also tries to complete the audit event record, e.g. filling in missing task information, current timestamp if none is provided, etc.- Specified by:
auditin interfaceAuditService
-
audit
public void audit(AuditEventRecordType record, OperationResult parentResult)
Description copied from interface:AuditServiceEmits audit event record provided as a generated Prism bean. Used for audit import functionality. This is a low-level audit method that does not process provided record at all.- Specified by:
auditin interfaceAuditService
-
cleanupAudit
public void cleanupAudit(CleanupPolicyType policy, OperationResult parentResult)
Description copied from interface:AuditServiceClean up audit records that are older than specified.- Specified by:
cleanupAuditin interfaceAuditService- Parameters:
policy- Records will be deleted base on this policy.
-
supportsRetrieval
public boolean supportsRetrieval()
Description copied from interface:AuditServiceReturns true if retrieval of objects from the audit trail is supported. This applies to listRecords, countObjects, reconstructObject and similar operations.- Specified by:
supportsRetrievalin interfaceAuditService
-
applyAuditConfiguration
public void applyAuditConfiguration(@Nullable @Nullable SystemConfigurationAuditType configuration)Description copied from interface:AuditServiceCalled when audit configuration is established or changed. Setting to null means to use default values for the settings.- Specified by:
applyAuditConfigurationin interfaceAuditService
-
countObjects
public int countObjects(@Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult)Description copied from interface:AuditServiceReturns the number of audit events that match the specified query. If query is null or no filter in query is specified, count of all audit events is returned. Ignores any paging and ordering from the query.- Specified by:
countObjectsin interfaceAuditService- Parameters:
query- search queryparentResult- parent operation result (in/out)- Returns:
- count of audit events of specified type that match the search criteria
-
searchObjects
@NotNull public @NotNull SearchResultList<AuditEventRecordType> searchObjects(@Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult) throws SchemaException
Description copied from interface:AuditServiceReturns the result list of audit events that match the specified query. If query is null or no filter in query is specified, all audit events are returned, subject to paging or internal sanity limit.- Specified by:
searchObjectsin interfaceAuditService- Parameters:
query- search queryparentResult- parent operation result (in/out)- Returns:
- list of audit events of specified type that match the search criteria
- Throws:
SchemaException
-
searchObjectsIterative
public SearchResultMetadata searchObjectsIterative(@Nullable @Nullable ObjectQuery query, @NotNull @NotNull AuditResultHandler handler, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult) throws SchemaException
Description copied from interface:AuditServiceExecutes iterative search using the provided `handler` to process each object.- Specified by:
searchObjectsIterativein interfaceAuditService- Parameters:
query- search queryhandler- result handleroptions- get options to use for the searchparentResult- parent OperationResult (in/out)- Returns:
- summary information about the search result
- Throws:
SchemaException
-
registerOperationStart
protected long registerOperationStart(String kind)
-
-