com.microsoft.tfs.core.clients.versioncontrol.soapextensions
Class Conflict

java.lang.Object
  extended by com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
      extended by com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Conflict
All Implemented Interfaces:
java.lang.Comparable<Conflict>

public final class Conflict
extends com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
implements java.lang.Comparable<Conflict>

Represents a single conflict between two items.

Since:
TEE-SDK-10.1

Field Summary
 
Fields inherited from class com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
webServiceObject
 
Constructor Summary
Conflict(ms.tfs.versioncontrol.clientservices._03._Conflict conflict)
           
Conflict(Conflict conflict)
          Creates a clone of the given conflict.
 
Method Summary
 boolean canMergeContent()
          Tests whether this conflict needs a content merge.
 int compareTo(Conflict other)
           
 void downloadBaseFile(VersionControlClient client, java.lang.String absolutePath)
          Downloads the content for the base (original) file in the conflict.
 void downloadProperties(Workspace workspace)
           
 void downloadTheirFile(VersionControlClient client, java.lang.String absolutePath)
          Downloads the content for their file in the conflict.
 void downloadYourFile(VersionControlClient client, java.lang.String absolutePath)
          Downloads the content for your file in the conflict.
 ChangeType getBaseChangeType()
           
 int getBaseDeletionID()
           
 java.lang.String getBaseDownloadURL()
           
 FileEncoding getBaseEncoding()
           
 byte[] getBaseHashValue()
           
 int getBaseItemID()
           
 ItemType getBaseItemType()
           
 PropertyValue[] getBaseProperties()
          Properties for BaseServerItem.
 int getBasePropertyID()
           
 java.lang.String getBaseServerItem()
           
 int getBaseVersion()
           
 int getConflictID()
           
 ConflictOptions getConflictOptions()
           
 MergeSummary getContentMergeSummary()
          Gets the summary of the work performed by a content merge for this getWebServiceObject().
 java.lang.String getDetailedMessage(boolean asConflict)
          Converts this conflict into a displayable message.
 java.lang.String getFileExtension()
           
 java.lang.String getFileName()
           
 long getLocalFileLastModifiedDateUsedForHashValue()
          Last Modified UTC time of the local file, which was used to calculate local hash value.
 byte[] getLocalHashValue()
           
 java.lang.String getLocalPath()
           
 java.lang.String getMergedFileName()
           
 int getPendingChangeID()
           
 PropertiesMergeSummary getPropertiesMergeSummary()
          Returns the property merge summary if one has been generated.
 int getReason()
           
 Resolution getResolution()
           
 ResolutionOptions getResolutionOptions()
           
 java.lang.String getServerPath()
           
 java.lang.String getSourceLocalItem()
           
 java.lang.String getTargetLocalItem()
           
 ChangeType getTheirChangeType()
           
 int getTheirDeletionID()
           
 java.lang.String getTheirDownloadURL()
           
 FileEncoding getTheirEncoding()
           
 byte[] getTheirHashValue()
           
 int getTheirItemID()
           
 ItemType getTheirItemType()
           
 int getTheirLastMergedVersion()
           
 PropertyValue[] getTheirProperties()
          Properties for TheirServerItem.
 int getTheirPropertyID()
           
 java.lang.String getTheirServerItem()
           
 java.lang.String getTheirShelvesetDisplayName(Workspace workspace)
          The shelveset display name consists of the shelveset name and username if it's different than the authorized user.
 java.lang.String getTheirShelvesetName()
           
 java.lang.String getTheirShelvesetOwnerName()
           
 int getTheirVersion()
           
 int getTheirVersionFrom()
           
 ConflictType getType()
           
 ms.tfs.versioncontrol.clientservices._03._Conflict getWebServiceObject()
          Gets the web service object this class wraps.
 ChangeType getYourChangeType()
           
 int getYourDeletionID()
           
 java.lang.String getYourDownloadURL()
           
 FileEncoding getYourEncoding()
           
 int getYourItemID()
           
 ItemType getYourItemType()
           
 int getYourLastMergedVersion()
           
 ChangeType getYourLocalChangeType()
           
 PropertyValue[] getYourProperties()
          Properties for YourServerItem.
 int getYourPropertyID()
           
 java.lang.String getYourServerItem()
           
 java.lang.String getYourServerItemSource()
           
 int getYourVersion()
           
 boolean hasConflictingContentChange()
          Determine if the conflict contains one or more conflicting change.
 boolean hasConflictingPropertyChange()
          Determine if the conflict contains conflicting property changes.
 boolean hasLocalTargetContentChangeOnly()
          Return True only if the conflict has ContentMergeSummary calculated and the conflicting and source/server chunks are 0, but local/target are not zero.
 boolean hasNoLocalRenames()
           
 boolean hasSourceServerContentChangeOnly()
          Return True only if the conflict has ContentMergeSummary calculated and the conflicting and target/local chunks are 0, but source/server are not zero.
 boolean isAutoMergeApplicable(AutoResolveOptions resolveOptions)
          Return True if conflict can be auto resolved as AcceptMerge in the given mode.
 boolean isAutoResolved()
          True if this conflict was resolved automatically.
 boolean isBaseless()
           
 boolean isBasicMergeAllowed(Workspace workspace)
          Check the basic requirements for merge operation.
 boolean isBinary()
           
 boolean isEncodingChanged()
          Check to see if the encoding has changed.
 boolean isEncodingMismatched()
           
 boolean isForced()
           
 boolean isFromDeletedShelveset()
           
 boolean isLocalOrTargetFileInVersionControl()
          Check to see if the local/target file is in version control.
 boolean isNameChanged()
          Check to see if the file name has changed.
 boolean isNameChangeIsRedundant()
           
 boolean isNamespaceConflict()
           
 boolean isPropertyConflict()
           
 boolean isRedundant(boolean quick, Workspace workspace)
          Verifies that this conflict is caused by 2 identical changes.
 boolean isResolved()
           
 boolean isRollbackConflict()
           
 boolean isShelvesetConflict()
           
 boolean isTheirNameChanged()
           
 boolean isValidForAutoMerge(Workspace workspace)
           
 boolean isVersionConflictAndServerItemDoesNotExist()
           
 boolean isVersionGetCheckinConflict()
           
 boolean isYourNameChanged()
           
 PropertiesMergeSummary mergeProperties(Workspace workspace)
          Generates the properties merge summary.
 boolean requiresExplicitAcceptMerge()
          Returns true if the AcceptMerge resolution is not conservative and may produce unexpected results.
 void resetChangeSummaryIfLocalFileModified()
          Removes ChangeSummary and merge file if local file was modified after those values were calculated.
 void setAutoResolved(boolean autoResolved)
           
 void setBaseChangeType(ChangeType baseChangeType)
           
 void setBaseDeletionID(int baseDeletionID)
           
 void setBaseEncoding(int baseEncoding)
           
 void setBaseHashValue(byte[] baseHashValue)
           
 void setBaseItemID(int baseItemID)
           
 void setBaseItemType(ItemType baseItemType)
           
 void setBaseServerItem(java.lang.String baseServerItem)
           
 void setBaseVersion(int baseVersion)
           
 void setConflictID(int conflictID)
           
 void setConflictOptions(ConflictOptions options)
           
 void setContentMergeSummary(MergeSummary summary)
          Sets the summary of the merge operation.
 void setForced(boolean isForced)
           
 void setLocalFileLastModifiedDateUsedForHashValue(long localFileLastModifiedDateUsedForHashValue)
           
 void setLocalFileLastModifiedDateUsedForThreeWayMerge(long localFileLastModifiedDateUsedForThreeWayMerge)
          Last Modified UTC time of the local file, which was used for performing three way merge and creating merge file.
 void setLocalHashValue(byte[] localHashValue)
           
 void setMergedFileName(java.lang.String file)
           
 void setNamespaceConflict(boolean isNamespaceConflict)
           
 void setPendingChangeID(int pendingChangeID)
           
 void setReason(int reason)
           
 void setResolution(Resolution resolution)
           
 void setResolutionOptions(ResolutionOptions options)
           
 void setResolved(boolean isResolved)
           
 void setSourceLocalItem(java.lang.String sourceLocalItem)
           
 void setTargetLocalItem(java.lang.String targetLocalItem)
           
 void setTheirDeletionID(int theirDeletionID)
           
 void setTheirEncoding(int theirEncoding)
           
 void setTheirHashValue(byte[] theirHashValue)
           
 void setTheirItemID(int theirItemID)
           
 void setTheirItemType(ItemType theirItemType)
           
 void setTheirLastMergedVersion(int theirLastMergedVersion)
           
 void setTheirServerItem(java.lang.String theirServerItem)
           
 void setTheirVersion(int theirVersion)
           
 void setType(ConflictType type)
           
 void setYourChangeType(ChangeType yourChangeType)
           
 void setYourDeletionID(int yourDeletionID)
           
 void setYourEncoding(int yourEncoding)
           
 void setYourItemID(int yourItemID)
           
 void setYourItemType(ItemType yourItemType)
           
 void setYourLastMergedVersion(int yourLastMergedVersion)
           
 void setYourLocalChangeType(ChangeType yourLocalChangeType)
           
 void setYourServerItem(java.lang.String yourServerItem)
           
 void setYourServerItemSource(java.lang.String yourServerItemSource)
           
 void setYourVersion(int yourVersion)
           
 boolean theirFileExists()
           
 void updateLocalHashValue()
          Updates LocalHashValue if it's invalid.
 
