Class EvaluatedAssignmentImpl<AH extends AssignmentHolderType>
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.lens.assignments.EvaluatedAssignmentImpl<AH>
-
- All Implemented Interfaces:
EvaluatedAssignment<AH>
,DebugDumpable
,ShortDumpable
,Serializable
public class EvaluatedAssignmentImpl<AH extends AssignmentHolderType> extends Object implements EvaluatedAssignment<AH>
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description EvaluatedAssignmentImpl(@NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> assignmentIdi, boolean evaluatedOld, @NotNull AssignmentOrigin origin, PrismContext prismContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFocusMapping(MappingImpl<?,?> focusMapping)
void
addOtherTargetPolicyRule(EvaluatedPolicyRuleImpl policyRule)
void
addThisTargetPolicyRule(EvaluatedPolicyRuleImpl policyRule)
String
debugDump(int indent)
void
evaluateConstructions(ObjectDeltaObject<AH> focusOdoAbsolute, Consumer<ResourceType> resourceConsumer, Task task, OperationResult result)
Evaluates constructions in this assignment.@NotNull PlusMinusZero
getAbsoluteMode()
Returns absolute mode of this assignment with regard to focus old state.@NotNull Collection<AdminGuiConfigurationType>
getAdminGuiConfigurations()
@NotNull Collection<EvaluatedPolicyRuleImpl>
getAllTargetsPolicyRules()
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
getAllTargetsPolicyRulesCount()
How many target policy rules are there.@NotNull Collection<PrismReferenceValue>
getArchetypeRefVals()
AssignmentType
getAssignment()
AssignmentType
getAssignment(boolean old)
Long
getAssignmentId()
@NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>>
getAssignmentIdi()
@NotNull Collection<Authorization>
getAuthorizations()
Collection<AssignedResourceObjectConstruction<AH>>
getConstructionSet(PlusMinusZero whichSet)
@NotNull DeltaSetTriple<AssignedResourceObjectConstruction<AH>>
getConstructionTriple()
@NotNull Collection<PrismReferenceValue>
getDelegationRefVals()
@NotNull DeltaSetTriple<EvaluatedResourceObjectConstruction>
getEvaluatedConstructions(@NotNull Task task, @NotNull OperationResult result)
Construction is not a part of model-api.@NotNull Collection<AssignedFocusMappingEvaluationRequest>
getFocusMappingEvaluationRequests()
@NotNull Collection<MappingImpl<?,?>>
getFocusMappings()
These are evaluated focus mappings.@NotNull Collection<EvaluatedPolicyRuleImpl>
getFocusPolicyRules()
Returns all policy rules that apply to the focal object and are derived from this assignment - even those that were not triggered.@NotNull Collection<PrismReferenceValue>
getMembershipRefVals()
@NotNull PlusMinusZero
getMode()
List<EvaluatedAssignmentTargetImpl>
getNonNegativeTargets()
QName
getNormalizedRelation()
@NotNull Collection<PrismReferenceValue>
getOrgRefVals()
@NotNull AssignmentOrigin
getOrigin()
@NotNull Collection<EvaluatedPolicyRuleImpl>
getOtherTargetsPolicyRules()
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>>
getPersonaConstructionTriple()
QName
getRelation()
@NotNull DeltaSetTriple<EvaluatedAssignmentTargetImpl>
getRoles()
PrismObject<?>
getTarget()
String
getTenantOid()
@NotNull Collection<EvaluatedPolicyRuleImpl>
getThisTargetPolicyRules()
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
isBeingAdded()
Assignment is either being added in the current wave or was added in some of the previous waves.boolean
isBeingDeleted()
Assignment is either being deleted in the current wave or was deleted in some of the previous waves.boolean
isBeingKept()
Assignment was present at the beginning and is not being deleted.boolean
isForceRecon()
boolean
isPresentInCurrentObject()
boolean
isPresentInOldObject()
boolean
isValid()
TODO Define this concept.boolean
isVirtual()
void
setForceRecon(boolean forceRecon)
void
setTarget(PrismObject<?> target)
void
setValid(boolean isValid)
void
setWasValid(boolean wasValid)
void
shortDump(StringBuilder sb)
Show the content of the object intended for diagnostics.String
toHumanReadableString()
String
toString()
void
triggerRule(@NotNull EvaluatedPolicyRule rule, Collection<EvaluatedPolicyRuleTrigger<?>> triggers)
-
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 Detail
-
EvaluatedAssignmentImpl
public EvaluatedAssignmentImpl(@NotNull @NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> assignmentIdi, boolean evaluatedOld, @NotNull @NotNull AssignmentOrigin origin, PrismContext prismContext)
-
-
Method Detail
-
getAssignmentIdi
@NotNull public @NotNull ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> getAssignmentIdi()
-
getAssignment
public AssignmentType getAssignment()
- Specified by:
getAssignment
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getAssignmentId
public Long getAssignmentId()
- Specified by:
getAssignmentId
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getAssignment
public AssignmentType getAssignment(boolean old)
- Specified by:
getAssignment
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getRelation
public QName getRelation()
- Specified by:
getRelation
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getNormalizedRelation
public QName getNormalizedRelation()
- Specified by:
getNormalizedRelation
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
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) EvaluatedConstruction API class instead.- Specified by:
getEvaluatedConstructions
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getConstructionSet
public Collection<AssignedResourceObjectConstruction<AH>> getConstructionSet(PlusMinusZero whichSet)
-
getPersonaConstructionTriple
@NotNull public @NotNull DeltaSetTriple<PersonaConstruction<AH>> getPersonaConstructionTriple()
-
getRoles
@NotNull public @NotNull DeltaSetTriple<EvaluatedAssignmentTargetImpl> getRoles()
- Specified by:
getRoles
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getOrgRefVals
@NotNull public @NotNull Collection<PrismReferenceValue> getOrgRefVals()
-
getArchetypeRefVals
@NotNull public @NotNull Collection<PrismReferenceValue> getArchetypeRefVals()
-
getMembershipRefVals
@NotNull public @NotNull Collection<PrismReferenceValue> getMembershipRefVals()
-
getDelegationRefVals
@NotNull public @NotNull Collection<PrismReferenceValue> getDelegationRefVals()
-
getTenantOid
public String getTenantOid()
-
getAuthorizations
@NotNull public @NotNull Collection<Authorization> getAuthorizations()
- Specified by:
getAuthorizations
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getAdminGuiConfigurations
@NotNull public @NotNull Collection<AdminGuiConfigurationType> getAdminGuiConfigurations()
- Specified by:
getAdminGuiConfigurations
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getFocusMappings
@NotNull public @NotNull Collection<MappingImpl<?,?>> 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<AH extends AssignmentHolderType>
-
getFocusMappingEvaluationRequests
@NotNull public @NotNull Collection<AssignedFocusMappingEvaluationRequest> getFocusMappingEvaluationRequests()
-
addFocusMapping
public void addFocusMapping(MappingImpl<?,?> focusMapping)
-
getTarget
public PrismObject<?> getTarget()
- Specified by:
getTarget
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
setTarget
public void setTarget(PrismObject<?> target)
-
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<AH extends AssignmentHolderType>
-
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
@NotNull public @NotNull AssignmentOrigin getOrigin()
-
isPresentInCurrentObject
public boolean isPresentInCurrentObject()
- Specified by:
isPresentInCurrentObject
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
isPresentInOldObject
public boolean isPresentInOldObject()
- Specified by:
isPresentInOldObject
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getFocusPolicyRules
@NotNull public @NotNull Collection<EvaluatedPolicyRuleImpl> getFocusPolicyRules()
Description copied from interface:EvaluatedAssignment
Returns all policy rules that apply to the focal object 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:
getFocusPolicyRules
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
getThisTargetPolicyRules
@NotNull public @NotNull Collection<EvaluatedPolicyRuleImpl> 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<AH extends AssignmentHolderType>
-
addThisTargetPolicyRule
public void addThisTargetPolicyRule(EvaluatedPolicyRuleImpl policyRule)
-
getOtherTargetsPolicyRules
@NotNull public @NotNull Collection<EvaluatedPolicyRuleImpl> 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<AH extends AssignmentHolderType>
-
addOtherTargetPolicyRule
public void addOtherTargetPolicyRule(EvaluatedPolicyRuleImpl policyRule)
-
getAllTargetsPolicyRules
@NotNull public @NotNull Collection<EvaluatedPolicyRuleImpl> 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<AH extends AssignmentHolderType>
-
getAllTargetsPolicyRulesCount
public int getAllTargetsPolicyRulesCount()
Description copied from interface:EvaluatedAssignment
How many target policy rules are there. This is more efficient than getAllTargetsPolicyRules().size(), as the collection of all targets policy rules is computed on demand.- Specified by:
getAllTargetsPolicyRulesCount
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
triggerRule
public void triggerRule(@NotNull @NotNull EvaluatedPolicyRule rule, Collection<EvaluatedPolicyRuleTrigger<?>> triggers)
- Specified by:
triggerRule
in interfaceEvaluatedAssignment<AH extends AssignmentHolderType>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
toHumanReadableString
public String toHumanReadableString()
-
shortDump
public void shortDump(StringBuilder sb)
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
public List<EvaluatedAssignmentTargetImpl> getNonNegativeTargets()
-
getMode
@NotNull @Experimental public @NotNull PlusMinusZero getMode()
- Returns:
- mode (adding, deleting, keeping) with respect to the *current* object (not the old one)
-
getAbsoluteMode
@NotNull public @NotNull PlusMinusZero 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<AH extends AssignmentHolderType>
-
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<AH extends AssignmentHolderType>
-
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<AH extends AssignmentHolderType>
-
-