Package com.evolveum.midpoint.audit.api
Interface AuditService
-
- All Known Implementing Classes:
AuditServiceProxy
,SqaleAuditService
public interface AuditService
Service contract for audit - this can actually represent multiple audit services. This is implementation independent, but some features may not be supported by all implementations. For instance,supportsRetrieval()
indicates whether audit supports searching, or just storing.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_MESSAGE_SIZE
static int
MAX_PROPERTY_SIZE
static String
OP_AUDIT
static String
OP_CLEANUP_AUDIT_MAX_AGE
static String
OP_CLEANUP_AUDIT_MAX_RECORDS
static String
OP_COUNT_OBJECTS
static String
OP_SEARCH_OBJECTS
static String
OP_SEARCH_OBJECTS_ITERATIVE
static String
OP_SEARCH_OBJECTS_ITERATIVE_PAGE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
applyAuditConfiguration(@Nullable SystemConfigurationAuditType configuration)
Called when audit configuration is established or changed.void
audit(AuditEventRecord record, Task task, OperationResult parentResult)
Emits audit event record, e.g.void
audit(AuditEventRecordType record, OperationResult parentResult)
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.@NotNull RepositoryDiag
getRepositoryDiag()
@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.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.
-
-
-
Field Detail
-
MAX_MESSAGE_SIZE
static final int MAX_MESSAGE_SIZE
- See Also:
- Constant Field Values
-
MAX_PROPERTY_SIZE
static final int MAX_PROPERTY_SIZE
- See Also:
- Constant Field Values
-
OP_AUDIT
static final String OP_AUDIT
- See Also:
- Constant Field Values
-
OP_CLEANUP_AUDIT_MAX_AGE
static final String OP_CLEANUP_AUDIT_MAX_AGE
- See Also:
- Constant Field Values
-
OP_CLEANUP_AUDIT_MAX_RECORDS
static final String OP_CLEANUP_AUDIT_MAX_RECORDS
- See Also:
- Constant Field Values
-
OP_COUNT_OBJECTS
static final String OP_COUNT_OBJECTS
- See Also:
- Constant Field Values
-
OP_SEARCH_OBJECTS
static final String OP_SEARCH_OBJECTS
- See Also:
- Constant Field Values
-
OP_SEARCH_OBJECTS_ITERATIVE
static final String OP_SEARCH_OBJECTS_ITERATIVE
- See Also:
- Constant Field Values
-
OP_SEARCH_OBJECTS_ITERATIVE_PAGE
static final String OP_SEARCH_OBJECTS_ITERATIVE_PAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
audit
void audit(AuditEventRecord record, Task task, OperationResult parentResult)
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.
-
audit
@Experimental void audit(AuditEventRecordType record, OperationResult parentResult)
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.
-
cleanupAudit
void cleanupAudit(CleanupPolicyType policy, OperationResult parentResult)
Clean up audit records that are older than specified.- Parameters:
policy
- Records will be deleted base on this policy.
-
supportsRetrieval
boolean supportsRetrieval()
Returns true if retrieval of objects from the audit trail is supported. This applies to listRecords, countObjects, reconstructObject and similar operations.
-
applyAuditConfiguration
default void applyAuditConfiguration(@Nullable @Nullable SystemConfigurationAuditType configuration)
Called when audit configuration is established or changed. Setting to null means to use default values for the settings.
-
countObjects
int countObjects(@Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult)
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.- Parameters:
query
- search queryparentResult
- parent operation result (in/out)- Returns:
- count of audit events of specified type that match the search criteria
-
searchObjects
@NotNull @NotNull SearchResultList<AuditEventRecordType> searchObjects(@Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult) throws SchemaException
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.- 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
@Experimental SearchResultMetadata searchObjectsIterative(@Nullable @Nullable ObjectQuery query, @NotNull @NotNull AuditResultHandler handler, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull OperationResult parentResult) throws SchemaException
Executes iterative search using the provided `handler` to process each object.- 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 @NotNull RepositoryDiag getRepositoryDiag()
-
-