Search in sources :

Example 6 with OperationStatus

use of com.evolveum.midpoint.ninja.util.OperationStatus in project midpoint by Evolveum.

the class DeleteRepositoryAction method deleteByFilter.

private void deleteByFilter(ObjectQuery query) throws SchemaException {
    OperationResult result = new OperationResult(OPERATION_DELETE);
    OperationStatus operation = new OperationStatus(context, result);
    operation.start();
    log.info("Starting delete");
    ObjectTypes type = options.getType();
    if (type != null) {
        deleteByFilter(type, query, operation, result);
    } else {
        for (ObjectTypes t : ObjectTypes.values()) {
            if (Modifier.isAbstract(t.getClassDefinition().getModifiers())) {
                continue;
            }
            deleteByFilter(t, query, operation, result);
        }
    }
    operation.finish();
    handleResultOnFinish(operation, "Delete finished");
}
Also used : OperationStatus(com.evolveum.midpoint.ninja.util.OperationStatus) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectTypes(com.evolveum.midpoint.schema.constants.ObjectTypes)

Aggregations

OperationStatus (com.evolveum.midpoint.ninja.util.OperationStatus)6 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)6 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)3 InOidFilter (com.evolveum.midpoint.prism.query.InOidFilter)2 ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)2 ObjectTypes (com.evolveum.midpoint.schema.constants.ObjectTypes)2 AuditEventRecordType (com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType)2 ImportRepositoryConsumerWorker (com.evolveum.midpoint.ninja.action.worker.ImportRepositoryConsumerWorker)1 SearchProducerWorker (com.evolveum.midpoint.ninja.action.worker.SearchProducerWorker)1 DeleteOptions (com.evolveum.midpoint.ninja.opts.DeleteOptions)1 NinjaUtils (com.evolveum.midpoint.ninja.util.NinjaUtils)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)1 QueryFactory (com.evolveum.midpoint.prism.query.QueryFactory)1 RepositoryService (com.evolveum.midpoint.repo.api.RepositoryService)1 GetOperationOptions (com.evolveum.midpoint.schema.GetOperationOptions)1 ResultHandler (com.evolveum.midpoint.schema.ResultHandler)1 SelectorOptions (com.evolveum.midpoint.schema.SelectorOptions)1 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1