Class EsiRemoveKeepReferencesService
- java.lang.Object
-
- com.nomagic.magicdraw.teamwork2.esi.EsiRemoveKeepReferencesService
-
@OpenApiAll public class EsiRemoveKeepReferencesService extends java.lang.Object
A service that is responsible for removing an ESI module with "Keeping References"
-
-
Constructor Summary
Constructors Constructor Description EsiRemoveKeepReferencesService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
detachModulesKeepAndReferencesOnTask(Project project, IAttachedProjectRemoverCallback removeConfirmation, java.util.Collection<ModuleUsage> usages)
Removes usages of modules and keeps references to existing objects from modules.static boolean
detachModulesKeepAndReferencesOnTask(Project project, java.util.Collection<ModuleUsage> usages)
Removes usages of modules and keeps references to existing objects from modules.static void
detachModulesKeepReferences(Project project, java.util.Collection<ModuleUsage> usages, ProgressStatus monitor)
Removes usages of modules and keeps references to existing objects from modules.private static void
doActualDetachModulesKeepReferences(Project project, java.util.Collection<ModuleUsage> usages, IAttachedProjectRemoverCallback removeConfirmation, ProgressStatus monitor)
private static void
doDetachModulesKeepReferences(Project project, java.util.Collection<ModuleUsage> usages, IAttachedProjectRemoverCallback removeConfirmation, ProgressStatus monitor)
private static void
filterManualUsages(IPrimaryProject primaryProject, java.util.Collection<IProject> projects)
From the projects collection removes the all projects what are manually reachable from the primary project.private static java.util.Collection<ModuleUsage>
getUsagesOfEmptyProjects(IPrimaryProject primaryProject, java.util.Collection<IProject> projects)
Returns usages of projects that are empty.private static boolean
isProjectUsageManual(IPrimaryProject primaryProject, IProject iProject)
Checks whether a project usage is manually reachable.private static java.util.Collection<IProject>
markProjectUsagesAsAutomatic(IPrimaryProject primaryProject, java.util.Collection<ModuleUsage> usages)
Marks all project usages which owner is the primary project as automatic.
-
-
-
Method Detail
-
detachModulesKeepAndReferencesOnTask
public static boolean detachModulesKeepAndReferencesOnTask(Project project, java.util.Collection<ModuleUsage> usages)
Removes usages of modules and keeps references to existing objects from modules.- Parameters:
project
- a project.usages
- a collection of usages.- Returns:
- true the operation was successful.
-
detachModulesKeepAndReferencesOnTask
public static boolean detachModulesKeepAndReferencesOnTask(Project project, @CheckForNull IAttachedProjectRemoverCallback removeConfirmation, java.util.Collection<ModuleUsage> usages)
Removes usages of modules and keeps references to existing objects from modules.- Parameters:
project
- a project.usages
- a collection of usages.removeConfirmation
- remove confirmation- Returns:
- true the operation was successful.
-
detachModulesKeepReferences
public static void detachModulesKeepReferences(Project project, java.util.Collection<ModuleUsage> usages, ProgressStatus monitor) throws java.lang.Exception
Removes usages of modules and keeps references to existing objects from modules.- Parameters:
project
- a project.usages
- a collection of usages.monitor
- progress monitor- Throws:
java.lang.Exception
-
doDetachModulesKeepReferences
private static void doDetachModulesKeepReferences(Project project, java.util.Collection<ModuleUsage> usages, @CheckForNull IAttachedProjectRemoverCallback removeConfirmation, ProgressStatus monitor) throws java.lang.Exception
- Throws:
java.lang.Exception
-
doActualDetachModulesKeepReferences
private static void doActualDetachModulesKeepReferences(Project project, java.util.Collection<ModuleUsage> usages, @CheckForNull IAttachedProjectRemoverCallback removeConfirmation, ProgressStatus monitor) throws java.lang.Exception
- Throws:
java.lang.Exception
-
filterManualUsages
private static void filterManualUsages(IPrimaryProject primaryProject, java.util.Collection<IProject> projects)
From the projects collection removes the all projects what are manually reachable from the primary project.- Parameters:
primaryProject
- a primary project.projects
- a collection of projects.
-
isProjectUsageManual
private static boolean isProjectUsageManual(IPrimaryProject primaryProject, IProject iProject)
Checks whether a project usage is manually reachable.- Parameters:
primaryProject
- a primary project.iProject
- a target project.- Returns:
- true if manually reachable.
-
markProjectUsagesAsAutomatic
private static java.util.Collection<IProject> markProjectUsagesAsAutomatic(IPrimaryProject primaryProject, java.util.Collection<ModuleUsage> usages) throws com.nomagic.ci.persistence.PersistenceException
Marks all project usages which owner is the primary project as automatic.- Parameters:
primaryProject
- a primary project.usages
- a collection of usages.- Returns:
- a collection of used projects which usages were marked as automatic.
- Throws:
com.nomagic.ci.persistence.PersistenceException
-
getUsagesOfEmptyProjects
private static java.util.Collection<ModuleUsage> getUsagesOfEmptyProjects(IPrimaryProject primaryProject, java.util.Collection<IProject> projects)
Returns usages of projects that are empty.- Parameters:
primaryProject
- a primary project.projects
- a collection of projects.- Returns:
- a collection module usages.
-
-