Class EvaluatedAssignmentImpl<AH extends AssignmentHolderType>
java.lang.Object
com.evolveum.midpoint.model.impl.lens.assignments.EvaluatedAssignmentImpl<AH>
- All Implemented Interfaces:
EvaluatedAssignment
,DebugDumpable
,ShortDumpable
,Serializable
public class EvaluatedAssignmentImpl<AH extends AssignmentHolderType>
extends Object
implements EvaluatedAssignment
Evaluated assignment that contains all constructions and authorizations from the assignment
itself and all the applicable inducements from all the roles referenced from the assignment.
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
ConstructorDescriptionEvaluatedAssignmentImpl
(@NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> assignmentIdi, @Nullable Long externalAssignmentId, boolean evaluatedOld, @NotNull AssignmentOrigin origin) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addFocusMapping
(MappingImpl<?, ?> focusMapping) void
addTargetPolicyRule
(EvaluatedPolicyRuleImpl policyRule) debugDump
(int indent) void
evaluateConstructions
(ObjectDeltaObject<AH> focusOdoAbsolute, Consumer<ResourceType> resourceConsumer, Task task, OperationResult result) Evaluates constructions in this assignment.@NotNull PlusMinusZero
Returns absolute mode of this assignment with regard to focus old state.@NotNull Collection<AdminGuiConfigurationType>
Set of abstract role OIDs considered for addition of admin gui configuration.@NotNull Collection<AssociatedPolicyRule>
ReturnsEvaluatedAssignment.getAllTargetsPolicyRules()
plus so-called "foreign policy rules".@NotNull Collection<EvaluatedPolicyRuleImpl>
Returns all policy rules that apply to any of the target objects provided by this assignment (and are derived from this assignment) - even those that were not triggered.int
How many target policy rules are there.@NotNull Collection<PrismReferenceValue>
getAssignment
(boolean old) @NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>,
PrismContainerDefinition<AssignmentType>> @NotNull Collection<Authorization>
getConstructionSet
(PlusMinusZero whichSet) @NotNull DeltaSetTriple<AssignedResourceObjectConstruction<AH>>
@NotNull Collection<PrismReferenceValue>
getEvaluatedConstructions
(@NotNull Task task, @NotNull OperationResult result) Construction is not a part of model-api.@NotNull Collection<MappingImpl<?,
?>> These are evaluated focus mappings.@NotNull List<ForeignPolicyRuleImpl>
@NotNull Collection<PrismReferenceValue>
@NotNull PlusMinusZero
getMode()
@NotNull Collection<EvaluatedPolicyRuleImpl>
Returns all policy rules that apply to the focal/projections objects and are derived from this assignment - even those that were not triggered.@NotNull Collection<PrismReferenceValue>
@NotNull AssignmentOrigin
@NotNull Collection<EvaluatedPolicyRuleImpl>
Returns all policy rules that apply to some other target object of this assignment (and are derived from this assignment) - even those that were not triggered.@NotNull DeltaSetTriple<PersonaConstruction<AH>>
@NotNull DeltaSetTriple<EvaluatedAssignmentTargetImpl>
getRoles()
PrismObject<?>
@NotNull Collection<EvaluatedPolicyRuleImpl>
Returns all policy rules that directly apply to the target object of this assignment (and are derived from this assignment) - even those that were not triggered.boolean
hasPolicyRuleException
(@NotNull EvaluatedPolicyRuleImpl rule, @NotNull Collection<EvaluatedPolicyRuleTrigger<?>> triggers) boolean
Assignment is either being added in the current wave or was added in some of the previous waves.boolean
Assignment is either being deleted in the current wave or was deleted in some of the previous waves.boolean
Assignment was present at the beginning and is not being deleted.boolean
boolean
boolean
boolean
isValid()
TODO Define this concept.boolean
void
Registers a foreign policy rule.void
setForceRecon
(boolean forceRecon) void
setTarget
(PrismObject<?> target) void
setValid
(boolean isValid) void
setWasValid
(boolean wasValid) void
Show the content of the object intended for diagnostics.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.model.api.context.EvaluatedAssignment
getAssignmentType, getAssignmentType
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Constructor Details
-
EvaluatedAssignmentImpl
public EvaluatedAssignmentImpl(@NotNull @NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> assignmentIdi, @Nullable @Nullable Long externalAssignmentId, boolean evaluatedOld, @NotNull @NotNull AssignmentOrigin origin)
-
-
Method Details
-
getAssignmentIdi
@NotNull public @NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> getAssignmentIdi() -
getAssignment
- Specified by:
getAssignment
in interfaceEvaluatedAssignment
-
getAssignmentId
- Specified by:
getAssignmentId
in interfaceEvaluatedAssignment
-
getAssignment
- Specified by:
getAssignment
in interfaceEvaluatedAssignment
-
getRelation
- Specified by:
getRelation
in interfaceEvaluatedAssignment
-
getNormalizedRelation
- Specified by:
getNormalizedRelation
in interfaceEvaluatedAssignment
-
getConstructionTriple
@NotNull public @NotNull DeltaSetTriple<AssignedResourceObjectConstruction<AH>> getConstructionTriple() -
getEvaluatedConstructions
@NotNull public @NotNull DeltaSetTriple<EvaluatedResourceObjectConstruction> getEvaluatedConstructions(@NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Construction is not a part of model-api. To avoid heavy refactoring at present time, there is not a classical Construction-ConstructionImpl separation, but we use artificial (simplified)EvaluatedResourceObjectConstruction
API class instead.- Specified by:
getEvaluatedConstructions
in interfaceEvaluatedAssignment
-
getConstructionSet
public Collection<AssignedResourceObjectConstruction<AH>> getConstructionSet(PlusMinusZero whichSet) -
getPersonaConstructionTriple
-
getRoles
- Specified by:
getRoles
in interfaceEvaluatedAssignment
-
getOrgRefVals
-
getArchetypeRefVals
-
getMembershipRefVals
-
getDelegationRefVals
-
getTenantOid
-
getAuthorizations
- Specified by:
getAuthorizations
in interfaceEvaluatedAssignment
-
getAdminGuiConfigurations
- Specified by:
getAdminGuiConfigurations
in interfaceEvaluatedAssignment
-
getFocusMappings
Description copied from interface:EvaluatedAssignment
These are evaluated focus mappings. Since 4.0.1 the evaluation is carried out not during assignment evaluation but afterwards.- Specified by:
getFocusMappings
in interfaceEvaluatedAssignment
-
getFocusMappingEvaluationRequests
@NotNull public @NotNull Collection<AssignedFocusMappingEvaluationRequest> getFocusMappingEvaluationRequests() -
addFocusMapping
-
getTarget
- Specified by:
getTarget
in interfaceEvaluatedAssignment
-
setTarget
-
isVirtual
public boolean isVirtual() -
isValid
public boolean isValid()Description copied from interface:EvaluatedAssignment
TODO Define this concept. It looks like it mixes ideas of validity (activation, lifecycle state) and relativity mode (condition).- Specified by:
isValid
in interfaceEvaluatedAssignment
-
setValid
public void setValid(boolean isValid) -
setWasValid
public void setWasValid(boolean wasValid) -
isForceRecon
public boolean isForceRecon() -
setForceRecon
public void setForceRecon(boolean forceRecon) -
evaluateConstructions
public void evaluateConstructions(ObjectDeltaObject<AH> focusOdoAbsolute, Consumer<ResourceType> resourceConsumer, Task task, OperationResult result) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException, SecurityViolationException, ConfigurationException, CommunicationException Evaluates constructions in this assignment.- Parameters:
focusOdoAbsolute
- Absolute focus ODO. It must not be relative one, because constructions are applied on resource objects. And resource objects' old state is related to focus object old state. (These projections are _not_ changed iteratively, perhaps except for wave restarting.)- Throws:
SchemaException
ExpressionEvaluationException
ObjectNotFoundException
SecurityViolationException
ConfigurationException
CommunicationException
-
getOrigin
-
isPresentInCurrentObject
public boolean isPresentInCurrentObject()- Specified by:
isPresentInCurrentObject
in interfaceEvaluatedAssignment
-
isPresentInOldObject
public boolean isPresentInOldObject()- Specified by:
isPresentInOldObject
in interfaceEvaluatedAssignment
-
getObjectPolicyRules
Description copied from interface:EvaluatedAssignment
Returns all policy rules that apply to the focal/projections objects and are derived from this assignment - even those that were not triggered. The policy rules are compiled from all the applicable sources (target, meta-roles, etc.)- Specified by:
getObjectPolicyRules
in interfaceEvaluatedAssignment
-
getAllTargetsPolicyRules
Description copied from interface:EvaluatedAssignment
Returns all policy rules that apply to any of the target objects provided by this assignment (and are derived from this assignment) - even those that were not triggered. The policy rules are compiled from all the applicable sources (target, meta-roles, etc.) The difference to getThisTargetPolicyRules is that if e.g. jack is a Pirate, and Pirate induces Sailor, then - `getThisTargetPolicyRules` will show rules that are attached to Pirate - `getAllTargetsPolicyRules` will show rules that are attached to Pirate and Sailor - `getOtherTargetsPolicyRules` will show rules that are attached to Sailor- Specified by:
getAllTargetsPolicyRules
in interfaceEvaluatedAssignment
-
getThisTargetPolicyRules
Description copied from interface:EvaluatedAssignment
Returns all policy rules that directly apply to the target object of this assignment (and are derived from this assignment) - even those that were not triggered. The policy rules are compiled from all the applicable sources (target, meta-roles, etc.)- Specified by:
getThisTargetPolicyRules
in interfaceEvaluatedAssignment
-
getOtherTargetsPolicyRules
Description copied from interface:EvaluatedAssignment
Returns all policy rules that apply to some other target object of this assignment (and are derived from this assignment) - even those that were not triggered. The policy rules are compiled from all the applicable sources (target, meta-roles, etc.)- Specified by:
getOtherTargetsPolicyRules
in interfaceEvaluatedAssignment
-
addTargetPolicyRule
-
getAllTargetsPolicyRulesCount
public int getAllTargetsPolicyRulesCount()Description copied from interface:EvaluatedAssignment
How many target policy rules are there.- Specified by:
getAllTargetsPolicyRulesCount
in interfaceEvaluatedAssignment
-
getForeignPolicyRules
-
getAllAssociatedPolicyRules
Description copied from interface:EvaluatedAssignment
ReturnsEvaluatedAssignment.getAllTargetsPolicyRules()
plus so-called "foreign policy rules". Those are rules that are related to this assignment because they contain an exclusion trigger pointing to this assignment as the conflicting one. This is necessary to implement "declare once, use twice" approach where it should be sufficient to declare an exclusion constraint at one of the targets only. See e.g. MID-8269. There are important things to be aware of, though. Please seeAssociatedPolicyRule
for more information.- Specified by:
getAllAssociatedPolicyRules
in interfaceEvaluatedAssignment
-
registerAsForeignRule
Registers a foreign policy rule. In theory, the result of this operation may be non-deterministic. Let us assume we have the same policy rule with multiple occurrences pointing to this assignment (as foreign rules). Whatever is evaluated first, ends in this collection. This may result in phantom updates if full policy situation recording is enabled. However, that is an experimental feature anyway. -
hasPolicyRuleException
public boolean hasPolicyRuleException(@NotNull @NotNull EvaluatedPolicyRuleImpl rule, @NotNull @NotNull Collection<EvaluatedPolicyRuleTrigger<?>> triggers) -
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
toString
-
toHumanReadableString
- Specified by:
toHumanReadableString
in interfaceEvaluatedAssignment
-
shortDump
Description copied from interface:ShortDumpable
Show the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDump
in interfaceShortDumpable
- Parameters:
sb
- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
getNonNegativeTargets
-
getMode
- Returns:
- mode (adding, deleting, keeping) with respect to the *current* object (not the old one)
-
getAbsoluteMode
Returns absolute mode of this assignment with regard to focus old state. -
isBeingAdded
public boolean isBeingAdded()Description copied from interface:EvaluatedAssignment
Assignment is either being added in the current wave or was added in some of the previous waves.- Specified by:
isBeingAdded
in interfaceEvaluatedAssignment
-
isBeingDeleted
public boolean isBeingDeleted()Description copied from interface:EvaluatedAssignment
Assignment is either being deleted in the current wave or was deleted in some of the previous waves.- Specified by:
isBeingDeleted
in interfaceEvaluatedAssignment
-
isBeingKept
public boolean isBeingKept()Description copied from interface:EvaluatedAssignment
Assignment was present at the beginning and is not being deleted.- Specified by:
isBeingKept
in interfaceEvaluatedAssignment
-
getAdminGuiDependencies
Description copied from interface:EvaluatedAssignment
Set of abstract role OIDs considered for addition of admin gui configuration.- Specified by:
getAdminGuiDependencies
in interfaceEvaluatedAssignment
-
addAdminGuiDependency
-