Skip to content

Commit

Permalink
Move shadow classification to provisioning-impl
Browse files Browse the repository at this point in the history
This (long-awaited) move was necessary because of the planned
implementation of "smart classification" based on object type
delineation.

The shadow tag generation was moved as well. On the other hand,
synchronization sorter evaluation remains in the model-impl (for now).

Also fixed a couple of POM dependencies.

Work in progress. Some tests may fail.
  • Loading branch information
mederly committed May 24, 2022
1 parent 7110519 commit 7296dd1
Show file tree
Hide file tree
Showing 26 changed files with 824 additions and 583 deletions.
10 changes: 5 additions & 5 deletions model/authentication-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<artifactId>schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
<artifactId>repo-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
<artifactId>security-api</artifactId>
Expand All @@ -60,11 +65,6 @@
<artifactId>model-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.model</groupId>
<artifactId>model-common</artifactId>
<version>${project.version}</version>
</dependency>

<!--SPRING-->
<dependency>
Expand Down
5 changes: 0 additions & 5 deletions model/certification-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@
<artifactId>model-impl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.model</groupId>
<artifactId>model-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.infra</groupId>
<artifactId>common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import com.evolveum.midpoint.model.api.correlator.CorrelatorFactoryRegistry;
import com.evolveum.midpoint.model.common.ModelCommonBeans;

import com.evolveum.midpoint.provisioning.api.SynchronizationSorterEvaluator;
import com.evolveum.midpoint.repo.common.SystemObjectCache;
import com.evolveum.midpoint.model.impl.classification.ResourceObjectClassifierImpl;
import com.evolveum.midpoint.model.impl.classification.ShadowTagGeneratorImpl;
import com.evolveum.midpoint.model.impl.correlator.BuiltInResultCreator;
import com.evolveum.midpoint.model.impl.correlation.CorrelationCaseManager;
import com.evolveum.midpoint.model.impl.lens.*;
Expand All @@ -31,7 +30,6 @@
import com.evolveum.midpoint.model.impl.migrator.Migrator;
import com.evolveum.midpoint.model.impl.security.SecurityHelper;
import com.evolveum.midpoint.model.impl.sync.reactions.SynchronizationActionFactory;
import com.evolveum.midpoint.model.impl.sync.SynchronizationExpressionsEvaluator;
import com.evolveum.midpoint.model.impl.sync.SynchronizationService;
import com.evolveum.midpoint.model.impl.sync.tasks.SyncTaskHelper;
import com.evolveum.midpoint.prism.crypto.Protector;
Expand Down Expand Up @@ -133,8 +131,6 @@ public static ModelBeans get() {
@Autowired public CorrelationCaseManager correlationCaseManager;
@Autowired public CorrelationService correlationService;
@Autowired public BuiltInResultCreator builtInResultCreator;
@Autowired public ResourceObjectClassifierImpl resourceObjectClassifier;
@Autowired public ShadowTagGeneratorImpl shadowTagGenerator;
@Autowired public SynchronizationExpressionsEvaluator synchronizationExpressionsEvaluator;
@Autowired public SynchronizationSorterEvaluator synchronizationSorterEvaluator;
@Autowired public SynchronizationActionFactory synchronizationActionFactory;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.evolveum.midpoint.model.impl.util.ModelImplUtils;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.provisioning.api.ResourceObjectClassifier;
import com.evolveum.midpoint.provisioning.api.ResourceObjectShadowChangeDescription;
import com.evolveum.midpoint.schema.expression.VariablesMap;
import com.evolveum.midpoint.task.api.Task;
Expand All @@ -25,7 +24,7 @@
import org.jetbrains.annotations.Nullable;

/**
* A context generally useful for the manipulation of a shadow - classification, correlation, synchronization.
* A context generally useful for the manipulation of a shadow, e.g. correlation or synchronization.
*
* We use it to avoid repeating the contained data throughout various "context" classes
* ({@link SynchronizationContext}, {@link CorrelationContext}, ...).
Expand All @@ -35,7 +34,7 @@ public interface ResourceObjectProcessingContext {

/**
* Returns shadowed resource object, or - at least - so-called "combined object" in the sense
* used in {@link ResourceObjectClassifier}.
* used in ResourceObjectClassifier FIXME
*/
@NotNull ShadowType getShadowedResourceObject();

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.*;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.provisioning.api.ResourceObjectClassification;

import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.model.impl.ModelBeans;
Expand All @@ -20,7 +22,6 @@
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.provisioning.api.ProvisioningService;
import com.evolveum.midpoint.provisioning.api.ResourceObjectClassifier;
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.schema.GetOperationOptions;
import com.evolveum.midpoint.schema.SelectorOptions;
Expand Down Expand Up @@ -336,11 +337,12 @@ private void doFixIntent(
return;
}

ResourceObjectClassifier.Classification classification;
ResourceObjectClassification classification;
try {
classification = getModelBeans().resourceObjectClassifier.classify(
classification = getModelBeans().provisioningService.classifyResourceObject(
fullShadow.asObjectable(),
resource.asObjectable(),
null,
task,
result);
} catch (CommonException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

import javax.xml.datatype.XMLGregorianCalendar;

import com.evolveum.midpoint.provisioning.api.ResourceObjectClassifier;

import com.evolveum.midpoint.provisioning.api.ResourceObjectClassifier.Classification;
import com.evolveum.midpoint.provisioning.api.ResourceObjectClassification;

import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -78,7 +76,6 @@ public class ProjectionValuesProcessor implements ProjectorProcessor {
@Autowired private CorrelationService correlationService;
@Autowired private ContextLoader contextLoader;
@Autowired private ProvisioningService provisioningService;
@Autowired private ResourceObjectClassifier classifier;

@ProcessorMethod
public <F extends FocusType> void process(LensContext<F> context, LensProjectionContext projectionContext,
Expand Down Expand Up @@ -351,7 +348,9 @@ private <F extends FocusType> boolean doesMatchOpportunistically(
// In the future the provisioning.getObject operation should do the classification itself.
// The following is more or less a workaround. See MID-7910.
LOGGER.trace("Conflicting shadow is not classified yet, let us try to classify it now.");
Classification classification = classifier.classify(fullConflictingShadow, resource, task, iterationResult);
ResourceObjectClassification classification =
provisioningService.classifyResourceObject(
fullConflictingShadow, resource, null, task, iterationResult);
if (!classification.isKnown()) {
LOGGER.trace("No classification possible -> opportunistic sync not available");
return false;
Expand Down

0 comments on commit 7296dd1

Please sign in to comment.