Package com.evolveum.midpoint.repo.sql
Class SqlAuditServiceImpl
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.SqlBaseService
-
- com.evolveum.midpoint.repo.sql.SqlAuditServiceImpl
-
- All Implemented Interfaces:
AuditService
public class SqlAuditServiceImpl extends SqlBaseService implements AuditService
Audit service using SQL DB as a store, also allows for searching (seesupportsRetrieval()
. This is NOT a managed bean, it is completely created bySqlAuditServiceFactory
and any of the dependencies must be dependencies of that factory to assure proper initialization.Design notes: No repo.sql.data.audit.* entities are used (stage/type enums are OK).
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.audit.api.AuditService
MAX_MESSAGE_SIZE, MAX_PROPERTY_SIZE
-
-
Constructor Summary
Constructors Constructor Description SqlAuditServiceImpl(BaseHelper baseHelper, PrismContext prismContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
applyAuditConfiguration(SystemConfigurationAuditType configuration)
Called when audit configuration is established or changed.void
audit(AuditEventRecord record, Task task)
void
cleanupAudit(CleanupPolicyType policy, OperationResult parentResult)
Clean up audit records that are older than specified.int
countObjects(@Nullable ObjectQuery query, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull OperationResult parentResult)
Returns the number of audit events that match the specified query.long
countObjects(String query, Map<String,Object> params)
List<AuditEventRecord>
listRecords(String query, Map<String,Object> params, OperationResult parentResult)
Deprecated.void
reindexEntry(AuditEventRecord record)
Reindex audit record - currently does nothing.@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.SqlRepositoryConfiguration
sqlConfiguration()
boolean
supportsRetrieval()
Returns true if retrieval of objects from the audit trail is supported.-
Methods inherited from class com.evolveum.midpoint.repo.sql.SqlBaseService
destroy, getPerformanceMonitor
-
-
-
-
Constructor Detail
-
SqlAuditServiceImpl
public SqlAuditServiceImpl(BaseHelper baseHelper, PrismContext prismContext)
-
-
Method Detail
-
sqlConfiguration
public SqlRepositoryConfiguration sqlConfiguration()
- Specified by:
sqlConfiguration
in classSqlBaseService
-
audit
public void audit(AuditEventRecord record, Task task)
- Specified by:
audit
in interfaceAuditService
-
listRecords
@Deprecated public List<AuditEventRecord> listRecords(String query, Map<String,Object> params, OperationResult parentResult)
Deprecated.- Specified by:
listRecords
in interfaceAuditService
-
reindexEntry
public void reindexEntry(AuditEventRecord record)
Description copied from interface:AuditService
Reindex audit record - currently does nothing. Previously it effectively created missing changed items detail entities, which is less and less useful nowadays. TODO: In the future we may consider reindexing of new columns, but the functionality is currently not fully specified.- Specified by:
reindexEntry
in interfaceAuditService
-
cleanupAudit
public void cleanupAudit(CleanupPolicyType policy, OperationResult parentResult)
Description copied from interface:AuditService
Clean up audit records that are older than specified.- Specified by:
cleanupAudit
in interfaceAuditService
- Parameters:
policy
- Records will be deleted base on this policy.
-
countObjects
public long countObjects(String query, Map<String,Object> params)
- Specified by:
countObjects
in interfaceAuditService
-
supportsRetrieval
public boolean supportsRetrieval()
Description copied from interface:AuditService
Returns true if retrieval of objects from the audit trail is supported. This applies to listRecords, countObjects, reconstructObject and similar operations.- Specified by:
supportsRetrieval
in interfaceAuditService
-
applyAuditConfiguration
public void applyAuditConfiguration(SystemConfigurationAuditType configuration)
Description copied from interface:AuditService
Called when audit configuration is established or changed.- Specified by:
applyAuditConfiguration
in interfaceAuditService
-
countObjects
public int countObjects(@Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult)
Description copied from interface:AuditService
Returns 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:
countObjects
in 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:AuditService
Returns 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:
searchObjects
in 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
-
-