@OpenApiAll
public class ModulesService
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ModulesService.ModuleHasOrphanProxiesException |
static class |
ModulesService.UsedViaReadOnlyAutomaticUsageException
Thrown when module(s) can not be removed due to all paths from primary
project to it contains a read only
automatic usage |
Constructor and Description |
---|
ModulesService() |
Modifier and Type | Method and Description |
---|---|
static IAttachedProject |
attachModule(IProject owner,
AbstractProjectAttachmentConfiguration configuration,
org.eclipse.core.runtime.IProgressMonitor monitor)
Mounts module into current project.
|
static IAttachedProject |
attachModuleOnTask(IProject project,
AbstractProjectAttachmentConfiguration configuration)
Mounts module into current project.
|
protected static void |
checkPrecondition(Project project,
java.util.Collection<Element> roots,
IAttachedProject importThis) |
static boolean |
detachModules(java.util.Collection<ModuleUsage> usages,
org.eclipse.core.runtime.IProgressMonitor monitor)
Removes all given modules usages.
|
static boolean |
detachModulesAndRemoveUnreachable(java.util.Collection<ModuleUsage> usages,
org.eclipse.core.runtime.IProgressMonitor monitor)
Removes all given module usages.
|
static boolean |
detachModulesAndRemoveUnreachableOnTask(java.util.Collection<ModuleUsage> usages)
Removes all given module usages.
|
static boolean |
detachModulesOnTask(java.util.Collection<ModuleUsage> usages)
Removes all given modules usages.
|
static IAttachedProject |
findOrLoadLocalModule(Project project,
java.lang.String filePath,
boolean allowUI)
Attaches local module from given path into a given project.
|
static IAttachedProject |
findOrLoadModule(Project project,
ProjectDescriptor moduleLocation,
boolean allowUI)
Looks for existing module in a given project.
|
static IAttachedProject |
findOrLoadModule(Project project,
ProjectDescriptor moduleLocation,
org.eclipse.core.runtime.IProgressMonitor monitor,
boolean allowUI)
Looks for already attached module in a given project.
|
static IAttachedProject |
findOrLoadTeamworkModule(Project project,
java.lang.String profileQualifiedName,
boolean allowUI)
Attaches teamwork (from Teamwork Server) module into a given project.
|
static com.nomagic.ci.persistence.mounting.IMountPoint |
getMountPoint(java.util.Collection<com.nomagic.ci.persistence.mounting.IMountPoint> points,
Package element)
Find mount point in a given collection which mounts a given package.
|
static void |
importModule(IProject owner,
IAttachedProject module,
org.eclipse.core.runtime.IProgressMonitor monitor) |
static void |
importModule(IProject owner,
IAttachedProject module,
org.eclipse.core.runtime.IProgressMonitor monitor,
boolean regenerateElementIDs)
Removes module descriptor and makes all its contents as it is local project content.
|
static void |
importModuleOnTask(IProject owner,
IAttachedProject module)
Removes module descriptor and makes all its contents as it is local project content.
|
(package private) static void |
loadInnerModulesRecursively(IAttachedProject module,
org.eclipse.core.runtime.IProgressMonitor monitor)
Load inner modules recursively
|
static boolean |
processException(Project prj,
java.lang.Exception e,
java.lang.String failedOperationMessage) |
static void |
reMount(IProject owner,
IAttachedProject module,
java.util.Collection<MountedPackageInfo> mountedPackagesInfo,
org.eclipse.core.runtime.IProgressMonitor monitor)
Re-mount given module on different mount points.
|
static void |
reMountOnTask(IProject owner,
IAttachedProject module,
java.util.Collection<MountedPackageInfo> mountedPackagesInfo)
Change mount point location
|
static void |
removeModules(java.util.Set<IAttachedProject> selectedModules,
IAttachedProjectRemoverCallback removeConfirmation,
org.eclipse.core.runtime.IProgressMonitor progress)
Removes the selected modules
|
static void |
removeModulesOnTask(java.util.Set<IAttachedProject> selectedModules,
IAttachedProjectRemoverCallback removeConfirmation)
Removes the selected modules on task
|
static void |
setAutoLoadKind(IProject owner,
IAttachedProject module,
AutoLoadKind kind,
org.eclipse.core.runtime.IProgressMonitor monitor)
Set module load kind
|
static void |
setAutoLoadKind(IProject owner,
ProjectAttachmentConfiguration configuration,
AutoLoadKind kind)
Set module load kind
|
static void |
setAutoLoadKind(IProject owner,
ProjectAttachmentConfiguration configuration,
AutoLoadKind kind,
org.eclipse.core.runtime.IProgressMonitor monitor)
Set module load kind
|
static void |
setAutoLoadKind(ProjectAttachmentConfiguration configuration,
AutoLoadKind autoLoadKind)
Set auto load kind for a given configuration.
|
static void |
setAutoLoadKindOnTask(IProject owner,
IAttachedProject module,
AutoLoadKind kind)
Set module load kind
|
static void |
setInternalVersion(IProject project,
java.lang.String version)
Set internal version for a given project
|
static void |
setReadOnly(java.util.Collection<ModuleUsage> usages,
boolean readOnly,
org.eclipse.core.runtime.IProgressMonitor monitor)
Make module usage readonly
|
static void |
setReadOnlyOnTask(java.util.Collection<ModuleUsage> usages,
boolean readOnly)
Make module usage readonly
|
static void |
setReShared(IProject project,
IProject module,
boolean reShared,
org.eclipse.core.runtime.IProgressMonitor monitor)
Re-share given module in a given project
|
static void |
setReSharedOnTask(IProject project,
IProject module,
boolean reShared)
Reshare given module in a given project
|
static void |
setSharePreferredPath(IProject project,
Package pkg,
java.lang.String path,
org.eclipse.core.runtime.IProgressMonitor monitor)
Set preferred path for mounting for given shared package
|
static void |
setSharePreferredPathOnTask(IProject project,
Package pkg,
java.lang.String path)
Set preferred path for mounting for given shared package
|
static void |
setStandardSystemProfile(IProject project,
boolean standard)
Mark given project as "standard system profile".
|
static void |
setStickyVersion(java.util.Collection<ModuleUsage> usages,
IVersionDescriptor version,
org.eclipse.core.runtime.IProgressMonitor monitor)
Set sticky version for given modules usages.
|
static void |
setStickyVersionOnTask(java.util.Collection<ModuleUsage> usages,
IVersionDescriptor version)
Set sticky version for given modules usages.
|
static void |
setUsedVersion(IProject owner,
IAttachedProject module,
java.lang.String version,
org.eclipse.core.runtime.IProgressMonitor monitor)
Set "used" version for a given module.
|
static void |
setUsedVersionOnTask(IProject owner,
IAttachedProject module,
java.lang.String version)
Set "used" version for a given module
|
static com.nomagic.ci.persistence.sharing.ISharePoint |
share(IProject project,
Package pkg,
java.lang.String path,
org.eclipse.core.runtime.IProgressMonitor monitor)
Share given package in a given project
|
static com.nomagic.ci.persistence.sharing.ISharePoint |
shareOnTask(IProject project,
Package pkg,
java.lang.String path)
Share given package in a given project
|
static void |
unShare(IProject project,
Package pkg,
org.eclipse.core.runtime.IProgressMonitor monitor)
Un-share given package from a given project
|
static void |
unShareOnTask(IProject project,
Package pkg)
Un-share given package from a given project
|
@CheckForNull public static IAttachedProject attachModule(IProject owner, AbstractProjectAttachmentConfiguration configuration, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
owner
- owner to attach module toconfiguration
- configurationmonitor
- progress statuscom.nomagic.ci.persistence.PersistenceException
- in case of persistence problemspublic static IAttachedProject attachModuleOnTask(IProject project, AbstractProjectAttachmentConfiguration configuration)
project
- projectconfiguration
- configurationpublic static void reMount(IProject owner, IAttachedProject module, java.util.Collection<MountedPackageInfo> mountedPackagesInfo, org.eclipse.core.runtime.IProgressMonitor monitor)
owner
- module ownermodule
- module to remountmountedPackagesInfo
- new information about mount pointsmonitor
- progress monitorpublic static void reMountOnTask(IProject owner, IAttachedProject module, java.util.Collection<MountedPackageInfo> mountedPackagesInfo)
owner
- projectmodule
- modulemountedPackagesInfo
- new mounting informationpublic static boolean detachModules(java.util.Collection<ModuleUsage> usages, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.Exception
usages
- modules to removemonitor
- monitorjava.lang.Exception
- if detach fails.public static boolean detachModulesAndRemoveUnreachable(java.util.Collection<ModuleUsage> usages, org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.Exception
usages
- the usages to removemonitor
- the progress monitor for the operationjava.lang.Exception
public static boolean detachModulesAndRemoveUnreachableOnTask(java.util.Collection<ModuleUsage> usages)
usages
- the usages to removepublic static boolean detachModulesOnTask(java.util.Collection<ModuleUsage> usages)
usages
- module usages to removepublic static void removeModules(java.util.Set<IAttachedProject> selectedModules, @CheckForNull IAttachedProjectRemoverCallback removeConfirmation, @CheckForNull org.eclipse.core.runtime.IProgressMonitor progress) throws ModulesService.UsedViaReadOnlyAutomaticUsageException, com.nomagic.ci.persistence.PersistenceException
selectedModules
- the modules to removeremoveConfirmation
- the confirmation call back that will be used to confirm the
removeprogress
- the progress monitor for the operationModulesService.UsedViaReadOnlyAutomaticUsageException
com.nomagic.ci.persistence.PersistenceException
public static void removeModulesOnTask(java.util.Set<IAttachedProject> selectedModules, @CheckForNull IAttachedProjectRemoverCallback removeConfirmation)
selectedModules
- the modules to removeremoveConfirmation
- the confirmation call back that will be used to confirm the removepublic static void importModule(IProject owner, IAttachedProject module, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.Exception
java.lang.Exception
public static void importModule(IProject owner, IAttachedProject module, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor, boolean regenerateElementIDs) throws java.lang.Exception
owner
- module ownermodule
- to importmonitor
- progress statusregenerateElementIDs
- if true module element id will be generatedjava.lang.Exception
- exception is something goes wrong@CheckForNull public static com.nomagic.ci.persistence.mounting.IMountPoint getMountPoint(java.util.Collection<com.nomagic.ci.persistence.mounting.IMountPoint> points, Package element)
points
- mount pointselement
- packageprotected static void checkPrecondition(Project project, java.util.Collection<Element> roots, IAttachedProject importThis) throws java.lang.Exception
java.lang.Exception
public static void importModuleOnTask(IProject owner, IAttachedProject module)
owner
- module ownermodule
- to importpublic static boolean processException(Project prj, java.lang.Exception e, java.lang.String failedOperationMessage)
public static void setReadOnly(java.util.Collection<ModuleUsage> usages, boolean readOnly, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
usages
- module usagesreadOnly
- readonly flagmonitor
- monitorcom.nomagic.ci.persistence.PersistenceException
- in case of some persistence problempublic static void setReadOnlyOnTask(java.util.Collection<ModuleUsage> usages, boolean readOnly)
usages
- module usagesreadOnly
- readonly flagpublic static void setAutoLoadKind(ProjectAttachmentConfiguration configuration, AutoLoadKind autoLoadKind)
configuration
- configuration to change auto load.autoLoadKind
- auto load kindpublic static void setAutoLoadKind(IProject owner, ProjectAttachmentConfiguration configuration, AutoLoadKind kind, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
owner
- module ownerconfiguration
- attachment configurationkind
- load kindmonitor
- monitorcom.nomagic.ci.persistence.PersistenceException
- in case of some persistence problempublic static void setAutoLoadKind(IProject owner, ProjectAttachmentConfiguration configuration, AutoLoadKind kind)
owner
- module ownerconfiguration
- attachment configurationkind
- load kindpublic static void setAutoLoadKind(IProject owner, IAttachedProject module, AutoLoadKind kind, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
owner
- module ownermodule
- modulekind
- load kindmonitor
- monitorcom.nomagic.ci.persistence.PersistenceException
- in case of some persistence problempublic static void setAutoLoadKindOnTask(IProject owner, IAttachedProject module, AutoLoadKind kind)
owner
- module ownermodule
- modulekind
- load kindpublic static void setReSharedOnTask(IProject project, IProject module, boolean reShared)
project
- projectmodule
- modulereShared
- add or remove re-sharingpublic static void setReShared(IProject project, IProject module, boolean reShared, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor)
project
- projectmodule
- modulereShared
- add ore remove re-sharingmonitor
- monitorpublic static com.nomagic.ci.persistence.sharing.ISharePoint shareOnTask(IProject project, Package pkg, java.lang.String path)
project
- projectpkg
- package to sharepath
- preferred path for mountingpublic static com.nomagic.ci.persistence.sharing.ISharePoint share(IProject project, Package pkg, java.lang.String path, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.local.spi.InvalidProjectObjectException, com.nomagic.ci.persistence.LockAcquisitionException
project
- projectpkg
- package to sharepath
- preferred path for mountingmonitor
- monitorcom.nomagic.ci.persistence.local.spi.InvalidProjectObjectException
com.nomagic.ci.persistence.LockAcquisitionException
- if locking required elements fails during the operationpublic static void setSharePreferredPathOnTask(IProject project, Package pkg, java.lang.String path)
project
- projectpkg
- packagepath
- preferred mounting pathpublic static void setSharePreferredPath(IProject project, Package pkg, java.lang.String path, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.local.spi.InvalidProjectObjectException
project
- projectpkg
- packagepath
- preferred mounting pathmonitor
- monitorcom.nomagic.ci.persistence.local.spi.InvalidProjectObjectException
public static void setStandardSystemProfile(IProject project, boolean standard)
project
- projectstandard
- mark as standard profilepublic static void setInternalVersion(IProject project, java.lang.String version)
project
- projectversion
- versionpublic static void setUsedVersionOnTask(IProject owner, IAttachedProject module, java.lang.String version)
owner
- module ownermodule
- moduleversion
- versionpublic static void setUsedVersion(IProject owner, IAttachedProject module, java.lang.String version, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
owner
- module ownermodule
- moduleversion
- versionmonitor
- monitorcom.nomagic.ci.persistence.PersistenceException
- if any persistence problempublic static void unShare(IProject project, Package pkg, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.local.spi.InvalidProjectObjectException, com.nomagic.ci.persistence.LockAcquisitionException
project
- projectpkg
- package to un-sharemonitor
- monitorcom.nomagic.ci.persistence.local.spi.InvalidProjectObjectException
com.nomagic.ci.persistence.LockAcquisitionException
- if locking required elements fails during the operationpublic static void unShareOnTask(IProject project, Package pkg)
project
- projectpkg
- package to un-sharepublic static void setStickyVersion(java.util.Collection<ModuleUsage> usages, @CheckForNull IVersionDescriptor version, org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
usages
- usagesversion
- sticky version(null if no sticky versionmonitor
- progress monitorcom.nomagic.ci.persistence.PersistenceException
- in case of some persistence problempublic static void setStickyVersionOnTask(java.util.Collection<ModuleUsage> usages, @CheckForNull IVersionDescriptor version)
usages
- usagesversion
- sticky version(null if no sticky version@CheckForNull public static IAttachedProject findOrLoadLocalModule(Project project, java.lang.String filePath, boolean allowUI)
project
- projectfilePath
- full path to module fileallowUI
- allow to show error messages to user@CheckForNull public static IAttachedProject findOrLoadTeamworkModule(Project project, java.lang.String profileQualifiedName, boolean allowUI)
project
- current project in which action is performed.profileQualifiedName
- qualified nameallowUI
- allow to show error messages to user@CheckForNull public static IAttachedProject findOrLoadModule(Project project, ProjectDescriptor moduleLocation, boolean allowUI)
project
- project where module is searched of loaded.moduleLocation
- module descriptor to load.allowUI
- allow to show error messages to user@CheckForNull public static IAttachedProject findOrLoadModule(Project project, ProjectDescriptor moduleLocation, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor, boolean allowUI)
project
- project where module is searched of loaded.moduleLocation
- module descriptor to load.monitor
- monitor where display status, if null new progress bar is shown.allowUI
- allow to show error messages to userstatic void loadInnerModulesRecursively(IAttachedProject module, @CheckForNull org.eclipse.core.runtime.IProgressMonitor monitor) throws com.nomagic.ci.persistence.PersistenceException
module
- modulemonitor
- monitorcom.nomagic.ci.persistence.PersistenceException
- in case of some persistence problem