Class LensUtil
java.lang.Object
com.evolveum.midpoint.model.impl.lens.LensUtil
- Author:
- semancik
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V extends PrismValue,
D extends ItemDefinition<?>>
MappingBuilder<V,D> addAssignmentPathVariables
(MappingBuilder<V, D> builder, AssignmentPathVariables assignmentPathVariables) static <AH extends AssignmentHolderType>
voidapplyObjectPolicyConstraints
(LensFocusContext<AH> focusContext, ArchetypePolicyType archetypePolicy, PrismContext prismContext) static <F extends ObjectType>
voidcheckContextSanity
(LensContext<F> context, String activityDescription, OperationResult result) static void
checkMaxIterations
(int iteration, int maxIterations, String conflictMessage, String humanReadableName) static AssignmentType
cloneResolveResource
(AssignmentType assignmentBean, LensContext<?> lensContext) static AssignmentPathVariables
computeAssignmentPathVariables
(AssignmentPathImpl assignmentPath) Call this method throughAssignmentPathImpl
and eventually move there.static PropertyDelta<XMLGregorianCalendar>
createActivationTimestampDelta
(ActivationStatusType status, XMLGregorianCalendar now, PrismContainerDefinition<ActivationType> activationDefinition, OriginType origin, PrismContext prismContext) static PrismContainer<AssignmentType>
createAssignmentSingleValueContainer
(@NotNull AssignmentType assignmentType) static @NotNull PrismPropertyDefinition<Boolean>
static ShadowDiscriminatorType
createDiscriminatorBean
(ProjectionContextKey key, LensContext<?> lensContext) static <F extends ObjectType>
LensObjectDeltaOperation<F>createObjectDeltaOperation
(ObjectDelta<F> focusDelta, OperationResult result, LensElementContext<F> focusContext, LensProjectionContext projCtx) static <T extends ObjectType>
LensObjectDeltaOperation<T>createObjectDeltaOperation
(ObjectDelta<T> objectDelta, OperationResult result, LensElementContext<T> objectContext, LensProjectionContext projCtx, ResourceType resource) static int
determineMaxIterations
(IterationSpecificationType iterationSpecType) static <F extends ObjectType>
booleanevaluateIterationCondition
(LensContext<F> context, LensElementContext<?> accountContext, IterationSpecificationType iterationSpecification, int iteration, String iterationToken, boolean beforeIteration, ExpressionFactory expressionFactory, VariablesMap variables, Task task, OperationResult result) static <F extends ObjectType,
T>
ObjectDelta<ShadowType>findAPrioriDelta
(LensContext<F> context, LensProjectionContext projCtx) Extracts the delta from this projection context and also from all other projection contexts that have equivalent discriminator.static <F extends ObjectType>
StringformatIterationToken
(LensElementContext<?> accountContext, IterationSpecificationType iterationSpec, int iteration, ExpressionFactory expressionFactory, VariablesMap variables, Task task, OperationResult result) static String
formatIterationTokenDefault
(int iteration) static <AH extends AssignmentHolderType>
ItemDeltagetAprioriItemDelta
(ObjectDelta<AH> focusDelta, ItemPath itemPath) static VariablesMap
getAssignmentPathVariablesMap
(AssignmentPathVariables assignmentPathVariables) static AssignmentType
getAssignmentType
(ItemDeltaItem<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> assignmentIdi, boolean old) static <F extends ObjectType>
StringgetChannel
(LensContext<F> context, Task task) static LensContext.ExportType
getExportType
(TraceType trace, OperationResult result) static <F extends FocusType>
PrismObjectDefinition<F>getFocusDefinition
(LensContext<F> context) static <R extends AbstractRoleType>
@NotNull List<AssignmentConfigItem>getForcedAssignments
(LifecycleStateModelType lifecycleModel, String stateName, ObjectResolver objectResolver, PrismContext prismContext, Task task, OperationResult result) static IterationSpecificationType
getIterationSpecification
(ObjectTemplateType objectTemplate) static Object
static Object
static <F extends ObjectType>
ResourceTypegetResourceReadOnly
(LensContext<F> context, String resourceOid, ProvisioningService provisioningService, Task task, OperationResult result) static boolean
isAssignmentValid
(AssignmentHolderType focus, AssignmentType assignment, XMLGregorianCalendar now, ActivationComputer activationComputer, LifecycleStateModelType focusStateModel, @NotNull TaskExecutionMode taskExecutionMode) Used for assignments and similar objects that do not have separate lifecycle.static boolean
isFocusValid
(AssignmentHolderType focus, XMLGregorianCalendar now, ActivationComputer activationComputer, LifecycleStateModelType focusStateModel, @NotNull TaskExecutionMode taskExecutionMode) static boolean
static <F extends ObjectType>
voidmoveTriggers
(LensProjectionContext projCtx, LensFocusContext<F> focusCtx) static boolean
static <F extends ObjectType>
voidreclaimSequences
(LensContext<F> context, RepositoryService repositoryService, Task task, OperationResult result) static void
rejectNonTolerantSettingIfPresent
(ObjectTemplateItemDefinitionType templateItemDefinition, ItemPath itemPath, String contextDescription) static <T extends ObjectType,
F extends ObjectType>
voidsetContextOid
(LensContext<F> context, LensElementContext<T> objectContext, String oid) static <O extends ObjectType>
voidsetDeltaOldValue
(LensElementContext<O> ctx, ItemDelta<?, ?> itemDelta) static <O extends ObjectType>
voidsetDeltaOldValue
(LensElementContext<O> ctx, ObjectDelta<O> objectDelta) static <M extends MappingType>
MsetMappingTarget
(M mapping, ItemPathType path)
-
Constructor Details
-
LensUtil
public LensUtil()
-
-
Method Details
-
getResourceReadOnly
public static <F extends ObjectType> ResourceType getResourceReadOnly(LensContext<F> context, String resourceOid, ProvisioningService provisioningService, Task task, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException -
createActivationTimestampDelta
public static PropertyDelta<XMLGregorianCalendar> createActivationTimestampDelta(ActivationStatusType status, XMLGregorianCalendar now, PrismContainerDefinition<ActivationType> activationDefinition, OriginType origin, PrismContext prismContext) -
moveTriggers
public static <F extends ObjectType> void moveTriggers(LensProjectionContext projCtx, LensFocusContext<F> focusCtx) throws SchemaException - Throws:
SchemaException
-
getIterationVariableValue
-
getIterationTokenVariableValue
-
findAPrioriDelta
public static <F extends ObjectType,T> ObjectDelta<ShadowType> findAPrioriDelta(LensContext<F> context, LensProjectionContext projCtx) throws SchemaException Extracts the delta from this projection context and also from all other projection contexts that have equivalent discriminator.- Throws:
SchemaException
-
setContextOid
public static <T extends ObjectType,F extends ObjectType> void setContextOid(LensContext<F> context, LensElementContext<T> objectContext, String oid) -
getFocusDefinition
public static <F extends FocusType> PrismObjectDefinition<F> getFocusDefinition(LensContext<F> context) -
getIterationSpecification
public static IterationSpecificationType getIterationSpecification(ObjectTemplateType objectTemplate) -
determineMaxIterations
-
formatIterationToken
public static <F extends ObjectType> String formatIterationToken(LensElementContext<?> accountContext, IterationSpecificationType iterationSpec, int iteration, ExpressionFactory expressionFactory, VariablesMap variables, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException, SecurityViolationException -
formatIterationTokenDefault
-
evaluateIterationCondition
public static <F extends ObjectType> boolean evaluateIterationCondition(LensContext<F> context, LensElementContext<?> accountContext, IterationSpecificationType iterationSpecification, int iteration, String iterationToken, boolean beforeIteration, ExpressionFactory expressionFactory, VariablesMap variables, Task task, OperationResult result) throws ExpressionEvaluationException, SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException -
isAssignmentValid
public static boolean isAssignmentValid(AssignmentHolderType focus, AssignmentType assignment, XMLGregorianCalendar now, ActivationComputer activationComputer, LifecycleStateModelType focusStateModel, @NotNull @NotNull TaskExecutionMode taskExecutionMode) Used for assignments and similar objects that do not have separate lifecycle. -
getForcedAssignments
@NotNull public static <R extends AbstractRoleType> @NotNull List<AssignmentConfigItem> getForcedAssignments(LifecycleStateModelType lifecycleModel, String stateName, ObjectResolver objectResolver, PrismContext prismContext, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException -
isFocusValid
public static boolean isFocusValid(AssignmentHolderType focus, XMLGregorianCalendar now, ActivationComputer activationComputer, LifecycleStateModelType focusStateModel, @NotNull @NotNull TaskExecutionMode taskExecutionMode) -
computeAssignmentPathVariables
public static AssignmentPathVariables computeAssignmentPathVariables(AssignmentPathImpl assignmentPath) throws SchemaException Call this method throughAssignmentPathImpl
and eventually move there.- Throws:
SchemaException
-
addAssignmentPathVariables
public static <V extends PrismValue,D extends ItemDefinition<?>> MappingBuilder<V,D> addAssignmentPathVariables(MappingBuilder<V, D> builder, AssignmentPathVariables assignmentPathVariables) -
getAssignmentPathVariablesMap
public static VariablesMap getAssignmentPathVariablesMap(AssignmentPathVariables assignmentPathVariables) -
checkContextSanity
public static <F extends ObjectType> void checkContextSanity(LensContext<F> context, String activityDescription, OperationResult result) throws SchemaException, PolicyViolationException -
createAssignmentSingleValueContainer
public static PrismContainer<AssignmentType> createAssignmentSingleValueContainer(@NotNull @NotNull AssignmentType assignmentType) throws SchemaException - Throws:
SchemaException
-
getAssignmentType
public static AssignmentType getAssignmentType(ItemDeltaItem<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> assignmentIdi, boolean old) -
getChannel
-
setDeltaOldValue
public static <O extends ObjectType> void setDeltaOldValue(LensElementContext<O> ctx, ItemDelta<?, ?> itemDelta) -
setDeltaOldValue
public static <O extends ObjectType> void setDeltaOldValue(LensElementContext<O> ctx, ObjectDelta<O> objectDelta) -
createObjectDeltaOperation
public static <F extends ObjectType> LensObjectDeltaOperation<F> createObjectDeltaOperation(ObjectDelta<F> focusDelta, OperationResult result, LensElementContext<F> focusContext, LensProjectionContext projCtx) -
createObjectDeltaOperation
public static <T extends ObjectType> LensObjectDeltaOperation<T> createObjectDeltaOperation(ObjectDelta<T> objectDelta, OperationResult result, LensElementContext<T> objectContext, LensProjectionContext projCtx, ResourceType resource) -
checkMaxIterations
public static void checkMaxIterations(int iteration, int maxIterations, String conflictMessage, String humanReadableName) throws ObjectAlreadyExistsException - Throws:
ObjectAlreadyExistsException
-
needsFullShadowForCredentialProcessing
public static boolean needsFullShadowForCredentialProcessing(LensProjectionContext projCtx) throws SchemaException, ConfigurationException -
isPasswordReturnedByDefault
-
reclaimSequences
public static <F extends ObjectType> void reclaimSequences(LensContext<F> context, RepositoryService repositoryService, Task task, OperationResult result) throws SchemaException - Throws:
SchemaException
-
applyObjectPolicyConstraints
public static <AH extends AssignmentHolderType> void applyObjectPolicyConstraints(LensFocusContext<AH> focusContext, ArchetypePolicyType archetypePolicy, PrismContext prismContext) throws SchemaException, ConfigurationException -
getExportType
-
getAprioriItemDelta
public static <AH extends AssignmentHolderType> ItemDelta getAprioriItemDelta(ObjectDelta<AH> focusDelta, ItemPath itemPath) -
setMappingTarget
@NotNull public static <M extends MappingType> M setMappingTarget(@NotNull M mapping, ItemPathType path) -
rejectNonTolerantSettingIfPresent
public static void rejectNonTolerantSettingIfPresent(ObjectTemplateItemDefinitionType templateItemDefinition, ItemPath itemPath, String contextDescription) -
createConditionDefinition
-
createDiscriminatorBean
public static ShadowDiscriminatorType createDiscriminatorBean(ProjectionContextKey key, LensContext<?> lensContext) -
cloneResolveResource
public static AssignmentType cloneResolveResource(AssignmentType assignmentBean, LensContext<?> lensContext)
-