Class RoleAnalysisServiceImpl
java.lang.Object
com.evolveum.midpoint.model.impl.mining.RoleAnalysisServiceImpl
- All Implemented Interfaces:
RoleAnalysisService
,Serializable
@Component
public class RoleAnalysisServiceImpl
extends Object
implements RoleAnalysisService, Serializable
Utility methods for working with role analysis objects in the Midpoint system.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCandidateRole
(@NotNull String clusterRefOid, @NotNull RoleAnalysisCandidateRoleType candidateRole, @NotNull Task task, @NotNull OperationResult result) This method is used to add candidate roles to the cluster.void
anylseAttributesAndReplaceDetectionPattern
(@NotNull String clusterOid, @NotNull List<DetectedPattern> detectedPatterns, @NotNull Task task, @NotNull OperationResult result) Replaces the detected patterns of a RoleAnalysisClusterType object.@Nullable PrismObject<RoleType>
cacheRoleTypeObject
(@NotNull Map<String, PrismObject<RoleType>> roleExistCache, @NotNull String roleOid, @NotNull Task task, @NotNull OperationResult result, @Nullable RoleAnalysisCacheOption option) Retrieves a RoleType PrismObject from a cache or, if not present, fetches it from the ModelService and stores it in the cache.@Nullable PrismObject<UserType>
cacheUserTypeObject
(@NotNull Map<String, PrismObject<UserType>> userExistCache, @NotNull String userOid, @NotNull Task task, @NotNull OperationResult result, @Nullable RoleAnalysisCacheOption option) Retrieves a UserType PrismObject from a cache or, if not present, fetches it from the ModelService and stores it in the cache.calculateAttributeConfidence
(@NotNull RoleAnalysisProcessModeType processModeType, @NotNull AnalysisClusterStatisticType clusterStatistics) Calculates the confidence of an attribute based on the specified process mode and cluster statistics.void
clusterObjectMigrationRecompute
(@NotNull String clusterRefOid, @NotNull String roleRefOid, @NotNull Task task, @NotNull OperationResult result) Recompute role analysis cluster (RoleAnalysisClusterType) parameters.<T extends ObjectType>
IntegercountObjects
(@NotNull Class<T> type, @Nullable ObjectQuery query, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull Task task, @NotNull OperationResult parentResult) Retrieves the attribute definition for a specific attribute path.@NotNull Integer
countSessionTypeObjects
(@NotNull Task task, @NotNull OperationResult result) Retrieves the number of RoleAnalysisSessionType objects in the system.@NotNull Integer
countUserTypeMembers
(@Nullable ObjectFilter userFilter, @NotNull String objectId, @NotNull Task task, @NotNull OperationResult result) Counts the number of members of a RoleType object.void
deleteCluster
(@NotNull RoleAnalysisClusterType cluster, @NotNull Task task, @NotNull OperationResult result) Deletes a single RoleAnalysisClusterType object.void
deleteSession
(@NotNull String sessionOid, @NotNull Task task, @NotNull OperationResult result) Deletes a single RoleAnalysisSessionType object.void
deleteSessionClustersMembers
(@NotNull String sessionOid, @NotNull Task task, @NotNull OperationResult result) Deletes all RoleAnalysisClusterType objects associated with a specific session.void
deleteSingleCandidateRole
(@NotNull PrismObject<RoleAnalysisClusterType> clusterPrism, @NotNull RoleAnalysisCandidateRoleType candidateRoleBean, @NotNull OperationResult result, Task task) Deletes a single candidate role from the specified role analysis cluster.void
executeChangesOnCandidateRole
(@NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull RoleAnalysisCandidateRoleType roleAnalysisCandidateRoleType, @NotNull Set<PrismObject<UserType>> members, @NotNull Set<AssignmentType> inducements, @NotNull Task task, @NotNull OperationResult result) Executes changes on the candidate role within the specified role analysis cluster.void
executeClusteringTask
(@NotNull ModelInteractionService modelInteractionService, @NotNull PrismObject<RoleAnalysisSessionType> session, @Nullable String taskOid, @Nullable PolyStringType taskName, @NotNull Task task, @NotNull OperationResult result) This method is used to execute a clustering task.void
executeDetectionTask
(@NotNull ModelInteractionService modelInteractionService, @NotNull PrismObject<RoleAnalysisClusterType> cluster, @Nullable String taskOid, @Nullable PolyStringType taskName, @NotNull Task task, @NotNull OperationResult result) This method is used to execute a detection task.void
executeMigrationTask
(@NotNull ModelInteractionService modelInteractionService, @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull ActivityDefinitionType activityDefinition, @NotNull PrismObject<RoleType> roleObject, @Nullable String taskOid, @Nullable PolyStringType taskName, @NotNull Task task, @NotNull OperationResult result) This method is used to execute a migration task.extractUserTypeMembers
(@NotNull Map<String, PrismObject<UserType>> userExistCache, @Nullable ObjectFilter userFilter, @NotNull Set<String> clusterMembers, @NotNull Task task, @NotNull OperationResult result) Extracts a list of user members from set of RoleType object based on provided parameters.@NotNull PrismObject<RoleType>
generateBusinessRole
(@NotNull Set<AssignmentType> assignmentTypes, @NotNull PolyStringType name) Retrieves a RoleType object that represents a business role.@NotNull Set<ObjectReferenceType>
generateObjectReferences
(@NotNull Set<String> objects, @NotNull QName complexType, @NotNull Task task, @NotNull OperationResult operationResult) Generates a set of object references based on a provided parameters.@Nullable PrismObject<RoleAnalysisClusterType>
getClusterTypeObject
(@NotNull String oid, @NotNull Task task, @NotNull OperationResult result) Retrieves a PrismObject of RoleAnalysisClusterType object based on its OID.@Nullable PrismObject<FocusType>
getFocusTypeObject
(@NotNull String oid, @NotNull Task task, @NotNull OperationResult result) Retrieves a PrismObject of FocusType object based on its OID.<T extends ObjectType>
@Nullable PrismObject<T>getObject
(@NotNull Class<T> objectTypeClass, @NotNull String oid, @NotNull Task task, @NotNull OperationResult result) Retrieves a PrismObject based on its OID.@Nullable PrismObject<RoleType>
getRoleTypeObject
(@NotNull String oid, @NotNull Task task, @NotNull OperationResult result) Retrieves a PrismObject of RoleType object based on its OID.@Nullable PrismObject<RoleAnalysisSessionType>
getSessionTypeObject
(@NotNull String oid, @NotNull Task task, @NotNull OperationResult result) Retrieves a PrismObject of RoleAnalysisSessionType object based on its OID.@NotNull AnalysisClusterStatisticType
getUpdatedAnalysisClusterStatistic
(double maxReduction, @NotNull AnalysisClusterStatisticType clusterStatistics) @Nullable PrismObject<UserType>
getUserTypeObject
(@NotNull String oid, @NotNull Task task, @NotNull OperationResult result) Retrieves a PrismObject of UserType object based on its OID.void
importCluster
(@NotNull PrismObject<RoleAnalysisClusterType> clusterPrismObject, @NotNull RoleAnalysisDetectionOptionType roleAnalysisSessionDetectionOption, @NotNull ObjectReferenceType parentRef, @NotNull Task task, @NotNull OperationResult result) Imports a RoleAnalysisClusterType object into the system.<T extends ObjectType>
voidloadSearchObjectIterative
(@NotNull ModelService modelService, @NotNull Class<T> type, @Nullable ObjectQuery query, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull List<T> modifyList, @NotNull Task task, @NotNull OperationResult parentResult) Loads objects iteratively from the repository based on the provided query and adds them to the modifyList if they are not already present.@NotNull MiningOperationChunk
prepareCompressedMiningStructure
(@NotNull RoleAnalysisClusterType cluster, boolean fullProcess, @NotNull RoleAnalysisProcessModeType processMode, @NotNull OperationResult result, @NotNull Task task) Method for preparing a compressed mining structure for role analysis.@NotNull MiningOperationChunk
prepareExpandedMiningStructure
(@NotNull RoleAnalysisClusterType cluster, boolean fullProcess, @NotNull RoleAnalysisProcessModeType processMode, @NotNull OperationResult result, @NotNull Task task, @Nullable DisplayValueOption option) Method for preparing an expanded mining structure for role analysis.@NotNull MiningOperationChunk
prepareMiningStructure
(@NotNull RoleAnalysisClusterType cluster, @NotNull DisplayValueOption option, @NotNull RoleAnalysisProcessModeType processMode, @NotNull OperationResult result, @NotNull Task task) Method for preparing a mining structure for role analysis.@NotNull String
recomputeAndResolveClusterCandidateRoleOpStatus
(@NotNull PrismObject<RoleAnalysisClusterType> clusterPrismObject, @NotNull RoleAnalysisCandidateRoleType candidateRole, @NotNull OperationResult result, Task task) Recomputes and resolves the operation status for the candidate role within the specified cluster.@NotNull String
recomputeAndResolveClusterOpStatus
(@NotNull String clusterOid, @NotNull OperationResult result, @NotNull Task task) Recompute and resolve the cluster operation status.@NotNull String
recomputeAndResolveSessionOpStatus
(@NotNull PrismObject<RoleAnalysisSessionType> sessionPrismObject, @NotNull OperationResult result, @NotNull Task task) Recompute and resolve the cluster operation status.void
recomputeClusterDetectionOptions
(@NotNull String clusterOid, @NotNull DetectionOption detectionOption, @NotNull Task task, @NotNull OperationResult result) Recompute the detection options of a RoleAnalysisClusterType object.void
recomputeSessionStatics
(@NotNull String sessionOid, @NotNull RoleAnalysisClusterType roleAnalysisClusterType, @NotNull Task task, @NotNull OperationResult result) Recomputes the statistics of a RoleAnalysisSessionType object.@Nullable List<RoleAnalysisAttributeDef>
resolveAnalysisAttributes
(@NotNull RoleAnalysisSessionType session, @NotNull QName complexType) Resolves the analysis attributes based on the provided session and complex type.resolveClusterOptionType
(@NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull Task task, @NotNull OperationResult result) Resolves the process mode of a RoleAnalysisClusterType object based on role analysis session.void
resolveDetectedPatternsAttributes
(@NotNull List<RoleAnalysisDetectionPatternType> detectedPatterns, @NotNull Map<String, PrismObject<UserType>> userExistCache, @NotNull Map<String, PrismObject<RoleType>> roleExistCache, @NotNull Task task, @NotNull OperationResult result, @NotNull List<RoleAnalysisAttributeDef> attributeRoleDefSet, @NotNull List<RoleAnalysisAttributeDef> attributeUserDefSet) Processes attribute analysis for the detected patterns.resolveFocusObjectIconColor
(@NotNull FocusType focusObject, @NotNull Task task, @NotNull OperationResult result) Resolves the focus object icon color based on the provided focus object archetype.roleMembersAttributeAnalysis
(@NotNull List<RoleAnalysisAttributeDef> attributeDefSet, @NotNull String objectOid, @NotNull Task task, @NotNull OperationResult result) Performs attribute analysis for role members.roleTypeAttributeAnalysis
(@NotNull Set<PrismObject<RoleType>> prismRoles, Double membershipDensity, @NotNull Task task, @NotNull OperationResult result, @NotNull List<RoleAnalysisAttributeDef> attributeRoleDefSet) Performs attribute analysis for role objects.searchSessionClusters
(@NotNull RoleAnalysisSessionType session, @NotNull Task task, @NotNull OperationResult result) Searches for clusters associated with a specific role analysis session.void
setCandidateRoleOpStatus
(@NotNull PrismObject<RoleAnalysisClusterType> clusterPrism, @NotNull RoleAnalysisCandidateRoleType candidateRoleContainer, @NotNull String taskOid, @Nullable OperationResultStatusType operationResultStatusType, @Nullable String message, @NotNull OperationResult result, @NotNull Task task, @NotNull RoleAnalysisOperation operationType, @Nullable FocusType focus) Sets the operation status of a candidate role within the specified role analysis cluster.void
updateClusterPatterns
(@NotNull String clusterRefOid, @NotNull Task task, @NotNull OperationResult result) This method is used to update the cluster detected patterns.void
updateSessionStatistics
(@NotNull ObjectReferenceType sessionRef, @NotNull RoleAnalysisSessionStatisticType sessionStatistic, @NotNull Task task, @NotNull OperationResult result) Modifies statistics of a RoleAnalysisSessionType object.userRolesAttributeAnalysis
(@NotNull List<RoleAnalysisAttributeDef> attributeRoleDefSet, @NotNull String objectOid, @NotNull Task task, @NotNull OperationResult result) Performs attribute analysis for user roles.userTypeAttributeAnalysis
(@NotNull Set<PrismObject<UserType>> prismUsers, Double membershipDensity, @NotNull Task task, @NotNull OperationResult result, @NotNull List<RoleAnalysisAttributeDef> attributeDefSet) Performs attribute analysis for user objects.
-
Constructor Details
-
RoleAnalysisServiceImpl
public RoleAnalysisServiceImpl()
-
-
Method Details
-
getUserTypeObject
@Nullable public @Nullable PrismObject<UserType> getUserTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves a PrismObject of UserType object based on its OID.- Specified by:
getUserTypeObject
in interfaceRoleAnalysisService
- Parameters:
oid
- The OID of the UserType object to retrieve.task
- The task associated with this operation.result
- The operation result.- Returns:
- The PrismObject of UserType object, or null if not found.
-
getFocusTypeObject
@Nullable public @Nullable PrismObject<FocusType> getFocusTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves a PrismObject of FocusType object based on its OID.- Specified by:
getFocusTypeObject
in interfaceRoleAnalysisService
- Parameters:
oid
- The OID of the FocusType object to retrieve.task
- The task associated with this operation.result
- The operation result.- Returns:
- The PrismObject of FocusType object, or null if not found.
-
getRoleTypeObject
@Nullable public @Nullable PrismObject<RoleType> getRoleTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves a PrismObject of RoleType object based on its OID.- Specified by:
getRoleTypeObject
in interfaceRoleAnalysisService
- Parameters:
oid
- The OID of the RoleType object to retrieve.task
- The task associated with this operation.result
- The operation result.- Returns:
- The PrismObject of RoleType object, or null if not found.
-
getClusterTypeObject
@Nullable public @Nullable PrismObject<RoleAnalysisClusterType> getClusterTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves a PrismObject of RoleAnalysisClusterType object based on its OID.- Specified by:
getClusterTypeObject
in interfaceRoleAnalysisService
- Parameters:
oid
- The OID of the RoleAnalysisClusterType object to retrieve.task
- The task associated with this operation.result
- The operation result.- Returns:
- The PrismObject of RoleAnalysisClusterType object, or null if not found.
-
getSessionTypeObject
@Nullable public @Nullable PrismObject<RoleAnalysisSessionType> getSessionTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves a PrismObject of RoleAnalysisSessionType object based on its OID.- Specified by:
getSessionTypeObject
in interfaceRoleAnalysisService
- Parameters:
oid
- The OID of the RoleAnalysisSessionType object to retrieve.task
- The task associated with this operation.result
- The operation result.- Returns:
- The PrismObject of RoleAnalysisSessionType object, or null if not found.
-
getObject
@Nullable public <T extends ObjectType> @Nullable PrismObject<T> getObject(@NotNull @NotNull Class<T> objectTypeClass, @NotNull @NotNull String oid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves a PrismObject based on its OID.- Specified by:
getObject
in interfaceRoleAnalysisService
oid
- The OID of the object to retrieve.task
- The task associated with this operation.result
- The operation result.- Returns:
- The PrismObject of object, or null if not found.
-
countSessionTypeObjects
@NotNull public @NotNull Integer countSessionTypeObjects(@NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Retrieves the number of RoleAnalysisSessionType objects in the system.- Specified by:
countSessionTypeObjects
in interfaceRoleAnalysisService
- Parameters:
task
- The task associated with this operation.result
- The operation result.- Returns:
- The number of RoleAnalysisSessionType objects in the system.
-
extractUserTypeMembers
@NotNull public @NotNull com.google.common.collect.ListMultimap<String,String> extractUserTypeMembers(@NotNull @NotNull Map<String, PrismObject<UserType>> userExistCache, @Nullable @Nullable ObjectFilter userFilter, @NotNull @NotNull Set<String> clusterMembers, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Extracts a list of user members from set of RoleType object based on provided parameters.- Specified by:
extractUserTypeMembers
in interfaceRoleAnalysisService
- Parameters:
userExistCache
- The cache of user objects.userFilter
- The UserType filter.clusterMembers
- The set of cluster members.task
- The task associated with this operation.result
- The operation result.- Returns:
- A list of user members.
-
importCluster
public void importCluster(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> clusterPrismObject, @NotNull @NotNull RoleAnalysisDetectionOptionType roleAnalysisSessionDetectionOption, @NotNull @NotNull ObjectReferenceType parentRef, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Imports a RoleAnalysisClusterType object into the system.- Specified by:
importCluster
in interfaceRoleAnalysisService
- Parameters:
clusterPrismObject
- The cluster for importing.roleAnalysisSessionDetectionOption
- The session detection option.parentRef
- The parent Role analysis session reference.task
- The task associated with this operation.result
- The operation result.
-
updateSessionStatistics
public void updateSessionStatistics(@NotNull @NotNull ObjectReferenceType sessionRef, @NotNull @NotNull RoleAnalysisSessionStatisticType sessionStatistic, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Modifies statistics of a RoleAnalysisSessionType object.- Specified by:
updateSessionStatistics
in interfaceRoleAnalysisService
- Parameters:
sessionRef
- The session reference.sessionStatistic
- The session statistic to modify.task
- The task associated with this operation.result
- The operation result.
-
anylseAttributesAndReplaceDetectionPattern
public void anylseAttributesAndReplaceDetectionPattern(@NotNull @NotNull String clusterOid, @NotNull @NotNull List<DetectedPattern> detectedPatterns, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Replaces the detected patterns of a RoleAnalysisClusterType object.- Specified by:
anylseAttributesAndReplaceDetectionPattern
in interfaceRoleAnalysisService
- Parameters:
clusterOid
- The cluster OID.detectedPatterns
- The detected patterns to replace.task
- The task associated with this operation.result
- The operation result.
-
getUpdatedAnalysisClusterStatistic
@NotNull public @NotNull AnalysisClusterStatisticType getUpdatedAnalysisClusterStatistic(double maxReduction, @NotNull @NotNull AnalysisClusterStatisticType clusterStatistics) - Specified by:
getUpdatedAnalysisClusterStatistic
in interfaceRoleAnalysisService
-
generateObjectReferences
@NotNull public @NotNull Set<ObjectReferenceType> generateObjectReferences(@NotNull @NotNull Set<String> objects, @NotNull @NotNull QName complexType, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult operationResult) Description copied from interface:RoleAnalysisService
Generates a set of object references based on a provided parameters.- Specified by:
generateObjectReferences
in interfaceRoleAnalysisService
- Parameters:
objects
- The objects to create references for.complexType
- The complex type of the objects.task
- The task associated with this operation.operationResult
- The operation result.- Returns:
- A set of object references.
-
deleteSessionClustersMembers
public void deleteSessionClustersMembers(@NotNull @NotNull String sessionOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Deletes all RoleAnalysisClusterType objects associated with a specific session.- Specified by:
deleteSessionClustersMembers
in interfaceRoleAnalysisService
- Parameters:
sessionOid
- The session OID.task
- The task associated with this operation.result
- The operation result.
-
deleteCluster
public void deleteCluster(@NotNull @NotNull RoleAnalysisClusterType cluster, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Deletes a single RoleAnalysisClusterType object.- Specified by:
deleteCluster
in interfaceRoleAnalysisService
- Parameters:
cluster
- The cluster to delete.task
- The task associated with this operation.result
- The operation result.
-
recomputeSessionStatics
public void recomputeSessionStatics(@NotNull @NotNull String sessionOid, @NotNull @NotNull RoleAnalysisClusterType roleAnalysisClusterType, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Recomputes the statistics of a RoleAnalysisSessionType object.- Specified by:
recomputeSessionStatics
in interfaceRoleAnalysisService
- Parameters:
sessionOid
- The session OID.roleAnalysisClusterType
- The cluster to recompute statistics for.task
- The task associated with this operation.result
- The operation result.
-
cacheRoleTypeObject
@Nullable public @Nullable PrismObject<RoleType> cacheRoleTypeObject(@NotNull @NotNull Map<String, PrismObject<RoleType>> roleExistCache, @NotNull @NotNull String roleOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @Nullable @Nullable RoleAnalysisCacheOption option) Description copied from interface:RoleAnalysisService
Retrieves a RoleType PrismObject from a cache or, if not present, fetches it from the ModelService and stores it in the cache.- Specified by:
cacheRoleTypeObject
in interfaceRoleAnalysisService
- Parameters:
roleExistCache
- A cache storing previously fetched RoleType PrismObjects.roleOid
- The OID of the RoleType PrismObject to retrieve.task
- The task associated with the operation.result
- The operation result.option
- The cache option.- Returns:
- The RoleType PrismObject fetched from the cache or ModelService, or null if not found.
-
cacheUserTypeObject
@Nullable public @Nullable PrismObject<UserType> cacheUserTypeObject(@NotNull @NotNull Map<String, PrismObject<UserType>> userExistCache, @NotNull @NotNull String userOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @Nullable @Nullable RoleAnalysisCacheOption option) Description copied from interface:RoleAnalysisService
Retrieves a UserType PrismObject from a cache or, if not present, fetches it from the ModelService and stores it in the cache.- Specified by:
cacheUserTypeObject
in interfaceRoleAnalysisService
- Parameters:
userExistCache
- A cache storing previously fetched UserType PrismObjects.userOid
- The OID of the UserType PrismObject to retrieve.task
- The task associated with the operation.result
- The operation result.option
- The cache option.- Returns:
- The UserType PrismObject fetched from the cache or ModelService, or null if not found.
-
countUserTypeMembers
@NotNull public @NotNull Integer countUserTypeMembers(@Nullable @Nullable ObjectFilter userFilter, @NotNull @NotNull String objectId, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Counts the number of members of a RoleType object.- Specified by:
countUserTypeMembers
in interfaceRoleAnalysisService
- Parameters:
userFilter
- The UserType filter.objectId
- The OID of the RoleType object.task
- The task associated with this operation.result
- The operation result.- Returns:
- The number of user members of a RoleType object.
-
generateBusinessRole
@NotNull public @NotNull PrismObject<RoleType> generateBusinessRole(@NotNull @NotNull Set<AssignmentType> assignmentTypes, @NotNull @NotNull PolyStringType name) Description copied from interface:RoleAnalysisService
Retrieves a RoleType object that represents a business role.- Specified by:
generateBusinessRole
in interfaceRoleAnalysisService
- Parameters:
assignmentTypes
- The assignment types that represent inducements of the business role.name
- The name of the business role.- Returns:
- The PrismObject of RoleType object.
-
deleteSession
public void deleteSession(@NotNull @NotNull String sessionOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Deletes a single RoleAnalysisSessionType object.- Specified by:
deleteSession
in interfaceRoleAnalysisService
- Parameters:
sessionOid
- The role analysis session OID.task
- The task associated with this operation.result
- The operation result.
-
resolveClusterOptionType
public RoleAnalysisOptionType resolveClusterOptionType(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Resolves the process mode of a RoleAnalysisClusterType object based on role analysis session.- Specified by:
resolveClusterOptionType
in interfaceRoleAnalysisService
- Parameters:
cluster
- The cluster to resolve the process mode for.task
- The task associated with this operation.result
- The operation result.- Returns:
- The resolved process mode.
-
recomputeClusterDetectionOptions
public void recomputeClusterDetectionOptions(@NotNull @NotNull String clusterOid, @NotNull @NotNull DetectionOption detectionOption, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Recompute the detection options of a RoleAnalysisClusterType object.- Specified by:
recomputeClusterDetectionOptions
in interfaceRoleAnalysisService
- Parameters:
clusterOid
- The cluster OID.detectionOption
- The detection option to recompute.task
- The task associated with this operation.result
- The operation result.
-
prepareCompressedMiningStructure
@NotNull public @NotNull MiningOperationChunk prepareCompressedMiningStructure(@NotNull @NotNull RoleAnalysisClusterType cluster, boolean fullProcess, @NotNull @NotNull RoleAnalysisProcessModeType processMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull Task task) Description copied from interface:RoleAnalysisService
Method for preparing a compressed mining structure for role analysis.- Specified by:
prepareCompressedMiningStructure
in interfaceRoleAnalysisService
- Parameters:
cluster
- The cluster for which the mining structure is prepared.fullProcess
- The full process flag. If true, the entire structure is prepared. If false, only a partial structure (members) is prepared.processMode
- The process mode.result
- The operation result.task
- The task associated with this operation.- Returns:
- A MiningOperationChunk containing user and role chunks for further processing.
-
prepareMiningStructure
@NotNull public @NotNull MiningOperationChunk prepareMiningStructure(@NotNull @NotNull RoleAnalysisClusterType cluster, @NotNull @NotNull DisplayValueOption option, @NotNull @NotNull RoleAnalysisProcessModeType processMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull Task task) Description copied from interface:RoleAnalysisService
Method for preparing a mining structure for role analysis.- Specified by:
prepareMiningStructure
in interfaceRoleAnalysisService
- Parameters:
cluster
- The cluster for which the mining structure is prepared.option
- The display value option.processMode
- The process mode.result
- The operation result.task
- The task associated with this operation.- Returns:
- A MiningOperationChunk containing user and role chunks for further processing.
-
prepareExpandedMiningStructure
@NotNull public @NotNull MiningOperationChunk prepareExpandedMiningStructure(@NotNull @NotNull RoleAnalysisClusterType cluster, boolean fullProcess, @NotNull @NotNull RoleAnalysisProcessModeType processMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull Task task, @Nullable @Nullable DisplayValueOption option) Description copied from interface:RoleAnalysisService
Method for preparing an expanded mining structure for role analysis.- Specified by:
prepareExpandedMiningStructure
in interfaceRoleAnalysisService
- Parameters:
cluster
- The cluster for which the mining structure is prepared.fullProcess
- The full process flag. If true, the entire structure is prepared. If false, only a partial structure (members) is prepared.processMode
- The process mode.result
- The operation result.task
- The task associated with this operation.option
- The display value option.- Returns:
- A MiningOperationChunk containing user and role chunks for further processing.
-
clusterObjectMigrationRecompute
public void clusterObjectMigrationRecompute(@NotNull @NotNull String clusterRefOid, @NotNull @NotNull String roleRefOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Recompute role analysis cluster (RoleAnalysisClusterType) parameters. This method should be called after migration to business role.- Specified by:
clusterObjectMigrationRecompute
in interfaceRoleAnalysisService
- Parameters:
clusterRefOid
- The cluster OID.roleRefOid
- The role OID.task
- The task associated with this operation.result
- The operation result.
-
updateClusterPatterns
public void updateClusterPatterns(@NotNull @NotNull String clusterRefOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
This method is used to update the cluster detected patterns. Currently, it is used to update the cluster detected patterns after the migration task in the cluster.- Specified by:
updateClusterPatterns
in interfaceRoleAnalysisService
- Parameters:
clusterRefOid
- The cluster OID.task
- The task associated with this operation.result
- The operation result.
-
executeClusteringTask
public void executeClusteringTask(@NotNull @NotNull ModelInteractionService modelInteractionService, @NotNull @NotNull PrismObject<RoleAnalysisSessionType> session, @Nullable @Nullable String taskOid, @Nullable @Nullable PolyStringType taskName, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
This method is used to execute a clustering task. It creates a new cluster and stores it in the session.- Specified by:
executeClusteringTask
in interfaceRoleAnalysisService
- Parameters:
modelInteractionService
- The model interaction service.session
- The session under which the clustering task is executed.taskOid
- The OID of the task.taskName
- The name of the task.task
- The task associated with this operation.result
- The operation result.
-
executeDetectionTask
public void executeDetectionTask(@NotNull @NotNull ModelInteractionService modelInteractionService, @NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @Nullable @Nullable String taskOid, @Nullable @Nullable PolyStringType taskName, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
This method is used to execute a detection task. Detected patterns are stored in the cluster.- Specified by:
executeDetectionTask
in interfaceRoleAnalysisService
- Parameters:
modelInteractionService
- The model interaction service.cluster
- The cluster under which the detection task is executed.taskOid
- The OID of the task.taskName
- The name of the task.task
- The task associated with this operation.result
- The operation result.
-
executeMigrationTask
public void executeMigrationTask(@NotNull @NotNull ModelInteractionService modelInteractionService, @NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull @NotNull ActivityDefinitionType activityDefinition, @NotNull @NotNull PrismObject<RoleType> roleObject, @Nullable @Nullable String taskOid, @Nullable @Nullable PolyStringType taskName, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
This method is used to execute a migration task. It replaces the role assignment with business role assignment.- Specified by:
executeMigrationTask
in interfaceRoleAnalysisService
- Parameters:
modelInteractionService
- The model interaction service.cluster
- The cluster under which the migration task is executed.activityDefinition
- The activity definition.roleObject
- The role object for migration.taskOid
- The OID of the task.taskName
- The name of the task.task
- The task associated with this operation.result
- The operation result.
-
recomputeAndResolveClusterOpStatus
@NotNull public @NotNull String recomputeAndResolveClusterOpStatus(@NotNull @NotNull String clusterOid, @NotNull @NotNull OperationResult result, @NotNull @NotNull Task task) Description copied from interface:RoleAnalysisService
Recompute and resolve the cluster operation status. This method also update the cluster operation status if detect some changes.- Specified by:
recomputeAndResolveClusterOpStatus
in interfaceRoleAnalysisService
- Parameters:
clusterOid
- The cluster for recompute and resolve.result
- The operation result.task
- The task associated with this operation.- Returns:
- The cluster operation status.
-
recomputeAndResolveSessionOpStatus
@NotNull public @NotNull String recomputeAndResolveSessionOpStatus(@NotNull @NotNull PrismObject<RoleAnalysisSessionType> sessionPrismObject, @NotNull @NotNull OperationResult result, @NotNull @NotNull Task task) Description copied from interface:RoleAnalysisService
Recompute and resolve the cluster operation status. This method also update the cluster operation status if detect some changes.- Specified by:
recomputeAndResolveSessionOpStatus
in interfaceRoleAnalysisService
- Parameters:
sessionPrismObject
- The cluster for recompute and resolve.result
- The operation result.task
- The task associated with this operation.- Returns:
- The cluster operation status.
-
recomputeAndResolveClusterCandidateRoleOpStatus
@NotNull public @NotNull String recomputeAndResolveClusterCandidateRoleOpStatus(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> clusterPrismObject, @NotNull @NotNull RoleAnalysisCandidateRoleType candidateRole, @NotNull @NotNull OperationResult result, Task task) Description copied from interface:RoleAnalysisService
Recomputes and resolves the operation status for the candidate role within the specified cluster.- Specified by:
recomputeAndResolveClusterCandidateRoleOpStatus
in interfaceRoleAnalysisService
- Parameters:
clusterPrismObject
- PrismObject representing the role analysis cluster.candidateRole
- RoleAnalysisCandidateRoleType representing the candidate role.result
- OperationResult containing the result of the operation.task
- Task used for executing the operation.- Returns:
- A string representing the display status of the candidate role after recompute and resolution.
-
setCandidateRoleOpStatus
public void setCandidateRoleOpStatus(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> clusterPrism, @NotNull @NotNull RoleAnalysisCandidateRoleType candidateRoleContainer, @NotNull @NotNull String taskOid, @Nullable @Nullable OperationResultStatusType operationResultStatusType, @Nullable @Nullable String message, @NotNull @NotNull OperationResult result, @NotNull @NotNull Task task, @NotNull @NotNull RoleAnalysisOperation operationType, @Nullable @Nullable FocusType focus) Description copied from interface:RoleAnalysisService
Sets the operation status of a candidate role within the specified role analysis cluster.- Specified by:
setCandidateRoleOpStatus
in interfaceRoleAnalysisService
- Parameters:
clusterPrism
- PrismObject representing the role analysis cluster.candidateRoleContainer
- RoleAnalysisCandidateRoleType representing the candidate role container.taskOid
- String representing the OID of the task associated with the operation status.operationResultStatusType
- OperationResultStatusType representing the status of the operation.message
- String containing the message associated with the operation status.result
- OperationResult containing the result of the operation.task
- Task used for executing the operation.operationType
- RoleAnalysisOperation representing the type of operation.focus
- FocusType representing the focus type associated with the operation status.
-
addCandidateRole
public void addCandidateRole(@NotNull @NotNull String clusterRefOid, @NotNull @NotNull RoleAnalysisCandidateRoleType candidateRole, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
This method is used to add candidate roles to the cluster.- Specified by:
addCandidateRole
in interfaceRoleAnalysisService
- Parameters:
clusterRefOid
- The cluster OID.candidateRole
- The candidate role OID.task
- The task associated with this operation.result
- The operation result.
-
deleteSingleCandidateRole
public void deleteSingleCandidateRole(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> clusterPrism, @NotNull @NotNull RoleAnalysisCandidateRoleType candidateRoleBean, @NotNull @NotNull OperationResult result, Task task) Description copied from interface:RoleAnalysisService
Deletes a single candidate role from the specified role analysis cluster.- Specified by:
deleteSingleCandidateRole
in interfaceRoleAnalysisService
- Parameters:
clusterPrism
- PrismObject representing the role analysis cluster.candidateRoleBean
- RoleAnalysisCandidateRoleType representing the candidate role to be deleted.result
- OperationResult containing the result of the deletion operation.task
- Task used for executing the deletion operation.
-
executeChangesOnCandidateRole
public void executeChangesOnCandidateRole(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull @NotNull RoleAnalysisCandidateRoleType roleAnalysisCandidateRoleType, @NotNull @NotNull Set<PrismObject<UserType>> members, @NotNull @NotNull Set<AssignmentType> inducements, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Executes changes on the candidate role within the specified role analysis cluster.- Specified by:
executeChangesOnCandidateRole
in interfaceRoleAnalysisService
- Parameters:
cluster
- PrismObject representing the role analysis cluster.roleAnalysisCandidateRoleType
- RoleAnalysisCandidateRoleType representing the candidate role container.members
- Set of PrismObject representing the members to be assigned to the candidate role.inducements
- Set of AssignmentType representing the inducements to be added to the candidate role.task
- Task used for executing the operation.result
- OperationResult containing the result of the operation.
-
loadSearchObjectIterative
public <T extends ObjectType> void loadSearchObjectIterative(@NotNull @NotNull ModelService modelService, @NotNull @NotNull Class<T> type, @Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull List<T> modifyList, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) Description copied from interface:RoleAnalysisService
Loads objects iteratively from the repository based on the provided query and adds them to the modifyList if they are not already present.- Specified by:
loadSearchObjectIterative
in interfaceRoleAnalysisService
- Type Parameters:
T
- Generic type extending ObjectType representing the type of objects to be loaded.- Parameters:
modelService
- ModelService used for loading the objects from the repository.type
- Class representing the type of objects to be loaded.query
- ObjectQuery specifying the conditions for searching the objects. Can be null.options
- Collection of SelectorOptions specifying additional options for the search operation. Can be null.modifyList
- List of loaded objects will be added. Objects already present in this list will be skipped.task
- Task used for executing the search operation.parentResult
- OperationResult containing the result of the operation.
-
userTypeAttributeAnalysis
public List<AttributeAnalysisStructure> userTypeAttributeAnalysis(@NotNull @NotNull Set<PrismObject<UserType>> prismUsers, Double membershipDensity, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull List<RoleAnalysisAttributeDef> attributeDefSet) Description copied from interface:RoleAnalysisService
Performs attribute analysis for user objects.- Specified by:
userTypeAttributeAnalysis
in interfaceRoleAnalysisService
- Parameters:
prismUsers
- Set of PrismObject representing user objects to analyze.membershipDensity
- The density of membership.task
- Task used for processing the attribute analysis.result
- OperationResult containing the result of the operation.attributeDefSet
- List of RoleAnalysisAttributeDef containing the attribute definitions for user analysis.- Returns:
- List of AttributeAnalysisStructure containing the results of the attribute analysis.
-
roleTypeAttributeAnalysis
public List<AttributeAnalysisStructure> roleTypeAttributeAnalysis(@NotNull @NotNull Set<PrismObject<RoleType>> prismRoles, Double membershipDensity, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull List<RoleAnalysisAttributeDef> attributeRoleDefSet) Description copied from interface:RoleAnalysisService
Performs attribute analysis for role objects.- Specified by:
roleTypeAttributeAnalysis
in interfaceRoleAnalysisService
- Parameters:
prismRoles
- Set of PrismObject representing role objects to analyze.membershipDensity
- The density of membership.task
- Task used for processing the attribute analysis.result
- OperationResult containing the result of the operation.attributeRoleDefSet
- List of RoleAnalysisAttributeDef containing the attribute definitions for role analysis.- Returns:
- List of AttributeAnalysisStructure containing the results of the attribute analysis.
-
roleMembersAttributeAnalysis
public List<AttributeAnalysisStructure> roleMembersAttributeAnalysis(@NotNull @NotNull List<RoleAnalysisAttributeDef> attributeDefSet, @NotNull @NotNull String objectOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Performs attribute analysis for role members.- Specified by:
roleMembersAttributeAnalysis
in interfaceRoleAnalysisService
- Parameters:
attributeDefSet
- List of RoleAnalysisAttributeDef containing the attribute definitions for analysis.objectOid
- The OID of the object to analyze.task
- Task used for processing the attribute analysis.result
- OperationResult containing the result of the operation.- Returns:
- List of AttributeAnalysisStructure containing the results of the attribute analysis.
-
userRolesAttributeAnalysis
public List<AttributeAnalysisStructure> userRolesAttributeAnalysis(@NotNull @NotNull List<RoleAnalysisAttributeDef> attributeRoleDefSet, @NotNull @NotNull String objectOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Performs attribute analysis for user roles.- Specified by:
userRolesAttributeAnalysis
in interfaceRoleAnalysisService
- Parameters:
attributeRoleDefSet
- List of RoleAnalysisAttributeDef containing the attribute definitions for role analysis.objectOid
- The OID of the object to analyze.task
- Task used for processing the attribute analysis.result
- OperationResult containing the result of the operation.- Returns:
- List of AttributeAnalysisStructure containing the results of the attribute analysis.
-
resolveDetectedPatternsAttributes
public void resolveDetectedPatternsAttributes(@NotNull @NotNull List<RoleAnalysisDetectionPatternType> detectedPatterns, @NotNull @NotNull Map<String, PrismObject<UserType>> userExistCache, @NotNull @NotNull Map<String, PrismObject<RoleType>> roleExistCache, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull List<RoleAnalysisAttributeDef> attributeRoleDefSet, @NotNull @NotNull List<RoleAnalysisAttributeDef> attributeUserDefSet) Description copied from interface:RoleAnalysisService
Processes attribute analysis for the detected patterns. This method analyzes attribute usage patterns for both users and roles in the detected patterns. It retrieves user and role occupancy information from the detected patterns, then performs attribute analysis for both user and role types based on the specified attribute paths.- Specified by:
resolveDetectedPatternsAttributes
in interfaceRoleAnalysisService
- Parameters:
detectedPatterns
- List of detected patterns to process.userExistCache
- Map containing cached PrismObject of UserType for efficient retrieval.roleExistCache
- Map containing cached PrismObject of RoleType for efficient retrieval.task
- Task used for processing the attribute analysis.result
- OperationResult containing the result of the operation. Any errors or status information will be recorded here.attributeRoleDefSet
- List of RoleAnalysisAttributeDef containing the attribute definitions for role analysis.attributeUserDefSet
- List of RoleAnalysisAttributeDef containing the attribute definitions for user analysis.
-
searchSessionClusters
public List<PrismObject<RoleAnalysisClusterType>> searchSessionClusters(@NotNull @NotNull RoleAnalysisSessionType session, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Searches for clusters associated with a specific role analysis session.- Specified by:
searchSessionClusters
in interfaceRoleAnalysisService
- Parameters:
session
- RoleAnalysisSessionType representing the session for which clusters are being searched.task
- Task used for executing the search operation.result
- OperationResult containing the result of the search operation. Any errors or status information will be recorded here.- Returns:
- List of PrismObject
containing the clusters associated with the session. If the search operation fails or no clusters are found, null is returned.
-
resolveFocusObjectIconColor
public String resolveFocusObjectIconColor(@NotNull @NotNull FocusType focusObject, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) Description copied from interface:RoleAnalysisService
Resolves the focus object icon color based on the provided focus object archetype.- Specified by:
resolveFocusObjectIconColor
in interfaceRoleAnalysisService
- Parameters:
focusObject
- FocusType representing the focus object for which the icon color is being resolved.task
- Task used for resolving the icon color.result
- OperationResult containing the result of the operation. Any errors or status information will be recorded here.- Returns:
- String representing the icon color of the focus object.
-
countObjects
public <T extends ObjectType> Integer countObjects(@NotNull @NotNull Class<T> type, @Nullable @Nullable ObjectQuery query, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) Description copied from interface:RoleAnalysisService
Retrieves the attribute definition for a specific attribute path.- Specified by:
countObjects
in interfaceRoleAnalysisService
- Parameters:
type
- The type of object for which the attribute definition is being retrieved.query
- The query specifying the conditions for searching the object.options
- Collection of SelectorOptions specifying additional options for the search operation.task
- Task used for executing the search operation.parentResult
- OperationResult containing the result of the search operation.- Returns:
- RoleAnalysisAttributeDef containing the attribute definition for the specified attribute path.
-
calculateAttributeConfidence
public String calculateAttributeConfidence(@NotNull @NotNull RoleAnalysisProcessModeType processModeType, @NotNull @NotNull AnalysisClusterStatisticType clusterStatistics) Description copied from interface:RoleAnalysisService
Calculates the confidence of an attribute based on the specified process mode and cluster statistics.- Specified by:
calculateAttributeConfidence
in interfaceRoleAnalysisService
- Parameters:
processModeType
- The process mode type.clusterStatistics
- The cluster statistics.- Returns:
- String representing the calculated attribute confidence.
-
resolveAnalysisAttributes
@Nullable public @Nullable List<RoleAnalysisAttributeDef> resolveAnalysisAttributes(@NotNull @NotNull RoleAnalysisSessionType session, @NotNull @NotNull QName complexType) Description copied from interface:RoleAnalysisService
Resolves the analysis attributes based on the provided session and complex type.- Specified by:
resolveAnalysisAttributes
in interfaceRoleAnalysisService
- Parameters:
session
- The RoleAnalysisSessionType object that contains the analysis options.complexType
- The QName object that represents the complex type of the attribute.- Returns:
- A list of RoleAnalysisAttributeDef objects that match the provided complex type. Returns null if no matching attributes are found or if the analysis option or process mode is not set in the session.
-