Class WorkspaceOrchestratorMock
- All Implemented Interfaces:
IWorkspaceOrchestrator,IManagedService
IWorkspaceOrchestrator.-
Constructor Summary
ConstructorsConstructorDescriptionWorkspaceOrchestratorMock(IDtProjectManager dtProjectManager) Creates a newWorkspaceOrchestratorMock. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidaddListener(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.voidcancelOperation(Object handle) Cancels the operation associated with the specifiedhandle.voidcleanRestartProject(IDtProject project) Cleans and restarts the specifiedproject.voidcleanRestartProjects(Collection<IDtProject> projects) Cleans and restarts the specifiedproject's.voidvoidendOperation(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.booleanChecks if theIWorkspaceOrchestratoris being shut down at the momemnt.booleanisStarted(IDtProject project) Checks whether the specifiedprojectis started or not.booleanisStarted(org.eclipse.core.resources.IProject project) Checks whether the specifiedprojectis started or not.voidjobCancelled(IDtProject project, ProjectPipelineJob job) Notifies orchestrator that the job is cancelled.voidjobComplete(IDtProject project, ProjectPipelineJob job) Notifies orchestrator that the job is complete.voidjobInterrupted(IDtProject project, ProjectPipelineJob job) Notifies orchestrator that the job is interrupted.voidremoveListener(IWorkspaceOrchestratorListener listener) Removes the specifiedlistener.booleanrequestJob(IDtProject project, ProjectPipelineJob job) Requests execution project pipeline job.voidsetOperationsEnabled(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.voidstartWorkspaceProjects(Collection<WorkspaceProjectStartRequest> startRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Starts the specified project contexts.voidstopProject(IDtProject project, ProjectStopType stopType) Stops the specifiedproject.voidstopWorkspaceProjects(Collection<WorkspaceProjectStopRequest> stopRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Stops the specified project contexts.booleantryStartOperation(Object handle) Tries to start operation associated with the specifiedhandleobject.voidwaitUntilStarted(IDtProject project, Duration duration) Wait until the specifiedprojectis started.voidwaitUntilStarted(org.eclipse.core.resources.IProject project, Duration duration) Wait until the specifiedprojectis started.voidwaitUntilStopped(IDtProject project, Duration duration) Wait until the specifiedprojectis stopped.
-
Constructor Details
-
WorkspaceOrchestratorMock
Creates a newWorkspaceOrchestratorMock.- Parameters:
dtProjectManager- the DT project manager, cannot benull
-
-
Method Details
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein 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:IWorkspaceOrchestratorStarts the specifiedproject.Note: this method is a shortcut for
IWorkspaceOrchestrator.startProject(String, String, Collection, IProject, Object, ProjectStartType, Map, IProgressMonitor)with an empty map as thecustomPropertiesargument.- Specified by:
startProjectin 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:IWorkspaceOrchestratorStarts the specifiedproject.It performs the next sequence of actions:
- (Optional) Shedules build if the
startTypeis 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:
startProjectin 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:IWorkspaceOrchestratorStops 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:
stopProjectin 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:IWorkspaceOrchestratorStarts 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:
startWorkspaceProjectsin interfaceIWorkspaceOrchestrator- Parameters:
startRequests- the start requests, cannot benull.monitor- the progress monitor, can benull. If it'snulltheNullProgressMonitorwill be used.
-
stopWorkspaceProjects
public void stopWorkspaceProjects(Collection<WorkspaceProjectStopRequest> stopRequests, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IWorkspaceOrchestratorStops 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:
stopWorkspaceProjectsin interfaceIWorkspaceOrchestrator- Parameters:
stopRequests- the stop requests, cannot benull.monitor- the progress monitor, can benull. If it'snulltheNullProgressMonitorwill be used.
-
isStarted
Description copied from interface:IWorkspaceOrchestratorChecks whether the specifiedprojectis started or not.- Specified by:
isStartedin interfaceIWorkspaceOrchestrator- Parameters:
project- the project to check, cannot benull.- Returns:
trueif theprojectis started,false- otherwise.
-
isStarted
public boolean isStarted(org.eclipse.core.resources.IProject project) Description copied from interface:IWorkspaceOrchestratorChecks whether the specifiedprojectis started or not.- Specified by:
isStartedin interfaceIWorkspaceOrchestrator- Parameters:
project- the project to check, cannot benull.- Returns:
trueif theprojectis started,false- otherwise.
-
waitUntilStopped
Description copied from interface:IWorkspaceOrchestratorWait until the specifiedprojectis stopped.- Specified by:
waitUntilStoppedin interfaceIWorkspaceOrchestrator- Parameters:
project- the project to wait for stop, cannot benull.duration- the duration to wait, cannot benull.
-
waitUntilStarted
Description copied from interface:IWorkspaceOrchestratorWait until the specifiedprojectis started.- Specified by:
waitUntilStartedin interfaceIWorkspaceOrchestrator- Parameters:
project- the project to wait for start, cannot benull.duration- the duration to wait, cannot benull.
-
waitUntilStarted
Description copied from interface:IWorkspaceOrchestratorWait until the specifiedprojectis started.- Specified by:
waitUntilStartedin 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:IWorkspaceOrchestratorEnqueues the exclusive operation.- Specified by:
enqueueExclusiveOperationin 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:IWorkspaceOrchestratorEnqueues half exclusive operation.- Specified by:
enqueueHalfExclusiveOperationin 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:IWorkspaceOrchestratorEnqueues half exclusive operation with optional implicit wait cancelling- Specified by:
enqueueHalfExclusiveOperationin 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:IWorkspaceOrchestratorEnqueues background operation.- Specified by:
enqueueBackgroundOperationin 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:IWorkspaceOrchestratorEnqueues the modal operation.- Specified by:
enqueueModalOperationin 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:IWorkspaceOrchestratorShortcut for the#enqueueModalOperation(String, Collection, ProjectPipelineJob)followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)is succeed.- Specified by:
beginModalOperationin 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:IWorkspaceOrchestratorShortcut for theIWorkspaceOrchestrator.enqueueExclusiveOperation(String, Collection, ProjectPipelineJob)followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)is succeed.- Specified by:
beginExclusiveOperationin 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:IWorkspaceOrchestratorShortcut for theIWorkspaceOrchestrator.enqueueHalfExclusiveOperation(String, Collection, ProjectPipelineJob)followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)is succeed.- Specified by:
beginHalfExclusiveOperationin 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:IWorkspaceOrchestratorShortcut for theIWorkspaceOrchestrator.enqueueBackgroundOperation(String, Collection, ProjectPipelineJob)followed by waiting until theIWorkspaceOrchestrator.tryStartOperation(Object)is succeed.- Specified by:
beginBackgroundOperationin 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:IWorkspaceOrchestratorTries to start operation associated with the specifiedhandleobject.- Specified by:
tryStartOperationin interfaceIWorkspaceOrchestrator- Parameters:
handle- the operation handle, cannot benull.- Returns:
trueif the operation allowed,falseotherwise.
-
endOperation
Description copied from interface:IWorkspaceOrchestratorEnds the operation associated with the specifiedhandle.- Specified by:
endOperationin interfaceIWorkspaceOrchestrator- Parameters:
handle- the operation handle, cannot benull.
-
cancelOperation
Description copied from interface:IWorkspaceOrchestratorCancels the operation associated with the specifiedhandle.- Specified by:
cancelOperationin interfaceIWorkspaceOrchestrator- Parameters:
handle- the operation handle, cannot benull.
-
addListener
Description copied from interface:IWorkspaceOrchestratorAdds the specifiedlistener.- Specified by:
addListenerin interfaceIWorkspaceOrchestrator- Parameters:
listener- the orchestrator listener to add, cannot benull.
-
removeListener
Description copied from interface:IWorkspaceOrchestratorRemoves the specifiedlistener.- Specified by:
removeListenerin interfaceIWorkspaceOrchestrator- Parameters:
listener- the orchestrator listener to remove, cannot benull.
-
requestJob
Description copied from interface:IWorkspaceOrchestratorRequests execution project pipeline job.- Specified by:
requestJobin interfaceIWorkspaceOrchestrator- Parameters:
project- the project, cannot benull.job- the job, cannot benull.- Returns:
trueif the execution is allowed,falseotherwise.
-
jobComplete
Description copied from interface:IWorkspaceOrchestratorNotifies orchestrator that the job is complete.- Specified by:
jobCompletein interfaceIWorkspaceOrchestrator- Parameters:
project- the project, cannot benull.job- the job, cannot benull.
-
jobCancelled
Description copied from interface:IWorkspaceOrchestratorNotifies orchestrator that the job is cancelled.- Specified by:
jobCancelledin interfaceIWorkspaceOrchestrator- Parameters:
project- the project, cannot benull.job- the job, cannot benull.
-
jobInterrupted
Description copied from interface:IWorkspaceOrchestratorNotifies orchestrator that the job is interrupted.- Specified by:
jobInterruptedin interfaceIWorkspaceOrchestrator- Parameters:
project- the project, cannot benull.job- the job, cannot benull.
-
cleanRestartProject
Description copied from interface:IWorkspaceOrchestratorCleans 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:
cleanRestartProjectin interfaceIWorkspaceOrchestrator- Parameters:
project- the project to stop, cannot benull.
-
cleanRestartProjects
Description copied from interface:IWorkspaceOrchestratorCleans 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:
cleanRestartProjectsin 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-trueto enable operations,falseto disable
-
isShuttingDown
public boolean isShuttingDown()Description copied from interface:IWorkspaceOrchestratorChecks if theIWorkspaceOrchestratoris being shut down at the momemnt. May be used for emergency interruption of long-running non-orchestrated processes- Specified by:
isShuttingDownin interfaceIWorkspaceOrchestrator- Returns:
- True if the orchestrator is being shut down at the moment
-