Methods inherited from class com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Conflict

public Conflict(ms.tfs.versioncontrol.clientservices._03._Conflict conflict)

Conflict

public Conflict(Conflict conflict)
Creates a clone of the given conflict. This is useful because conflict resolution is eaiser when it can modify a copy, and discard the copy if things go bad.

Parameters:
conflict - the conflict to copy (must not be null)
Method Detail

getWebServiceObject

public ms.tfs.versioncontrol.clientservices._03._Conflict getWebServiceObject()
Gets the web service object this class wraps. The returned object should not be modified.

Returns:
the web service object this class wraps.

compareTo

public int compareTo(Conflict other)
Specified by:
compareTo in interface java.lang.Comparable<Conflict>

getBaseChangeType

public ChangeType getBaseChangeType()

getBaseDeletionID

public int getBaseDeletionID()

getBaseEncoding

public FileEncoding getBaseEncoding()

getBasePropertyID

public int getBasePropertyID()

getBaseHashValue

public byte[] getBaseHashValue()

getBaseItemID

public int getBaseItemID()

getBaseItemType

public ItemType getBaseItemType()

getBaseServerItem

public java.lang.String getBaseServerItem()

getBaseVersion

public int getBaseVersion()

getConflictID

public int getConflictID()

getPendingChangeID

