Interface ISnapshotFlow
Snapshot flow is used to prepare a snapshot operation. The flow and the ultimate snapshot operation may affect a limited set of projects which is determined when the flow is created. The set of potentially affected projects may shrink randomly until the snapshot operation is created, e.g. because of project stops.
Until the flow is converted to the snapshot operation or cancelled, it attempts to start exclusive operations for its potentially affected projects. When the flow is converted to the snapshot operation, the set of affected projects is finalized. The projects for which the exclusive operations were not started are released as well as the projects for which no snapshot creations or restorations were scheduled.
 A new snapshot flow can be created with IDtSnapshotManager.createFlow(java.util.Collection). Once created,
 the flow must be either converted to an operation with makeOperation(), or canceled with cancel().
- See Also:
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcancel()Cancels the flow, releasing locks for all affected projects.voidInforms the flow that no more creations or restorations will be scheduled.Converts the flow to a snapshot operation.voidscheduleSnapshotCreation(org.eclipse.core.resources.IProject project, Path snapshotPath) Schedules snapshot creation for the given project.voidscheduleSnapshotRestoration(org.eclipse.core.resources.IProject project, Path snapshotPath) Schedules snapshot restoration for the given project.voidwaitProjectsReady(long timeout) Blocks until the locks for all potentially affected projects are acquired or the timeout elapsed.
- 
Method Details- 
waitProjectsReadyBlocks until the locks for all potentially affected projects are acquired or the timeout elapsed.- Parameters:
- timeout- the maximum waiting time in milliseconds, cannot be negative
- Throws:
- InterruptedException- if the calling thread was interrupted
- IllegalStateException- if the flow was already canceled or converted to the operation
 
- 
scheduleSnapshotCreationSchedules snapshot creation for the given project.The scheduled creation is not guaranteed to be included in the operation. - Parameters:
- project- the project to create snapshot for, cannot be- null
- snapshotPath- the path to store the snapshot, cannot be- null
- Throws:
- IllegalStateException- if the flow was already canceled or converted to the operation, or- finishScheduling()was called
- See Also:
 
- 
scheduleSnapshotRestorationSchedules snapshot restoration for the given project.The scheduled restoration is not guaranteed to be included in the operation. - Parameters:
- project- the project to restore snapshot for, cannot be- null
- snapshotPath- the path to the snapshot, cannot be- null
- Throws:
- IllegalStateException- if the flow was already canceled or converted to the operation, or- finishScheduling()was called
- See Also:
 
- 
finishSchedulingvoid finishScheduling()Informs the flow that no more creations or restorations will be scheduled. At this point the flow may release locks for unaffected projects and manage operation priorities.- Throws:
- IllegalStateException- if the flow was already canceled or converted to the operation, or- finishScheduling()was called.
 
- 
makeOperationIStartSnapshotOperationStep makeOperation()Converts the flow to a snapshot operation.A scheduled snapshot creation or restoration is included in the snapshot operation only if the exclusive lock was obtained for the respective project to this moment. Otherwise, the attempt to obtain a lock for the project is canceled. - Returns:
- start step of the new snapshot operation, never null
- Throws:
- IllegalStateException- if the flow was already canceled or converted to the operation
 
- 
cancelvoid cancel()Cancels the flow, releasing locks for all affected projects.- Throws:
- IllegalStateException- if the flow was already canceled or converted to the operation
 
 
-