Class WorkspaceOrchestratorMock
- All Implemented Interfaces:
IWorkspaceOrchestrator
,IManagedService
IWorkspaceOrchestrator
.-
Constructor Summary
ConstructorsConstructorDescriptionWorkspaceOrchestratorMock
(IDtProjectManager dtProjectManager) Creates a newWorkspaceOrchestratorMock
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
void
addListener
(IWorkspaceOrchestratorListener listener) Adds the specifiedlistener
.beginBackgroundOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Shortcut for theIWorkspaceOrchestrator.enqueueBackgroundOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.beginExclusiveOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Shortcut for theIWorkspaceOrchestrator.enqueueExclusiveOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.beginHalfExclusiveOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Shortcut for theIWorkspaceOrchestrator.enqueueHalfExclusiveOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.beginModalOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob, IModalOperationController modalOperationController) Shortcut for the#enqueueModalOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.void
cancelOperation
(Object handle) Cancels the operation associated with the specifiedhandle
.void
cleanRestartProject
(IDtProject project) Cleans and restarts the specifiedproject
.void
cleanRestartProjects
(Collection<IDtProject> projects) Cleans and restarts the specifiedproject
's.void
void
endOperation
(Object handle) Ends the operation associated with the specifiedhandle
.enqueueBackgroundOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Enqueues background operation.enqueueExclusiveOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Enqueues the exclusive operation.enqueueHalfExclusiveOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Enqueues half exclusive operation.enqueueHalfExclusiveOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob, boolean implicitDerivedDataWait) Enqueues half exclusive operation with optional implicit wait cancellingenqueueModalOperation
(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob, IModalOperationController modalOperationController) Enqueues the modal operation.boolean
Checks if theIWorkspaceOrchestrator
is being shut down at the momemnt.boolean
isStarted
(IDtProject project) Checks whether the specifiedproject
is started or not.boolean
isStarted
(org.eclipse.core.resources.IProject project) Checks whether the specifiedproject
is started or not.void
jobCancelled
(IDtProject project, ProjectPipelineJob job) Notifies orchestrator that the job is cancelled.void
jobComplete
(IDtProject project, ProjectPipelineJob job) Notifies orchestrator that the job is complete.void
jobInterrupted
(IDtProject project, ProjectPipelineJob job) Notifies orchestrator that the job is interrupted.void
removeListener
(IWorkspaceOrchestratorListener listener) Removes the specifiedlistener
.boolean
requestJob
(IDtProject project, ProjectPipelineJob job) Requests execution project pipeline job.void
setOperationsEnabled
(boolean enabled) Sets whether workspace operations shall be approved.startProject
(String projectType, String projectName, Collection<String> projectNatures, org.eclipse.core.resources.IProject workspaceProject, Object extraData, ProjectStartType startType, Map<String, Object> customProperties, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Starts the specifiedproject
.startProject
(String projectType, String projectName, Collection<String> projectNatures, org.eclipse.core.resources.IProject workspaceProject, Object extraData, ProjectStartType startType, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Starts the specifiedproject
.void
startWorkspaceProjects
(Collection<WorkspaceProjectStartRequest> startRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Starts the specified project contexts.void
stopProject
(IDtProject project, ProjectStopType stopType) Stops the specifiedproject
.void
stopWorkspaceProjects
(Collection<WorkspaceProjectStopRequest> stopRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Stops the specified project contexts.boolean
tryStartOperation
(Object handle) Tries to start operation associated with the specifiedhandle
object.void
waitUntilStarted
(IDtProject project, Duration duration) Wait until the specifiedproject
is started.void
waitUntilStarted
(org.eclipse.core.resources.IProject project, Duration duration) Wait until the specifiedproject
is started.void
waitUntilStopped
(IDtProject project, Duration duration) Wait until the specifiedproject
is stopped.
-
Constructor Details
-
WorkspaceOrchestratorMock
Creates a newWorkspaceOrchestratorMock
.- Parameters:
dtProjectManager
- the DT project manager, cannot benull
-
-
Method Details
-
activate
public void activate()- Specified by:
activate
in interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivate
in interfaceIManagedService
-
startProject
public IDtProject startProject(String projectType, String projectName, Collection<String> projectNatures, org.eclipse.core.resources.IProject workspaceProject, Object extraData, ProjectStartType startType, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:IWorkspaceOrchestrator
Starts the specifiedproject
.Note: this method is a shortcut for
IWorkspaceOrchestrator.startProject(String, String, Collection, IProject, Object, ProjectStartType, Map, IProgressMonitor)
with an empty map as thecustomProperties
argument.- Specified by:
startProject
in interfaceIWorkspaceOrchestrator
- Parameters:
projectType
- the project type, cannot benull
.projectName
- the project name, cannot benull
.projectNatures
- the project natures, cannot benull
.workspaceProject
- the corresponding workspace project, can benull
.extraData
- extra data, can benull
.startType
- the start type, cannot benull
.progressMonitor
- the progress monitor, cannot benull
.- See Also:
-
#startProject(IDtProject, ProjectStartType, Map)
-
startProject
public IDtProject startProject(String projectType, String projectName, Collection<String> projectNatures, org.eclipse.core.resources.IProject workspaceProject, Object extraData, ProjectStartType startType, Map<String, Object> customProperties, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:IWorkspaceOrchestrator
Starts the specifiedproject
.It performs the next sequence of actions:
- (Optional) Shedules build if the
startType
is clean-import - Collects dependent projects for the specified one
- Stops the collected projects with an appropriate stop type
- Starts the specified project
- Starts the dependent projects with an appropriate start type
If the project is already started it does nothing.
- Specified by:
startProject
in interfaceIWorkspaceOrchestrator
- Parameters:
projectType
- the project type, cannot benull
.projectName
- the project name, cannot benull
.projectNatures
- the project natures, cannot benull
.workspaceProject
- the corresponding workspace project, can benull
.extraData
- extra data, can benull
.startType
- the start type, cannot benull
.customProperties
- the custom properties map is a map where keys are unique properties and values its values. This properties are accesable by lifecycle services within the start process.progressMonitor
- the progress monitor, cannot benull
.
- (Optional) Shedules build if the
-
stopProject
Description copied from interface:IWorkspaceOrchestrator
Stops the specifiedproject
.It performs the next sequence of actions:
- Collects dependent projects for the specified one
- Stops the collected projects with an appropriate stop type
- Stops the specified project
- Starts again the dependent projects with an appropriate start type
If the project is already stopped it does nothing.
- Specified by:
stopProject
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to stop, cannot benull
.stopType
- the stop type, cannot benull
.
-
startWorkspaceProjects
public void startWorkspaceProjects(Collection<WorkspaceProjectStartRequest> startRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IWorkspaceOrchestrator
Starts the specified project contexts.It performs the next sequence of actions:
- Collects dependent projects for each project of the specified contexts
- Stops the collected projects with an appropriate stop type
- Starts the specified project contexts
- Starts the dependent projects with an appropriate start type
If the project is already started it does nothing.
- Specified by:
startWorkspaceProjects
in interfaceIWorkspaceOrchestrator
- Parameters:
startRequests
- the start requests, cannot benull
.monitor
- the progress monitor, can benull
. If it'snull
theNullProgressMonitor
will be used.
-
stopWorkspaceProjects
public void stopWorkspaceProjects(Collection<WorkspaceProjectStopRequest> stopRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IWorkspaceOrchestrator
Stops the specified project contexts.It performs the next sequence of actions:
- Collects dependent projects for each project of the specified contexts
- Stops the collected projects with an appropriate stop type
- Stops the specified project contexts
- Starts again the dependent projects with an appropriate start type
If the project is already started it does nothing.
- Specified by:
stopWorkspaceProjects
in interfaceIWorkspaceOrchestrator
- Parameters:
stopRequests
- the stop requests, cannot benull
.monitor
- the progress monitor, can benull
. If it'snull
theNullProgressMonitor
will be used.
-
isStarted
Description copied from interface:IWorkspaceOrchestrator
Checks whether the specifiedproject
is started or not.- Specified by:
isStarted
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to check, cannot benull
.- Returns:
true
if theproject
is started,false
- otherwise.
-
isStarted
public boolean isStarted(org.eclipse.core.resources.IProject project) Description copied from interface:IWorkspaceOrchestrator
Checks whether the specifiedproject
is started or not.- Specified by:
isStarted
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to check, cannot benull
.- Returns:
true
if theproject
is started,false
- otherwise.
-
waitUntilStopped
Description copied from interface:IWorkspaceOrchestrator
Wait until the specifiedproject
is stopped.- Specified by:
waitUntilStopped
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to wait for stop, cannot benull
.duration
- the duration to wait, cannot benull
.
-
waitUntilStarted
Description copied from interface:IWorkspaceOrchestrator
Wait until the specifiedproject
is started.- Specified by:
waitUntilStarted
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to wait for start, cannot benull
.duration
- the duration to wait, cannot benull
.
-
waitUntilStarted
Description copied from interface:IWorkspaceOrchestrator
Wait until the specifiedproject
is started.- Specified by:
waitUntilStarted
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to wait for start, cannot benull
.duration
- the duration to wait, cannot benull
.
-
enqueueExclusiveOperation
public Object enqueueExclusiveOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Description copied from interface:IWorkspaceOrchestrator
Enqueues the exclusive operation.- Specified by:
enqueueExclusiveOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
enqueueHalfExclusiveOperation
public Object enqueueHalfExclusiveOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Description copied from interface:IWorkspaceOrchestrator
Enqueues half exclusive operation.- Specified by:
enqueueHalfExclusiveOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
enqueueHalfExclusiveOperation
public Object enqueueHalfExclusiveOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob, boolean implicitDerivedDataWait) Description copied from interface:IWorkspaceOrchestrator
Enqueues half exclusive operation with optional implicit wait cancelling- Specified by:
enqueueHalfExclusiveOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.implicitDerivedDataWait
- True if the caller is need to wait for DD computation at the end of this operation- Returns:
- the operation handle, never
null
.
-
enqueueBackgroundOperation
public Object enqueueBackgroundOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Description copied from interface:IWorkspaceOrchestrator
Enqueues background operation.- Specified by:
enqueueBackgroundOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
enqueueModalOperation
public Object enqueueModalOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob, IModalOperationController modalOperationController) Description copied from interface:IWorkspaceOrchestrator
Enqueues the modal operation.- Specified by:
enqueueModalOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
beginModalOperation
public Object beginModalOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob, IModalOperationController modalOperationController) Description copied from interface:IWorkspaceOrchestrator
Shortcut for the#enqueueModalOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.- Specified by:
beginModalOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
beginExclusiveOperation
public Object beginExclusiveOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Description copied from interface:IWorkspaceOrchestrator
Shortcut for theIWorkspaceOrchestrator.enqueueExclusiveOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.- Specified by:
beginExclusiveOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
beginHalfExclusiveOperation
public Object beginHalfExclusiveOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Description copied from interface:IWorkspaceOrchestrator
Shortcut for theIWorkspaceOrchestrator.enqueueHalfExclusiveOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.- Specified by:
beginHalfExclusiveOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
beginBackgroundOperation
public Object beginBackgroundOperation(String name, Collection<IDtProject> projects, ProjectPipelineJob afterJob) Description copied from interface:IWorkspaceOrchestrator
Shortcut for theIWorkspaceOrchestrator.enqueueBackgroundOperation(String, Collection, ProjectPipelineJob)
followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)
is succeed.- Specified by:
beginBackgroundOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
name
- the operation name, cannot benull
.projects
- the projects the operation affects, cannot benull
.afterJob
- the stage the operation executed after, cannot benull
.- Returns:
- the operation handle, never
null
.
-
tryStartOperation
Description copied from interface:IWorkspaceOrchestrator
Tries to start operation associated with the specifiedhandle
object.- Specified by:
tryStartOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
handle
- the operation handle, cannot benull
.- Returns:
true
if the operation allowed,false
otherwise.
-
endOperation
Description copied from interface:IWorkspaceOrchestrator
Ends the operation associated with the specifiedhandle
.- Specified by:
endOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
handle
- the operation handle, cannot benull
.
-
cancelOperation
Description copied from interface:IWorkspaceOrchestrator
Cancels the operation associated with the specifiedhandle
.- Specified by:
cancelOperation
in interfaceIWorkspaceOrchestrator
- Parameters:
handle
- the operation handle, cannot benull
.
-
addListener
Description copied from interface:IWorkspaceOrchestrator
Adds the specifiedlistener
.- Specified by:
addListener
in interfaceIWorkspaceOrchestrator
- Parameters:
listener
- the orchestrator listener to add, cannot benull
.
-
removeListener
Description copied from interface:IWorkspaceOrchestrator
Removes the specifiedlistener
.- Specified by:
removeListener
in interfaceIWorkspaceOrchestrator
- Parameters:
listener
- the orchestrator listener to remove, cannot benull
.
-
requestJob
Description copied from interface:IWorkspaceOrchestrator
Requests execution project pipeline job.- Specified by:
requestJob
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project, cannot benull
.job
- the job, cannot benull
.- Returns:
true
if the execution is allowed,false
otherwise.
-
jobComplete
Description copied from interface:IWorkspaceOrchestrator
Notifies orchestrator that the job is complete.- Specified by:
jobComplete
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project, cannot benull
.job
- the job, cannot benull
.
-
jobCancelled
Description copied from interface:IWorkspaceOrchestrator
Notifies orchestrator that the job is cancelled.- Specified by:
jobCancelled
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project, cannot benull
.job
- the job, cannot benull
.
-
jobInterrupted
Description copied from interface:IWorkspaceOrchestrator
Notifies orchestrator that the job is interrupted.- Specified by:
jobInterrupted
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project, cannot benull
.job
- the job, cannot benull
.
-
cleanRestartProject
Description copied from interface:IWorkspaceOrchestrator
Cleans and restarts the specifiedproject
.It performs the next sequence of actions:
- Collects dependent projects for the specified one
- Stops the collected projects with the CLEAN stop type
- Stops the specified project
- Starts the specified project with the CLEAN_IMPORT start type
- Starts again the dependent projects with the CLEAN_IMPORT start type
If the project is already stopped it does nothing.
- Specified by:
cleanRestartProject
in interfaceIWorkspaceOrchestrator
- Parameters:
project
- the project to stop, cannot benull
.
-
cleanRestartProjects
Description copied from interface:IWorkspaceOrchestrator
Cleans and restarts the specifiedproject
's.It performs the next sequence of actions:
- Collects dependent projects for the specified one
- Stops the collected projects with the CLEAN stop type
- Stops the specified project
- Starts the specified project with the CLEAN_IMPORT start type
- Starts again the dependent projects with the CLEAN_IMPORT start type
If the project is already stopped it does nothing.
- Specified by:
cleanRestartProjects
in interfaceIWorkspaceOrchestrator
- Parameters:
projects
- the set of project to stop, cannot benull
.
-
setOperationsEnabled
public void setOperationsEnabled(boolean enabled) Sets whether workspace operations shall be approved. Broadcasts state change events.- Parameters:
enabled
-true
to enable operations,false
to disable
-
isShuttingDown
public boolean isShuttingDown()Description copied from interface:IWorkspaceOrchestrator
Checks if theIWorkspaceOrchestrator
is being shut down at the momemnt. May be used for emergency interruption of long-running non-orchestrated processes- Specified by:
isShuttingDown
in interfaceIWorkspaceOrchestrator
- Returns:
- True if the orchestrator is being shut down at the moment
-