public int getPendingChangeID()

getReason

public int getReason()

getResolution

public Resolution getResolution()

getSourceLocalItem

public java.lang.String getSourceLocalItem()

getTargetLocalItem

public java.lang.String getTargetLocalItem()

getTheirChangeType

public ChangeType getTheirChangeType()

getTheirDeletionID

public int getTheirDeletionID()

getTheirEncoding

public FileEncoding getTheirEncoding()

getTheirPropertyID

public int getTheirPropertyID()

getTheirHashValue

public byte[] getTheirHashValue()

getTheirItemID

public int getTheirItemID()

getTheirItemType

public ItemType getTheirItemType()

getTheirLastMergedVersion

public int getTheirLastMergedVersion()

getTheirServerItem

public java.lang.String getTheirServerItem()

getTheirVersion

public int getTheirVersion()

getTheirVersionFrom

public int getTheirVersionFrom()

getType

public ConflictType getType()

getYourChangeType

public ChangeType getYourChangeType()

getYourDeletionID

public int getYourDeletionID()

getYourEncoding

public FileEncoding getYourEncoding()

getYourPropertyID

public int getYourPropertyID()

getYourItemID

public int getYourItemID()

getYourItemType

public ItemType getYourItemType()

getYourLastMergedVersion

public int getYourLastMergedVersion()

