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


public interface IMergeTask

A task description object for the IMergeProvider.

An instance can be obtained via IMergeProvider.createTask().

Some values are required, some values are optional.
Depending on the provided data a Two-Way or a Three-Way merge may be executed by the merge provider.

The contents of a IMergeTask must not be modified in any way once it has been completely filled with data.

Rationale:

Depending on the persistence provider used, it may not always be possible for a CPC Sensor and CPC Remote Store provider to obtain all the data needed for a Three-Way merge.
To allow maximum flexibility an IMergeProvider must thus be able to handle Two-Way merges if the data required for a Three-Way merge can not be provided.

Author:
vw
See Also:
IMergeProvider, IMergeProvider.createTask()

Method Summary
 boolean isValid()
          Checks whether this task is valid.
 void setBaseCloneFile(ICloneFile cloneFile)
          The common base ICloneFile instance.
 void setBaseClones(java.util.List<IClone> clones)
          The common base IClone instances.
 void setBaseSourceFileContent(java.lang.String content)
          The common base source file content.
 void setLocalBaseInSyncHint(boolean localBaseInSyncHint)
          Specifies whether the current revision is in sync with the base revision.
 void setLocalCloneFile(ICloneFile cloneFile)
          The local ICloneFile instance (before the merge).
 void setLocalClones(java.util.List<IClone> clones)
          The local IClone instances (before the merge).
 void setLocalSourceFileContent(java.lang.String content)
          The local source file content before the merge.
 void setMergedSourceFileContent(java.lang.String content)
          The result of the merge of the two source files.
 void setRemoteCloneFile(ICloneFile cloneFile)
          The remote ICloneFile instance (before the merge).
 void setRemoteClones(java.util.List<IClone> clones)
          The remote IClone instances (before the merge).
 void setRemoteSourceFileContent(java.lang.String content)
          The remote source file content before the merge.
 java.lang.String toString()
          All implementations should provide a meaningful toString() method for debugging purposes.
 

Method Detail

setLocalCloneFile

void setLocalCloneFile(ICloneFile cloneFile)
The local ICloneFile instance (before the merge).

Required value.

Parameters:
cloneFile - old local clone file instance, never null.

setLocalClones

void setLocalClones(java.util.List<IClone> clones)
The local IClone instances (before the merge).

Required value.

Parameters:
clones - old local clones, may be empty, never null.

setLocalSourceFileContent

void setLocalSourceFileContent(java.lang.String content)
The local source file content before the merge.

Required value.

Parameters:
content - old local content of the source file, never null.

setLocalBaseInSyncHint

void setLocalBaseInSyncHint(boolean localBaseInSyncHint)
Specifies whether the current revision is in sync with the base revision.

In some cases no information about the base revision might be available. However, the caller may still be able to determine whether the current local clone data was potentially modified or whether it can be guaranteed to be in sync with the base revision.

The default value is false which indicates that nothing is known about the synchronisation status between the local and the base revision.

If the caller can guarantee that the local clone data was not modified and that thus no merge is needed, this value should be set to true.

If this value is true a merge provider may simply "overwrite" the local clone data with the remote clone data without merging.

Parameters:
localBaseInSyncHint - False (default) if local and base revision might differ. True if local and base revision are guaranteed to be in sync.

setRemoteCloneFile

void setRemoteCloneFile(ICloneFile cloneFile)
The remote ICloneFile instance (before the merge).

Required value.

Parameters:
cloneFile - old remote clone file instance, never null.

setRemoteClones

void setRemoteClones(java.util.List<IClone> clones)
The remote IClone instances (before the merge).

Required value.

Parameters:
clones - old remote clones, may be empty, never null.

setRemoteSourceFileContent

void setRemoteSourceFileContent(java.lang.String content)
The remote source file content before the merge.

Required value.

Parameters:
content - old remote content of the source file, may be NULL.

setBaseCloneFile

void setBaseCloneFile(ICloneFile cloneFile)
The common base ICloneFile instance.

Optional value.

Parameters:
cloneFile - common base clone file instance, may be NULL.

setBaseClones

void setBaseClones(java.util.List<IClone> clones)
The common base IClone instances.

Optional value.

Parameters:
clones - common base clones, may be empty, may be NULL.

setBaseSourceFileContent

void setBaseSourceFileContent(java.lang.String content)
The common base source file content.

Optional value.

Parameters:
content - common base content of the source file, may be NULL.

setMergedSourceFileContent

void setMergedSourceFileContent(java.lang.String content)
The result of the merge of the two source files.

Required value.

Parameters:
content - the content of the new source file on disk, never null.

isValid

boolean isValid()
Checks whether this task is valid.

Returns:
true if all required fields have been set, false otherwise.

toString

java.lang.String toString()
All implementations should provide a meaningful toString() method for debugging purposes.

Overrides:
toString in class java.lang.Object