Package com.evolveum.midpoint.init
Class AuditServiceProxy
- java.lang.Object
-
- com.evolveum.midpoint.init.AuditServiceProxy
-
- All Implemented Interfaces:
AuditService
,AuditServiceRegistry
public class AuditServiceProxy extends Object implements AuditService, AuditServiceRegistry
- Author:
- lazyman
-
-
Field Summary
-
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 AuditServiceProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyAuditConfiguration(SystemConfigurationAuditType configuration)
Called when audit configuration is established or changed.void
audit(AuditEventRecord record, Task task, OperationResult result)
Emits audit event record, e.g.void
audit(AuditEventRecordType record, OperationResult result)
Emits audit event record provided as a generated Prism bean.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.<T extends AuditService>
TgetImplementation(Class<T> implementationType)
Support public (but non-API) method to obtain concrete implementation of audit service.@NotNull RepositoryDiag
getRepositoryDiag()
void
registerService(AuditService service)
@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.@NotNull SearchResultMetadata
searchObjectsIterative(@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.boolean
supportsRetrieval()
Returns true if retrieval of objects from the audit trail is supported.void
unregisterService(AuditService service)
-
-
-
Method Detail
-
audit
public void audit(AuditEventRecord record, Task task, OperationResult result)
Description copied from interface:AuditService
Emits audit event record, e.g. writes it in the database or logs it to a file. If audit is recorded to the repository,AuditEventRecord.repoId
will be set, any provided ID is ignored. 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:
audit
in interfaceAuditService
-
audit
public void audit(AuditEventRecordType record, OperationResult result)
Description copied from interface:AuditService
Emits 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:
audit
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.
-
registerService
public void registerService(AuditService service)
- Specified by:
registerService
in interfaceAuditServiceRegistry
-
unregisterService
public void unregisterService(AuditService service)
- Specified by:
unregisterService
in interfaceAuditServiceRegistry
-
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. Setting to null means to use default values for the settings.- 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
-
searchObjectsIterative
@NotNull public @NotNull 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:AuditService
Executes iterative search using the provided `handler` to process each object.- Specified by:
searchObjectsIterative
in 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
-
getRepositoryDiag
@NotNull public @NotNull RepositoryDiag getRepositoryDiag()
- Specified by:
getRepositoryDiag
in interfaceAuditService
-
getImplementation
public <T extends AuditService> T getImplementation(Class<T> implementationType)
Support public (but non-API) method to obtain concrete implementation of audit service.
-
-