getYourLocalChangeType

public ChangeType getYourLocalChangeType()

getYourServerItem

public java.lang.String getYourServerItem()

getYourServerItemSource

public java.lang.String getYourServerItemSource()

getYourVersion

public int getYourVersion()

getConflictOptions

public ConflictOptions getConflictOptions()

isForced

public boolean isForced()

isNamespaceConflict

public boolean isNamespaceConflict()

isShelvesetConflict

public boolean isShelvesetConflict()

isResolved

public boolean isResolved()

setBaseChangeType

public void setBaseChangeType(ChangeType baseChangeType)

setBaseDeletionID

public void setBaseDeletionID(int baseDeletionID)

setBaseEncoding

public void setBaseEncoding(int baseEncoding)

setBaseHashValue

public void setBaseHashValue(byte[] baseHashValue)

setBaseItemID

public void setBaseItemID(int baseItemID)

setBaseItemType

public void setBaseItemType(ItemType baseItemType)

setBaseServerItem

public void setBaseServerItem(java.lang.String baseServerItem)

setBaseVersion

public void setBaseVersion(int baseVersion)

setConflictID

public void setConflictID(int conflictID)

setForced

public void setForced(boolean isForced)

setNamespaceConflict

public void setNamespaceConflict(boolean isNamespaceConflict)

setResolved

public void setResolved(boolean isResolved)

setPendingChangeID

public void setPendingChangeID(int pendingChangeID)

setReason

public void setReason(int reason)

setResolution

public void setResolution(Resolution resolution)

setSourceLocalItem

public void setSourceLocalItem(java.lang.String sourceLocalItem)

setTargetLocalItem

public void setTargetLocalItem(java.lang.String targetLocalItem)

setTheirDeletionID

public void setTheirDeletionID(int theirDeletionID)

setTheirEncoding

public void setTheirEncoding(int theirEncoding)

setTheirHashValue

public void setTheirHashValue(byte[] theirHashValue)

setTheirItemID

public void setTheirItemID(int theirItemID)

setTheirItemType

public void setTheirItemType(ItemType theirItemType)

setTheirLastMergedVersion

public void setTheirLastMergedVersion(int theirLastMergedVersion)

setTheirServerItem

public void setTheirServerItem(java.lang.String theirServerItem)

setTheirVersion

public void setTheirVersion(int theirVersion)

setType

public void setType(ConflictType type)

setYourChangeType

public void setYourChangeType(ChangeType yourChangeType)

setYourDeletionID

public void setYourDeletionID(int yourDeletionID)

setYourEncoding

public void setYourEncoding(int yourEncoding)

setYourItemID

public void setYourItemID(int yourItemID)

setYourItemType

public void setYourItemType(ItemType yourItemType)

setYourLastMergedVersion

public void setYourLastMergedVersion(int yourLastMergedVersion)

setYourLocalChangeType

public void setYourLocalChangeType(ChangeType yourLocalChangeType)

setYourServerItem

public void setYourServerItem(java.lang.String yourServerItem)

setYourServerItemSource

public void setYourServerItemSource(java.lang.String yourServerItemSource)

setYourVersion

public void setYourVersion(int yourVersion)

setConflictOptions

public void setConflictOptions(ConflictOptions options)

getBaseDownloadURL

public java.lang.String getBaseDownloadURL()

getTheirDownloadURL

public java.lang.String getTheirDownloadURL()

getYourDownloadURL

public java.lang.String getYourDownloadURL()

getTheirShelvesetName

public java.lang.String getTheirShelvesetName()

getTheirShelvesetOwnerName

public java.lang.String getTheirShelvesetOwnerName()

getMergedFileName

public java.lang.String getMergedFileName()

setMergedFileName

public void setMergedFileName(java.lang.String file)

setResolutionOptions

public void setResolutionOptions(ResolutionOptions options)

getResolutionOptions

public ResolutionOptions getResolutionOptions()

setContentMergeSummary

public void setContentMergeSummary(MergeSummary summary)
Sets the summary of the merge operation.

Parameters:
summary - the merge summary.

getContentMergeSummary

