org.electrocodeogram.cpc.core.api.provider.merge
Interface IMergeProvider

All Superinterfaces:
IProvider

public interface IMergeProvider
extends IProvider

A part of the Remote Store API, a merge provider takes local and remote clone data and tries to reconcile any conflicts by merging the clone data to correctly reflect the new contents of the corresponding source file.

Source files are not merged by an IMergeProvider. This is left to the normal Eclipse procedures. By the time the merge provider is called, the result of the source file merge is already available.

A IMergeProvider must not have any side effects. It must neither access the IStoreProvider nor the workspace resources in any way.

Author:
vw
See Also:
IMergeTask, IMergeResult

Method Summary
 IMergeTask createTask()
          Creates a new, empty IMergeTask instance which can then be filled with all the required data to descripe the merge task.
 IMergeResult merge(IMergeTask mergeTask)
          Merges local and remote clone data to reflect the new contents of the corresponding source file.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.IProvider
getProviderName, toString
 

Method Detail

merge

IMergeResult merge(IMergeTask mergeTask)
                   throws java.lang.IllegalArgumentException,
                          MergeException
Merges local and remote clone data to reflect the new contents of the corresponding source file.

The concrete merging procedure is left to the implementation. A caller must not make any assumptions about any properties of the merge process.
It is up to the implementation to decide whether to attempt a Three-Way merge. The presence of the required data in the IMergeTask does not guarantee that a Three-Way merge will be executed.

Parameters:
mergeTask - the merge task descriptor for this operation, never null.
Returns:
a merge result descriptor, never null.
Throws:
java.lang.IllegalArgumentException - if the provided IMergeTask is not "valid".
MergeException - if any errors occur during the merge process.
See Also:
IMergeTask, IMergeResult

createTask

IMergeTask createTask()
Creates a new, empty IMergeTask instance which can then be filled with all the required data to descripe the merge task.

The returned IMergeTask is not yet "valid". It must not be passed to merge(IMergeTask) until all required fields have been set.

Returns:
new, empty IMergeTask instance, never null.
See Also:
IMergeTask