-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit provides FilterCorrelator, ExpressionCorrelator, and IdMatchCorrelator (using IdMatchService and follow-on correlator). Includes unit tests for these correlators and refactored matcher tests.
- Loading branch information
Showing
44 changed files
with
2,095 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
...odel-api/src/main/java/com/evolveum/midpoint/model/api/correlator/CorrelationContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* | ||
* Copyright (C) 2010-2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.model.api.correlator; | ||
|
||
import com.evolveum.midpoint.schema.processor.ResourceObjectTypeDefinition; | ||
import com.evolveum.midpoint.util.DebugDumpable; | ||
import com.evolveum.midpoint.util.DebugUtil; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractCorrelationStateType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* The context of the correlation operation(s). | ||
* | ||
* TODO decide on the exact use of this class -- will it be only at API level? Or will the correlator write its own notes here? | ||
*/ | ||
public class CorrelationContext implements DebugDumpable { | ||
|
||
/** | ||
* What type of focus object(s) are we correlating against. | ||
*/ | ||
@NotNull private final Class<? extends ObjectType> focusType; | ||
|
||
/** | ||
* Resource on which the correlated shadow resides. | ||
*/ | ||
@NotNull private final ResourceType resource; | ||
|
||
/** | ||
* Resource object type definition (~ schemaHandling section). | ||
*/ | ||
@NotNull private final ResourceObjectTypeDefinition objectTypeDefinition; | ||
|
||
/** | ||
* System configuration to use during the correlation. | ||
*/ | ||
@Nullable private final SystemConfigurationType systemConfiguration; | ||
|
||
/** | ||
* Information about the current state of the correlation process. | ||
* Usually provided by upstream (parent) correlator. | ||
*/ | ||
private AbstractCorrelationStateType correlationState; | ||
|
||
public CorrelationContext( | ||
@NotNull Class<? extends ObjectType> focusType, | ||
@NotNull ResourceType resource, | ||
@NotNull ResourceObjectTypeDefinition objectTypeDefinition, | ||
@Nullable SystemConfigurationType systemConfiguration) { | ||
this.focusType = focusType; | ||
this.resource = resource; | ||
this.objectTypeDefinition = objectTypeDefinition; | ||
this.systemConfiguration = systemConfiguration; | ||
} | ||
|
||
@NotNull public Class<? extends ObjectType> getFocusType() { | ||
return focusType; | ||
} | ||
|
||
public @NotNull ResourceType getResource() { | ||
return resource; | ||
} | ||
|
||
public @NotNull ResourceObjectTypeDefinition getObjectTypeDefinition() { | ||
return objectTypeDefinition; | ||
} | ||
|
||
public @Nullable SystemConfigurationType getSystemConfiguration() { | ||
return systemConfiguration; | ||
} | ||
|
||
public AbstractCorrelationStateType getCorrelationState() { | ||
return correlationState; | ||
} | ||
|
||
public void setCorrelationState(AbstractCorrelationStateType correlationState) { | ||
this.correlationState = correlationState; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CorrelationContext(" | ||
+ focusType.getSimpleName() + ", " | ||
+ objectTypeDefinition.getHumanReadableName() + "@" + resource | ||
+ ')'; | ||
} | ||
|
||
@Override | ||
public String debugDump(int indent) { | ||
StringBuilder sb = DebugUtil.createTitleStringBuilderLn(getClass(), indent); | ||
DebugUtil.debugDumpWithLabelLn(sb, "focusType", focusType, indent + 1); | ||
DebugUtil.debugDumpWithLabelLn(sb, "resource", String.valueOf(resource), indent + 1); | ||
DebugUtil.debugDumpWithLabelLn(sb, "objectTypeDefinition", String.valueOf(objectTypeDefinition), indent + 1); | ||
DebugUtil.debugDumpWithLabelLn(sb, "systemConfiguration", String.valueOf(systemConfiguration), indent + 1); | ||
DebugUtil.debugDumpWithLabel(sb, "correlationState", correlationState, indent + 1); | ||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...api/src/main/java/com/evolveum/midpoint/model/api/correlator/CorrelatorConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2010-2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.model.api.correlator; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import com.evolveum.midpoint.prism.PrismContainerValue; | ||
import com.evolveum.midpoint.prism.path.ItemName; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractCorrelatorType; | ||
|
||
/** | ||
* Wrapper for both typed (bean-only) and untyped (bean + item name) correlator configuration. | ||
*/ | ||
public abstract class CorrelatorConfiguration { | ||
|
||
@NotNull private final AbstractCorrelatorType configurationBean; | ||
|
||
CorrelatorConfiguration(@NotNull AbstractCorrelatorType configurationBean) { | ||
this.configurationBean = configurationBean; | ||
} | ||
|
||
public @NotNull AbstractCorrelatorType getConfigurationBean() { | ||
return configurationBean; | ||
} | ||
|
||
public static class TypedCorrelationConfiguration extends CorrelatorConfiguration { | ||
public TypedCorrelationConfiguration(@NotNull AbstractCorrelatorType configurationBean) { | ||
super(configurationBean); | ||
} | ||
} | ||
|
||
public static class UntypedCorrelationConfiguration extends CorrelatorConfiguration { | ||
@NotNull private final ItemName configurationItemName; | ||
|
||
public UntypedCorrelationConfiguration( | ||
@NotNull ItemName configurationItemName, | ||
@NotNull PrismContainerValue<? extends AbstractCorrelatorType> pcv) { | ||
super(pcv.asContainerable()); | ||
this.configurationItemName = configurationItemName; | ||
} | ||
|
||
public @NotNull ItemName getConfigurationItemName() { | ||
return configurationItemName; | ||
} | ||
} | ||
} |
Oops, something went wrong.