Interface RoleAnalysisService


public interface RoleAnalysisService
  • Method Details

    • getUserTypeObject

      @Nullable @Nullable PrismObject<UserType> getUserTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a PrismObject of UserType object based on its OID.
      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 @Nullable PrismObject<FocusType> getFocusTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a PrismObject of FocusType object based on its OID.
      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 @Nullable PrismObject<RoleType> getRoleTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a PrismObject of RoleType object based on its OID.
      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 @Nullable PrismObject<RoleAnalysisClusterType> getClusterTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a PrismObject of RoleAnalysisClusterType object based on its OID.
      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 @Nullable PrismObject<RoleAnalysisSessionType> getSessionTypeObject(@NotNull @NotNull String oid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a PrismObject of RoleAnalysisSessionType object based on its OID.
      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 <T extends ObjectType> @Nullable PrismObject<T> getObject(@NotNull @NotNull Class<T> objectTypeClass, @NotNull @NotNull String oid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a PrismObject based on its OID.
      Parameters:
      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 @NotNull Integer countSessionTypeObjects(@NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves the number of RoleAnalysisSessionType objects in the system.
      Parameters:
      task - The task associated with this operation.
      result - The operation result.
      Returns:
      The number of RoleAnalysisSessionType objects in the system.
    • extractUserTypeMembers

      @NotNull @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 com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Extracts a list of user members from set of RoleType object based on provided parameters.
      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

      void importCluster(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull @NotNull RoleAnalysisDetectionOptionType roleAnalysisSessionDetectionOption, @NotNull @NotNull ObjectReferenceType parentRef, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Imports a RoleAnalysisClusterType object into the system.
      Parameters:
      cluster - 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

      void updateSessionStatistics(@NotNull @NotNull ObjectReferenceType sessionRef, @NotNull @NotNull RoleAnalysisSessionStatisticType sessionStatistic, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Modifies statistics of a RoleAnalysisSessionType object.
      Parameters:
      sessionRef - The session reference.
      sessionStatistic - The session statistic to modify.
      task - The task associated with this operation.
      result - The operation result.
    • replaceDetectionPattern

      void replaceDetectionPattern(@NotNull @NotNull String clusterOid, @NotNull @NotNull List<DetectedPattern> detectedPatterns, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Replaces the detected patterns of a RoleAnalysisClusterType object.
      Parameters:
      clusterOid - The cluster OID.
      detectedPatterns - The detected patterns to replace.
      task - The task associated with this operation.
      result - The operation result.
    • getUpdatedAnalysisClusterStatistic

      @NotNull @NotNull AnalysisClusterStatisticType getUpdatedAnalysisClusterStatistic(double maxReduction, @NotNull @NotNull AnalysisClusterStatisticType clusterStatistics)
    • generateObjectReferences

      @NotNull @NotNull Set<ObjectReferenceType> generateObjectReferences(@NotNull @NotNull Set<String> objects, @NotNull @NotNull QName complexType, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult operationResult)
      Generates a set of object references based on a provided parameters.
      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

      void deleteSessionClustersMembers(@NotNull @NotNull String sessionOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Deletes all RoleAnalysisClusterType objects associated with a specific session.
      Parameters:
      sessionOid - The session OID.
      task - The task associated with this operation.
      result - The operation result.
    • deleteCluster

      void deleteCluster(@NotNull @NotNull RoleAnalysisClusterType cluster, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Deletes a single RoleAnalysisClusterType object.
      Parameters:
      cluster - The cluster to delete.
      task - The task associated with this operation.
      result - The operation result.
    • recomputeSessionStatics

      void recomputeSessionStatics(@NotNull @NotNull String sessionOid, @NotNull @NotNull RoleAnalysisClusterType roleAnalysisClusterType, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Recomputes the statistics of a RoleAnalysisSessionType object.
      Parameters:
      sessionOid - The session OID.
      roleAnalysisClusterType - The cluster to recompute statistics for.
      task - The task associated with this operation.
      result - The operation result.
    • countUserTypeMembers

      @NotNull @NotNull Integer countUserTypeMembers(@Nullable @Nullable ObjectFilter userFilter, @NotNull @NotNull String objectId, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Counts the number of members of a RoleType object.
      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 @NotNull PrismObject<RoleType> generateBusinessRole(@NotNull @NotNull List<AssignmentType> assignmentTypes, @NotNull @NotNull PolyStringType name)
      Retrieves a RoleType object that represents a business role.
      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

      void deleteSession(@NotNull @NotNull String sessionOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Deletes a single RoleAnalysisSessionType object.
      Parameters:
      sessionOid - The role analysis session OID.
      task - The task associated with this operation.
      result - The operation result.
    • resolveClusterProcessMode

      RoleAnalysisProcessModeType resolveClusterProcessMode(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Resolves the process mode of a RoleAnalysisClusterType object based on role analysis session.
      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

      void recomputeClusterDetectionOptions(@NotNull @NotNull String clusterOid, @NotNull @NotNull DetectionOption detectionOption, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Recompute the detection options of a RoleAnalysisClusterType object.
      Parameters:
      clusterOid - The cluster OID.
      detectionOption - The detection option to recompute.
      task - The task associated with this operation.
      result - The operation result.
    • clusterObjectMigrationRecompute

      void clusterObjectMigrationRecompute(@NotNull @NotNull String clusterRefOid, @NotNull @NotNull String roleRefOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Recompute role analysis cluster (RoleAnalysisClusterType) parameters. This method should be called after migration to business role.
      Parameters:
      clusterRefOid - The cluster OID.
      roleRefOid - The role OID.
      task - The task associated with this operation.
      result - The operation result.
    • prepareCompressedMiningStructure

      @NotNull @NotNull MiningOperationChunk prepareCompressedMiningStructure(@NotNull @NotNull RoleAnalysisClusterType cluster, boolean fullProcess, @NotNull @NotNull RoleAnalysisProcessModeType processMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task)
      Method for preparing a compressed mining structure for role analysis.
      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.
    • prepareExpandedMiningStructure

      @NotNull @NotNull MiningOperationChunk prepareExpandedMiningStructure(@NotNull @NotNull RoleAnalysisClusterType cluster, boolean fullProcess, @NotNull @NotNull RoleAnalysisProcessModeType processMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task)
      Method for preparing an expanded mining structure for role analysis.
      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.
    • cacheRoleTypeObject

      @Nullable @Nullable PrismObject<RoleType> cacheRoleTypeObject(@NotNull @NotNull Map<String,PrismObject<RoleType>> roleExistCache, @NotNull @NotNull String roleOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a RoleType PrismObject from a cache or, if not present, fetches it from the ModelService and stores it in the cache.
      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.
      Returns:
      The RoleType PrismObject fetched from the cache or ModelService, or null if not found.
    • cacheUserTypeObject

      @Nullable @Nullable PrismObject<UserType> cacheUserTypeObject(@NotNull @NotNull Map<String,PrismObject<UserType>> userExistCache, @NotNull @NotNull String userOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      Retrieves a UserType PrismObject from a cache or, if not present, fetches it from the ModelService and stores it in the cache.
      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.
      Returns:
      The UserType PrismObject fetched from the cache or ModelService, or null if not found.
    • executeMigrationTask

      void executeMigrationTask(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @NotNull @NotNull ActivityDefinitionType activityDefinition, @NotNull @NotNull PrismObject<RoleType> roleObject, @Nullable @Nullable String taskOid, @Nullable @Nullable PolyStringType taskName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      This method is used to execute a migration task. It replaces the role assignment with business role assignment.
      Parameters:
      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.
    • executeDetectionTask

      void executeDetectionTask(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> cluster, @Nullable @Nullable String taskOid, @Nullable @Nullable PolyStringType taskName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      This method is used to execute a detection task. Detected patterns are stored in the cluster.
      Parameters:
      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.
    • executeClusteringTask

      void executeClusteringTask(@NotNull @NotNull PrismObject<RoleAnalysisSessionType> session, @Nullable @Nullable String taskOid, @Nullable @Nullable PolyStringType taskName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      This method is used to execute a clustering task. It creates a new cluster and stores it in the session.
      Parameters:
      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.
    • updateClusterPatterns

      void updateClusterPatterns(@NotNull @NotNull String clusterRefOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      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.
      Parameters:
      clusterRefOid - The cluster OID.
      task - The task associated with this operation.
      result - The operation result.
    • recomputeAndResolveClusterOpStatus

      @NotNull @NotNull String recomputeAndResolveClusterOpStatus(@NotNull @NotNull PrismObject<RoleAnalysisClusterType> clusterPrismObject, @NotNull @NotNull RoleAnalysisChannelMode channelMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task)
      Recompute and resolve the cluster operation status. This method also update the cluster operation status if detect some changes.
      Parameters:
      clusterPrismObject - The cluster for recompute and resolve.
      channelMode - The channel mode.
      result - The operation result.
      task - The task associated with this operation.
      Returns:
      The cluster operation status.
    • recomputeAndResolveSessionOpStatus

      @NotNull @NotNull String recomputeAndResolveSessionOpStatus(@NotNull @NotNull PrismObject<RoleAnalysisSessionType> clusterPrismObject, @NotNull @NotNull RoleAnalysisChannelMode channelMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task)
      Recompute and resolve the cluster operation status. This method also update the cluster operation status if detect some changes.
      Parameters:
      clusterPrismObject - The cluster for recompute and resolve.
      channelMode - The channel mode.
      result - The operation result.
      task - The task associated with this operation.
      Returns:
      The cluster operation status.
    • setOpStatus

      <T extends AssignmentHolderType & Objectable> void setOpStatus(@NotNull @NotNull PrismObject<T> object, @NotNull @NotNull String taskOid, OperationResultStatusType operationResultStatusType, String message, @NotNull @NotNull RoleAnalysisChannelMode channelMode, @NotNull @NotNull OperationResult result, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task)
      This method is used to update the cluster operation status.
      Parameters:
      object - The assignment holder object.
      taskOid - The OID of the task.
      operationResultStatusType - The operation result status type.
      message - The message to set.
      channelMode - The channel mode.
      result - The operation result.
      task - The task associated with this operation.
    • isUnderActivity

      <T extends AssignmentHolderType & Objectable> boolean isUnderActivity(@NotNull @NotNull PrismObject<T> object, @NotNull @NotNull RoleAnalysisChannelMode channelMode, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      This method is used to check if the role analysis object is under activity.
      Type Parameters:
      T - The assignment holder type.
      Parameters:
      object - The assignment holder object.
      channelMode - The channel mode.
      task - The task associated with this operation.
      result - The operation result.
      Returns:
      The operation execution status.
    • resolveTaskObject

      @Nullable @Nullable PrismObject<TaskType> resolveTaskObject(@NotNull @NotNull List<OperationExecutionType> operationExecution, @NotNull @NotNull RoleAnalysisChannelMode channelMode, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result)
      This method is used to retrive the task object for specific roleAnalysisChannelMode.
      Parameters:
      operationExecution - The operation execution list.
      channelMode - The channel mode.
      task - The task associated with this operation.
      result - The operation result.
      Returns:
      The task object.