Interface IComparisonManager
-
- All Superinterfaces:
IManagedService
public interface IComparisonManager extends IManagedService
The service responsible for managing comparison and merge of V8 projects.WORKFLOW DESCRIPTION
The manager supports parallel processes of comparison and merge of different targets. Every target is represented by a pair of data sources (each of which can be a DT project, a file system folder etc.) with an optional third data source (the so called "common ancestor" of three-way comparison and merge processes). Comparison (and merge) processes, corresponding to these targets, are defined and accessed by so called comparison process handles which are essentially tuples of identifiers of their data sources.
A comparison process is started by calling the#start(IComparisonProcessHandle, MatchingStrategy)
method for its corresponding handle. Comparison is an asynchronous process, reporting its status changes to subscribers. When the comparison process is fully finished, the "Queue Finished" status is reported.For all active comparison processes defined by their handles, comparison sessions are created. Comparison sessions provide access to the comparison model. During and after comparison, the client may communicate with and affect the process itself and its underlying model using the corresponding session. Some operations may even lead to restarting of the finished comparison process.
For certain handles (namely, handles with a V8 project as the main side), merging processes are supported. A merging process can be started upon fully finished comparison processes. During this operation, no interaction with the comparison model is allowed. In some scenarios, various post-merge actions may be performed as decided by the client. After performing those actions (or ignoring them), the merge process is finished. After merging, the comparison process session is automatically discarded.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IComparisonManager.ICompareMergeStatusListener
A listener of compare/merge status changes.
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NAME
Public name of the service for the lifecycle management.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
ableToBreakCorrespondence(ComparisonProcessHandle handle, ComparisonNode comparisonResultNode)
Checks if there is a participant able to break a correspondence stored in the specified node.void
addStatusListener(IComparisonManager.ICompareMergeStatusListener listener)
Adds a comparison status listener.IComparisonSession
getComparisonSession(ComparisonProcessHandle handle)
Returns the comparison session for the specified comparison process handle.ComparisonProcessHandle
getHandle(IV8Project v8Project)
Returns the handle of a comparison process with the specified V8 project as the main participant.List<MergeProblem>
getMergeProblems(ComparisonProcessHandle handle)
Returns a list of all merge problems found during merge validation and merge using external tool phases.IMergeSettingsSerializerService
getMergeSettingsSerializerService()
Returns instance of merge settings serialization service.List<ComparisonNode>
getPotentialCorrespondingNodes(ComparisonProcessHandle handle, ComparisonNode node, ComparisonSide sourceSide)
Returns a list of candidate nodes for setting as corresponding to the specified node.ComparisonProcessStatus
getStatus(ComparisonProcessHandle handle)
Returns the status of a comparison process managed by this.boolean
hasActiveComparison()
Tells if there any active comparison being executed at the moment.void
removeStatusListener(IComparisonManager.ICompareMergeStatusListener listener)
Removes a comparison status listener.void
startComparison(CompareMergeProcessBatch batch)
Schedules asynchronous job that will start the comparison of projects specified by the given batch of compare/merge processes.org.eclipse.core.runtime.IStatus
startMerge(CompareMergeProcessBatch batch, org.eclipse.core.runtime.IProgressMonitor monitor)
Schedules asynchronous job that will merge changes detected in the specified batch of compare/merge processes.void
stop(ComparisonProcessHandle handle)
Forgets the compare/merge process defined by the specified handle and discards its comparison session.-
Methods inherited from interface com._1c.g5.wiring.IManagedService
activate, deactivate
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
Public name of the service for the lifecycle management.- See Also:
- Constant Field Values
-
-
Method Detail
-
startComparison
void startComparison(CompareMergeProcessBatch batch)
Schedules asynchronous job that will start the comparison of projects specified by the given batch of compare/merge processes.- Parameters:
batch
- the batch of compare/merge processes to start comparison for, cannot benull
or empty
-
stop
void stop(ComparisonProcessHandle handle)
Forgets the compare/merge process defined by the specified handle and discards its comparison session. Stops the whole batch of compare/merge processes this handle relates to if this batch is under active comparison. Does nothing if the process in under active merge.- Parameters:
handle
- the handle, notnull
-
getHandle
ComparisonProcessHandle getHandle(IV8Project v8Project)
Returns the handle of a comparison process with the specified V8 project as the main participant.- Parameters:
v8Project
- the V8 project, notnull
- Returns:
- the handle or
null
if there is no comparison process with the specified V8 project
-
getStatus
ComparisonProcessStatus getStatus(ComparisonProcessHandle handle)
Returns the status of a comparison process managed by this.- Parameters:
handle
- the handle of comparison, notnull
- Returns:
- the status of comparison, may be
null
in case if the handle is not known to this
-
hasActiveComparison
boolean hasActiveComparison()
Tells if there any active comparison being executed at the moment.- Returns:
true
if any comparison is being executed,false
otherwise
-
addStatusListener
void addStatusListener(IComparisonManager.ICompareMergeStatusListener listener)
Adds a comparison status listener.- Parameters:
listener
- the status listener, notnull
-
removeStatusListener
void removeStatusListener(IComparisonManager.ICompareMergeStatusListener listener)
Removes a comparison status listener.- Parameters:
listener
- the status listener, notnull
-
startMerge
org.eclipse.core.runtime.IStatus startMerge(CompareMergeProcessBatch batch, org.eclipse.core.runtime.IProgressMonitor monitor)
Schedules asynchronous job that will merge changes detected in the specified batch of compare/merge processes.NOTE that it is not possible to schedule the job if the processes in the batch have not yet been fully compared.
- Parameters:
batch
- the batch of compare/merge processes to start merge for, cannot benull
or emptymonitor
- the progress monitor, may benull
- Returns:
Status.OK_STATUS
if the merge job has been successfully scheduled, an error status otherwise
-
getMergeProblems
List<MergeProblem> getMergeProblems(ComparisonProcessHandle handle)
Returns a list of all merge problems found during merge validation and merge using external tool phases. The list will be empty if no problems found.NOTE that this method may only be called for processes that are in the
ComparisonProcessStatus.MERGE_PROCESS_USING_EXTERNAL_TOOL_FINISHED
orComparisonProcessStatus.MERGE_PROCESS_VALIDATION_FINISHED
state, and an exception will be thrown otherwise.- Parameters:
handle
- the handle of the comparison process to get merge problems of, cannot benull
- Returns:
- a list of merge problems, never
null
-
getComparisonSession
IComparisonSession getComparisonSession(ComparisonProcessHandle handle)
Returns the comparison session for the specified comparison process handle.- Parameters:
handle
- the handle, notnull
- Returns:
- the session, may be
null
if the handle is not known to the manager
-
getPotentialCorrespondingNodes
List<ComparisonNode> getPotentialCorrespondingNodes(ComparisonProcessHandle handle, ComparisonNode node, ComparisonSide sourceSide)
Returns a list of candidate nodes for setting as corresponding to the specified node.- Parameters:
handle
- the comparison process handle, notnull
node
- the comparison result node to find potential correspondences for, notnull
sourceSide
- the source side of the correspondence, notnull
- Returns:
- a list of comparison result nodes, never
null
-
ableToBreakCorrespondence
boolean ableToBreakCorrespondence(ComparisonProcessHandle handle, ComparisonNode comparisonResultNode)
Checks if there is a participant able to break a correspondence stored in the specified node.- Parameters:
handle
- the comparison process handle, notnull
comparisonResultNode
- the node to check whether the correspondence represented by it can be broken, notnull
- Returns:
true
if at least one participant is able to break the correspondence, andfalse
otherwise
-
getMergeSettingsSerializerService
IMergeSettingsSerializerService getMergeSettingsSerializerService()
Returns instance of merge settings serialization service.- Returns:
- implementation of the serialization service, cannot be
null
-
-