public MergeSummary getContentMergeSummary()
Gets the summary of the work performed by a content merge for this getWebServiceObject(). Null if not set (no merge done).

Returns:
the merge summary (null if not set).

canMergeContent

public boolean canMergeContent()
Tests whether this conflict needs a content merge.

Returns:
true if this conflict's content can be merged, false if the type of conflict would not allow a content merge. Does not check whether this conflict has already been resolved (can return true after a resolution has been set)

getLocalPath

public java.lang.String getLocalPath()
Returns:
this conflict's local path or intended local path

getServerPath

public java.lang.String getServerPath()
Returns:
this conflict's server path

getTheirShelvesetDisplayName

public java.lang.String getTheirShelvesetDisplayName(Workspace workspace)
The shelveset display name consists of the shelveset name and username if it's different than the authorized user. If this is an unshelve conflict, but the shelveset was deleted, returns "Shelveset deleted". If this is not an unshelve conflict, returns null.

Returns:
The shelveset display name (may be null)

downloadBaseFile

public void downloadBaseFile(VersionControlClient client,
                             java.lang.String absolutePath)
Downloads the content for the base (original) file in the conflict. Throws if there is no base file, which is only valid for conflicts of type Merge.

Parameters:
absolutePath - where to save the downloaded file contents

downloadTheirFile

public void downloadTheirFile(VersionControlClient client,
                              java.lang.String absolutePath)
Downloads the content for their file in the conflict. Throws if there is no their file.

Parameters:
absolutePath - where to save the downloaded file contents

downloadYourFile

public void downloadYourFile(VersionControlClient client,
                             java.lang.String absolutePath)
Downloads the content for your file in the conflict. Throws if there is no your file.

Parameters:
absolutePath - where to save the downloaded file contents

theirFileExists

public boolean theirFileExists()
Returns:
true if their side of the conflict has a file associated with it.

requiresExplicitAcceptMerge

public boolean requiresExplicitAcceptMerge()
Returns true if the AcceptMerge resolution is not conservative and may produce unexpected results. Examples are undeleting a file (edit-delete conflict) or deleting it (delete-edit conflicts).


isEncodingMismatched

public boolean isEncodingMismatched()
Returns:
true if base, their and your encoding values are different.

isBaseless

public boolean isBaseless()
Returns:
true if this is the result of a baseless merge.

isBinary

public boolean isBinary()
Returns:
true if either base, their or your encoding is binary.

isBasicMergeAllowed

public boolean isBasicMergeAllowed(Workspace workspace)
Check the basic requirements for merge operation. Does not validate that content needs merging (CanMergeContent). Allows different encodings, because user can override them.


isEncodingChanged

public boolean isEncodingChanged()
Check to see if the encoding has changed.


isPropertyConflict

public boolean isPropertyConflict()
Returns:
true if this conflict has conflicting properties

isLocalOrTargetFileInVersionControl

public boolean isLocalOrTargetFileInVersionControl()
Check to see if the local/target file is in version control.


getFileName

public java.lang.String getFileName()
Returns:
the calculated file name for this conflict

getFileExtension

public java.lang.String getFileExtension()
Returns:
the file extension for this conflict or the empty string if the file lacks an extension (never null)

isAutoResolved

public boolean isAutoResolved()
True if this conflict was resolved automatically.


setAutoResolved

public void setAutoResolved(boolean autoResolved)

isFromDeletedShelveset

public boolean isFromDeletedShelveset()
Returns:
true if IsFromShelveset = true and their shelveset was deleted.

isVersionConflictAndServerItemDoesNotExist

public boolean isVersionConflictAndServerItemDoesNotExist()
Returns:
true if this is a version conflict and the server item doesn't exst at the requested version.

isVersionGetCheckinConflict

public boolean isVersionGetCheckinConflict()
Returns:
true if this conflict is a version get/checkin conflict.

isRollbackConflict

public boolean isRollbackConflict()
Returns:
true if this is a rollback conflict.

isNameChanged

public boolean isNameChanged()
Check to see if the file name has changed.


isYourNameChanged

public boolean isYourNameChanged()

isTheirNameChanged

public boolean isTheirNameChanged()

isNameChangeIsRedundant

public boolean isNameChangeIsRedundant()

hasNoLocalRenames

public boolean hasNoLocalRenames()
Returns:
true if there is no local/target (YourChangeType) rename, false otherwise

isValidForAutoMerge

public boolean isValidForAutoMerge(Workspace workspace)
Returns:
true if this conflict is valid for AcceptMerge with no additional arguments

isAutoMergeApplicable

public boolean isAutoMergeApplicable(AutoResolveOptions resolveOptions)
Return True if conflict can be auto resolved as AcceptMerge in the given mode. This method requires ContentMergeSummary to be calculated.


getLocalFileLastModifiedDateUsedForHashValue

public long getLocalFileLastModifiedDateUsedForHashValue()
Last Modified UTC time of the local file, which was used to calculate local hash value. Value is expressed in Ticks.


setLocalFileLastModifiedDateUsedForHashValue

public void setLocalFileLastModifiedDateUsedForHashValue(long localFileLastModifiedDateUsedForHashValue)

updateLocalHashValue

public void updateLocalHashValue()
Updates LocalHashValue if it's invalid. The hash is calculated even if the conflict content has not changed (e.g. rename conflict).


isRedundant

public boolean isRedundant(boolean quick,
                           Workspace workspace)
Verifies that this conflict is caused by 2 identical changes.

Parameters:
quick - If true, does not recalculate local file hash and quickly fails. If false, computes hash if it's not valid.

resetChangeSummaryIfLocalFileModified

public void resetChangeSummaryIfLocalFileModified()
Removes ChangeSummary and merge file if local file was modified after those values were calculated.


hasLocalTargetContentChangeOnly

public boolean hasLocalTargetContentChangeOnly()
Return True only if the conflict has ContentMergeSummary calculated and the conflicting and source/server chunks are 0, but local/target are not zero. False otherwise.


hasSourceServerContentChangeOnly

public boolean hasSourceServerContentChangeOnly()
Return True only if the conflict has ContentMergeSummary calculated and the conflicting and target/local chunks are 0, but source/server are not zero. False otherwise.


hasConflictingContentChange

public boolean hasConflictingContentChange()
Determine if the conflict contains one or more conflicting change.


hasConflictingPropertyChange

public boolean hasConflictingPropertyChange()
Determine if the conflict contains conflicting property changes.


getLocalHashValue

public byte[] getLocalHashValue()

setLocalHashValue

public void setLocalHashValue(byte[] localHashValue)

setLocalFileLastModifiedDateUsedForThreeWayMerge

public void setLocalFileLastModifiedDateUsedForThreeWayMerge(long localFileLastModifiedDateUsedForThreeWayMerge)
Last Modified UTC time of the local file, which was used for performing three way merge and creating merge file.


mergeProperties

public PropertiesMergeSummary mergeProperties(Workspace workspace)
Generates the properties merge summary. Returns null if there is not a property conflict.


getPropertiesMergeSummary

public PropertiesMergeSummary getPropertiesMergeSummary()
Returns the property merge summary if one has been generated.


getYourProperties

public PropertyValue[] getYourProperties()
Properties for YourServerItem. Not populated until downloadProperties(Workspace) or mergeProperties(Workspace) is called.


getTheirProperties

public PropertyValue[] getTheirProperties()
Properties for TheirServerItem. Not populated until downloadProperties(Workspace) or mergeProperties(Workspace) is called.


getBaseProperties

public PropertyValue[] getBaseProperties()
Properties for BaseServerItem. Not populated until downloadProperties(Workspace) or mergeProperties(Workspace) is called.


downloadProperties

public void downloadProperties(Workspace workspace)

getDetailedMessage

public java.lang.String getDetailedMessage(boolean asConflict)
Converts this conflict into a displayable message.

This method returns rather short messages. It's mainly for the CLC. See ConflictDescription for use in a graphical environment.

Parameters:
asConflict - the displayable message for this conflict
Returns:
the message


© 2015 Microsoft. All rights reserved.