Class ComparisonSession
java.lang.Object
com._1c.g5.v8.dt.internal.compare.ComparisonSession
- All Implemented Interfaces:
IComparisonSession,IProgressMonitorContainer
Comparison session implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com._1c.g5.v8.dt.compare.core.IComparisonSession
IComparisonSession.IComparisonTreeListener -
Constructor Summary
ConstructorsConstructorDescriptionComparisonSession(ComparisonProcessHandle handle, IComparisonProcessStore comparisonProcessStore, ComparisonManager comparisonManager, IResourceStore resourceStore, IComparisonProcessSettings settings, ISupplySettingsManager supplySettingsManager, ComparisonDataSourceFactory comparisonDataSourceFactory) Constructs a new session. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(ComparisonNode parentNode, ComparisonNode childNode, IComparedObjects<?> comparedObjects) Adds the specified child node to the specified parent node.voidAdds a comparison result listener.voidaddMergeProblems(Collection<? extends MergeProblem> mergeProblems) Adds a collection of merge problems.voidaddProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Adds the specified progress monitor working in the UI-less thread.voidaddProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor, org.eclipse.swt.widgets.Display display) Adds the specified progress monitor and display that should be used for asynchronous communication with that monitor to this container.booleanadoptExternalProperty(ExternalPropertyComparisonData extPropData) Adopts the given external property if possible.org.eclipse.emf.ecore.EStructuralFeatureadoptMainSideFeature(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature) Converts, if possible, the main side feature into a other supported by the other side object.booleanareExplicitCorrespondencesSet(ComparisonSide sourceSide, ComparisonSide targetSide) An optimization flag indicating whether explicit correspondence settings are set for the specified direction.voidbuildFinalMergeSettings(ComparisonSession session, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Calculates and sets final comparison flags and merge settings to all tree nodes.voidbuildNodeMergeSettings(TopComparisonNode node, List<Long> childrenToCompareLater, ComparisonContext comparisonContext) Calculates and sets comparison flags and merge settings to the specified top node and all its children.voidChecks the comparison for the memory overload.voidclearCaches(ComparisonNode node) Clears compared object cache for the specified node.voidCleares all found merge problems for this comparison session.voidRemoves the restored merge settings used in the comparison process.Gets BM engien.getComparedObjects(ComparisonNode node, ComparisonContext comparisonContext) Returns a triple of compared objects for the specified node.getComparedObjects(ComparisonNode node, AbstractComparedEmfObjects<?> topParents, ComparisonContext comparisonContext) Returns a triple of compared objects for the specified node.Returns a collection of correspondences between compared objects.getDataSource(ComparisonSide side) Returns the comparison data source by its side.getDirectCorrespondence(String source, ComparisonSide sourceSide, ComparisonSide targetSide) Returns the symbolic link corresponding to the given source symbolic link in the direction defined by the specified comparison sides.org.eclipse.emf.ecore.EClassgetEClassById(int id) GetsEClassby its identifier returned byIComparisonSession.getEClassId(org.eclipse.emf.ecore.EClass)method.intgetEClassId(org.eclipse.emf.ecore.EClass eClass) Gets identifier assigned to the specifiedEClass.Returns the handle of the comparison process this session is associated with.intgetId()Gets the id of this comparison session.Gets the integration settings context being associated with the comparison sessionorg.eclipse.emf.ecore.EClassgetMatchedObjectsEClass(long nodeId) ReturnsEClassof model objects the node relates to.org.eclipse.emf.ecore.EClassReturnsEClassof model objects the node relates to.getMatchingStrategy(ComparisonSide firstSide, ComparisonSide secondSide) Returns the matching strategy used between the specified sides.Returns a list of all found merge problems for this comparison session.getNode(long nodeId) Returns a result node by the specified id.getNode(ComparisonContext comparisonContext, long nodeId) Returns a result node by the specified id.Returns a comparison tree node with serializable merge settings.org.eclipse.emf.ecore.EStructuralFeatureReturnsEStructuralFeatureof the collection containing the object related to the given comparison node.getPotentialMergeProblemsDescriptions(long nodeId, ComparisonContext comparisonContext) Returns human-readable descriptions of merge problems of the specified node.Returns collection of nodes that cause potential merge problems.getProjectName(ComparisonSide side) Returns the given side project name.getQueue()Returns the comparison queue.org.eclipse.emf.ecore.EStructuralFeaturegetRelatedFeature(long nodeId) ReturnsEStructuralFeaturethe node relates to.org.eclipse.emf.ecore.EStructuralFeatureReturnsEStructuralFeaturethe node relates to.Returns the resource store accessible within the session.Returns the root of the comparison result tree.Returns container of serializable merge settings of the given node.org.eclipse.core.runtime.IProgressMonitorReturns the progress monitor of this session.Returns the settings that were specified when the session was started.Returns the status of the comparison process.Returns the symbolic link translator serving this session.getTopNode(String symlink, ComparisonSide side) Returns a top node by the specified symbolic link.getTopNodeOf(long nodeId) Returns a top-level parent node of the node with the specified id.getTopNodeOf(ComparisonNode node) Returns a top-level parent node of the given node.getTopNodeStatus(long nodeId) Returns the comparison status of the specified top-level node.Gets the tracer if enabledbooleanhasExtendedComparisonSettings(String symlink) Checks if the provided symlink has an extended comparison settings associated with it.booleanhasPotentialMergeProblems(long nodeId) Tells whether the node may break the configuration if it is merged.booleanisExcluded(String source, ComparisonSide sourceSide, ComparisonSide targetSide) Checks if the specified symbolic link is explicitly excluded from matching in the specified direction.booleanisFailedOnMergeUsingExternalTool(long nodeId) Tells whether the merge using external tool failed for the specified node.booleanisFeatureExcludedFromComparison(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects) Tells whether the feature is excluded from the comparison process.booleanChecks whether the scope of comparison of the session is global, that is, its settings do not specify any scope object on any side.booleanisInInputScope(ComparisonNode node) Checks whether the specified node lies within the input comparison scope (before the scope was extended) of this session.booleanisInInputScope(String symlink, ComparisonSide side) Checks whether the specified symbolic link satisfies the input comparison scope (before the scope was extended) on the specified side.booleanisInScope(ComparisonNode node) Checks whether the specified node lies within the scope of comparison of this session.booleanisInScope(String symlink, ComparisonSide side) Checks whether the specified symbolic link satisfies the scope of comparison on the specified side, that is, is leading to, included into, or coming from the scope of comparison.booleanChecks whether the comparison session is three-way.voidmainTopObjectRemoved(String mainSymlink) Processes removing the a top object from the MAIN side.voidmainTopObjectRenamed(String oldMainSymlink, String newMainSymlink) Processes renaming of a top object from the MAIN side.voidmainTopObjectUpdated(String mainSymlink, org.eclipse.emf.ecore.EClass eClass) Processes updating of a current top object or constructing of a new top object from the MAIN side.voidnotifyNodeCompared(long id) Notifies external listeners that the specified node has been compared.voidnotifyNodesUpdated(List<Long> nodeIds) Notifies external listeners that the specified nodes have been updated.voidprioritize(List<Long> nodeIds) Asks the session to prioritize the comparison of the specified list of nodes.voidremoveChild(ComparisonNode parentNode, ComparisonNode childNode) Removes the specified child from the specified parent node.voidremoveChildren(ComparisonNode node) Recursively removes all children of the specified node.voidRemoves a comparison result listener.voidremoveProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Removes the specified progress monitor from the container.<T> TrunComparisonTreeReadonlyTask(IBmTask<T> task) Executes the given read-only BM task for a comparison tree of the specified session.voidscheduleComparing(TopComparisonNode node, boolean prioritize) Schedules top node comparing.booleansetCorrespondence(String mainSymlink, String otherSymlink, String ancestorSymlink) Sets correspondence between two symbolic links and common ancestor (optional).voidsetCustomMergeSettings(long nodeId, CustomMergeSettings settings, ComparisonContext comparisonContext) Sets node's custom merge settings.voidsetIntegrationContext(IntegrationContext integrationContext) Sets the integration settings context for the comparison sessionbooleansetMergeRule(long nodeId, MergeRule rule, ComparisonContext comparisonContext) Sets the given merge rule to the specified node.booleansetMustBeMerged(long nodeId, boolean mustBeMerged, boolean force) Sets the "Merge" flag value to the specified node and to all its children.booleansetOrderSide(long nodeId, ComparisonSide orderSide, ComparisonContext comparisonContext) Sets the order side to be used for children ordering for the specified node.voidsetRootNode(RootComparisonNode rootNode) Sets the root node of the comparison tree related to this session.voidsetStatus(ComparisonProcessStatus status) voidsetStrictOverloadCheckMode(boolean strict) Sets/resets the strict mode for the memory overload checksvoidSets the internal debug tracervoidTells that building of final merge settings will be skipped.
-
Constructor Details
-
ComparisonSession
public ComparisonSession(ComparisonProcessHandle handle, IComparisonProcessStore comparisonProcessStore, ComparisonManager comparisonManager, IResourceStore resourceStore, IComparisonProcessSettings settings, ISupplySettingsManager supplySettingsManager, ComparisonDataSourceFactory comparisonDataSourceFactory) Constructs a new session.- Parameters:
handle- the process handlecomparisonProcessStore- the comparison process store, can't benullcomparisonManager- the comparison managerresourceStore- the resource storesettings- the settings of the comparison processsupplySettingsManager- the supply settings manager reference, can't benullcomparisonDataSourceFactory- the comparison data source factory, can't benull
-
-
Method Details
-
setRootNode
Sets the root node of the comparison tree related to this session. Should be run at the very beginning of a comparison process.- Parameters:
rootNode- the root comparison node with non-empty FQN attached to BM ornull
-
getHandle
Description copied from interface:IComparisonSessionReturns the handle of the comparison process this session is associated with.- Specified by:
getHandlein interfaceIComparisonSession- Returns:
- the handle, never
null
-
getStatus
Description copied from interface:IComparisonSessionReturns the status of the comparison process.- Specified by:
getStatusin interfaceIComparisonSession- Returns:
- the status, never
null
-
setStatus
- Parameters:
status- the status to set
-
getQueue
Returns the comparison queue.- Returns:
- the comparison queue, never
null
-
prioritize
Description copied from interface:IComparisonSessionAsks the session to prioritize the comparison of the specified list of nodes.- Specified by:
prioritizein interfaceIComparisonSession- Parameters:
nodeIds- the ids of the nodes to prioritize their comparison, notnull
-
getDataSource
Description copied from interface:IComparisonSessionReturns the comparison data source by its side.- Specified by:
getDataSourcein interfaceIComparisonSession- Parameters:
side- the side of the data source, notnull- Returns:
- the data source, may be
nullwhen trying to get the common ancestor of a two-way comparison
-
getTopNodeOf
Description copied from interface:IComparisonSessionReturns a top-level parent node of the node with the specified id.- Specified by:
getTopNodeOfin interfaceIComparisonSession- Parameters:
nodeId- the node id to find top parent for- Returns:
- the top node or
nullif no such node found
-
getTopNodeOf
Description copied from interface:IComparisonSessionReturns a top-level parent node of the given node.- Specified by:
getTopNodeOfin interfaceIComparisonSession- Parameters:
node- the node to find top parent for- Returns:
- the top node or
nullif no such node found
-
getNode
Description copied from interface:IComparisonSessionReturns a result node by the specified id.- Specified by:
getNodein interfaceIComparisonSession- Parameters:
nodeId- the node id- Returns:
- the node or
nullif no node exists with such id in the model
-
getNode
Description copied from interface:IComparisonSessionReturns a result node by the specified id.- Specified by:
getNodein interfaceIComparisonSession- Parameters:
comparisonContext- the comparison context, notnullnodeId- the node id- Returns:
- the node or
nullif no node exists with such id in the model
-
getTopNode
Description copied from interface:IComparisonSessionReturns a top node by the specified symbolic link.- Specified by:
getTopNodein interfaceIComparisonSession- Parameters:
symlink- the symbolic link, notnullside- the side to search at, can not benull- Returns:
- the top node or
nullif didn't find it
-
getRootNode
Description copied from interface:IComparisonSessionReturns the root of the comparison result tree.- Specified by:
getRootNodein interfaceIComparisonSession- Returns:
- the root of the comparison result tree.
-
getMatchingStrategy
Description copied from interface:IComparisonSessionReturns the matching strategy used between the specified sides.The method is symmetrical, i. e.
getMatchingStrategy(a, b) == getMatchingStrategy(b, a).- Specified by:
getMatchingStrategyin interfaceIComparisonSession- Parameters:
firstSide- the first side of the comparison, notnullsecondSide- the second side of the comparison, notnull- Returns:
- the matching strategy, never
null
-
getDirectCorrespondence
public String getDirectCorrespondence(String source, ComparisonSide sourceSide, ComparisonSide targetSide) Description copied from interface:IComparisonSessionReturns the symbolic link corresponding to the given source symbolic link in the direction defined by the specified comparison sides.The method will always return
nullif the source is excluded from the comparison in the specified direction.The method is symmetric in the sense that if
A2 == getDirectCorrespondence(A1, side1, side2), thenA1 == getDirectCorrespondence(A2, side2, side1).- Specified by:
getDirectCorrespondencein interfaceIComparisonSession- Parameters:
source- the string with the source symbolic link, notnullsourceSide- the source side, notnulltargetSide- the target side, notnull- Returns:
- the string with the target symbolic link or
nullif no direct correspondence is set
-
isExcluded
Description copied from interface:IComparisonSessionChecks if the specified symbolic link is explicitly excluded from matching in the specified direction.- Specified by:
isExcludedin interfaceIComparisonSession- Parameters:
source- the source symbolic link, notnullsourceSide- the source side, notnulltargetSide- the target side, notnull- Returns:
trueif the link is excluded from matching, andfalseotherwise
-
isThreeWay
public boolean isThreeWay()Description copied from interface:IComparisonSessionChecks whether the comparison session is three-way.- Specified by:
isThreeWayin interfaceIComparisonSession- Returns:
trueif the comparison session is three-way, andfalseif it is two-way
-
areExplicitCorrespondencesSet
Description copied from interface:IComparisonSessionAn optimization flag indicating whether explicit correspondence settings are set for the specified direction.- Specified by:
areExplicitCorrespondencesSetin interfaceIComparisonSession- Parameters:
sourceSide- the source side of the directiontargetSide- the target side of the direction- Returns:
trueif explicit correspondence are set, andfalseotherwise
-
addChild
public void addChild(ComparisonNode parentNode, ComparisonNode childNode, IComparedObjects<?> comparedObjects) Description copied from interface:IComparisonSessionAdds the specified child node to the specified parent node. If a triple of compared objects is given, it is stored in cache for future fast access byIComparisonSession.getComparedObjects(ComparisonNode, ComparisonContext)method.- Specified by:
addChildin interfaceIComparisonSession- Parameters:
parentNode- the parent node, cannot benullchildNode- the child node to be added, cannot benullcomparedObjects- the objects being compared by the child node to put in cache, can benull
-
setMustBeMerged
public boolean setMustBeMerged(long nodeId, boolean mustBeMerged, boolean force) Description copied from interface:IComparisonSessionSets the "Merge" flag value to the specified node and to all its children. The flag can be set only when comparison process has been finished.- Specified by:
setMustBeMergedin interfaceIComparisonSession- Parameters:
nodeId- the node idmustBeMerged- the value to setforce-trueif we want to force change even if merge rule forbids this- Returns:
trueif the flag set successfully,falseotherwise
-
setMergeRule
Description copied from interface:IComparisonSessionSets the given merge rule to the specified node. The rule can be set only when comparison process has been finished.- Specified by:
setMergeRulein interfaceIComparisonSession- Parameters:
nodeId- the node idrule- the merge rule to set, cannot benullcomparisonContext- current comparison operation context, cannot benull- Returns:
trueif the rule set successfully,falseotherwise
-
setOrderSide
public boolean setOrderSide(long nodeId, ComparisonSide orderSide, ComparisonContext comparisonContext) Description copied from interface:IComparisonSessionSets the order side to be used for children ordering for the specified node. The node must support ordering of its children. The method should be called only when comparison process has been finished.- Specified by:
setOrderSidein interfaceIComparisonSession- Parameters:
nodeId- the node idorderSide- the order side to set, can be either MAIN or OTHER, cannot benullcomparisonContext- current comparison operation context, cannot benull- Returns:
trueif the side set successfully,falseotherwise
-
setCustomMergeSettings
public void setCustomMergeSettings(long nodeId, CustomMergeSettings settings, ComparisonContext comparisonContext) Description copied from interface:IComparisonSessionSets node's custom merge settings.- Specified by:
setCustomMergeSettingsin interfaceIComparisonSession- Parameters:
nodeId- the node idsettings- the custom merge settings to set, cannot benullcomparisonContext- current comparison operation context, cannot benull
-
scheduleComparing
Schedules top node comparing.- Parameters:
node- the node to compareprioritize-trueif need to prioritize the node's comparison
-
addComparisonTreeListener
Description copied from interface:IComparisonSessionAdds a comparison result listener.- Specified by:
addComparisonTreeListenerin interfaceIComparisonSession- Parameters:
listener- the result listener, notnull
-
removeComparisonTreeListener
Description copied from interface:IComparisonSessionRemoves a comparison result listener.- Specified by:
removeComparisonTreeListenerin interfaceIComparisonSession- Parameters:
listener- the result listener, notnull
-
notifyNodeCompared
public void notifyNodeCompared(long id) Notifies external listeners that the specified node has been compared.- Parameters:
id- id of the node that has been compared
-
getTopNodeStatus
Description copied from interface:IComparisonSessionReturns the comparison status of the specified top-level node.- Specified by:
getTopNodeStatusin interfaceIComparisonSession- Parameters:
nodeId- the node identifier to get status for, must specify the top-level node- Returns:
- the node comparison status, never
null
-
removeChild
Description copied from interface:IComparisonSessionRemoves the specified child from the specified parent node.- Specified by:
removeChildin interfaceIComparisonSession- Parameters:
parentNode- the parent node from which to remove the child, notnullchildNode- the child node to remove from the parent node, notnull
-
removeChildren
Description copied from interface:IComparisonSessionRecursively removes all children of the specified node.- Specified by:
removeChildrenin interfaceIComparisonSession- Parameters:
node- the node for which to remove all its children, notnull
-
adoptExternalProperty
Description copied from interface:IComparisonSessionAdopts the given external property if possible. If adopting is possible, the method fills the provided comparison data container by data to be used for adoption.- Specified by:
adoptExternalPropertyin interfaceIComparisonSession- Parameters:
extPropData- the data of the external property to be adopted, cannot benull- Returns:
trueif adopting is possible,falseotherwise
-
mainTopObjectUpdated
Processes updating of a current top object or constructing of a new top object from the MAIN side.- Parameters:
mainSymlink- the symbolic link of the top object from the MAIN side, cannot benullor emptyeClass- EClass type of the target object, used to schedule updates for new top objects
-
mainTopObjectRenamed
Processes renaming of a top object from the MAIN side.- Parameters:
oldMainSymlink- the previous symbolic link of the top object from the MAIN side, cannot benullor emptynewMainSymlink- the new symbolic link of the top object from the MAIN side, cannot benullor emptyeClass- EClass type of the target object, used to schedule updates for new top objects
-
mainTopObjectRemoved
Processes removing the a top object from the MAIN side.- Parameters:
mainSymlink- the symbolic link of removed top object from the MAIN side, cannot benullor empty
-
setCorrespondence
Description copied from interface:IComparisonSessionSets correspondence between two symbolic links and common ancestor (optional). The correspondence can be set only when there is no active comparison process. The call of this method causes an automatic start of a new comparison process.- Specified by:
setCorrespondencein interfaceIComparisonSession- Parameters:
mainSymlink- the main symbolic link, may benullotherSymlink- the other symbolic link, may benullancestorSymlink- the ancestor symbolic link (optional), may benull- Returns:
trueif the correspondence set successfully,falseotherwise
-
addProgressMonitor
public void addProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor, org.eclipse.swt.widgets.Display display) Description copied from interface:IProgressMonitorContainerAdds the specified progress monitor and display that should be used for asynchronous communication with that monitor to this container.- Specified by:
addProgressMonitorin interfaceIProgressMonitorContainer- Parameters:
progressMonitor- the progress monitor to be set as contained in this containerdisplay- the display for asynchronous communication with the added progress monitor
-
addProgressMonitor
public void addProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:IProgressMonitorContainerAdds the specified progress monitor working in the UI-less thread.- Specified by:
addProgressMonitorin interfaceIProgressMonitorContainer- Parameters:
progressMonitor- the progress monitor to be set as contained in this container
-
removeProgressMonitor
public void removeProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:IProgressMonitorContainerRemoves the specified progress monitor from the container.- Specified by:
removeProgressMonitorin interfaceIProgressMonitorContainer- Parameters:
progressMonitor- the progress monitor to remove
-
getSessionProgressMonitor
public org.eclipse.core.runtime.IProgressMonitor getSessionProgressMonitor()Returns the progress monitor of this session.- Returns:
- the progress monitor of this session
-
clearCaches
Description copied from interface:IComparisonSessionClears compared object cache for the specified node.- Specified by:
clearCachesin interfaceIComparisonSession- Parameters:
node- the node to clear the compared object cache for
-
runComparisonTreeReadonlyTask
Description copied from interface:IComparisonSessionExecutes the given read-only BM task for a comparison tree of the specified session.- Specified by:
runComparisonTreeReadonlyTaskin interfaceIComparisonSession- Parameters:
task- the task to execute, cannot benull- Returns:
- the result returned by
IBmTask.execute(IBmTransaction, IProgressMonitor)method
-
getComparedObjects
public IComparedObjects<?> getComparedObjects(ComparisonNode node, ComparisonContext comparisonContext) Description copied from interface:IComparisonSessionReturns a triple of compared objects for the specified node. Note: it may work slower than#getComparedObjects(ComparisonNode, ComparedEmfObjects)because it has to obtain the top parents triple first. Use that method if the top parents triple is already known.- Specified by:
getComparedObjectsin interfaceIComparisonSession- Parameters:
node- the node to get the triple of compared objects for, cannot benullcomparisonContext- the comparison context, notnull- Returns:
- the compared objects triple, never
null
-
getComparedObjects
public IComparedObjects<?> getComparedObjects(ComparisonNode node, AbstractComparedEmfObjects<?> topParents, ComparisonContext comparisonContext) Description copied from interface:IComparisonSessionReturns a triple of compared objects for the specified node. Uses triple of top parents if they are given to speed up objects obtaining.- Specified by:
getComparedObjectsin interfaceIComparisonSession- Parameters:
node- the node to get the triple of compared objects for, cannot benullcomparisonContext- the comparison context, notnull- Returns:
- the compared objects triple, never
null
-
getResourceStore
Description copied from interface:IComparisonSessionReturns the resource store accessible within the session.- Specified by:
getResourceStorein interfaceIComparisonSession- Returns:
- the resource store
-
getSymlinkTranslator
Description copied from interface:IComparisonSessionReturns the symbolic link translator serving this session.- Specified by:
getSymlinkTranslatorin interfaceIComparisonSession- Returns:
- the symbolic link translator
-
getSettings
Description copied from interface:IComparisonSessionReturns the settings that were specified when the session was started.- Specified by:
getSettingsin interfaceIComparisonSession- Returns:
- the session settings
-
isGlobalScope
public boolean isGlobalScope()Description copied from interface:IComparisonSessionChecks whether the scope of comparison of the session is global, that is, its settings do not specify any scope object on any side.- Specified by:
isGlobalScopein interfaceIComparisonSession- Returns:
trueif the session comparison scope is global, andfalseotherwise
-
isInScope
Description copied from interface:IComparisonSessionChecks whether the specified node lies within the scope of comparison of this session.- Specified by:
isInScopein interfaceIComparisonSession- Parameters:
node- the node to check, cannot benull- Returns:
trueif the node is within scope, andfalseotherwise
-
isInScope
Description copied from interface:IComparisonSessionChecks whether the specified symbolic link satisfies the scope of comparison on the specified side, that is, is leading to, included into, or coming from the scope of comparison.- Specified by:
isInScopein interfaceIComparisonSession- Parameters:
symlink- the symbolic link to checkside- the side to which symbolic link relates to, notnull- Returns:
trueif the symbolic link is within scope,falseotherwise
-
isInInputScope
Description copied from interface:IComparisonSessionChecks whether the specified node lies within the input comparison scope (before the scope was extended) of this session.- Specified by:
isInInputScopein interfaceIComparisonSession- Parameters:
node- the node to check, cannot benull- Returns:
trueif the node is within the input scope, andfalseotherwise
-
isInInputScope
Description copied from interface:IComparisonSessionChecks whether the specified symbolic link satisfies the input comparison scope (before the scope was extended) on the specified side.- Specified by:
isInInputScopein interfaceIComparisonSession- Parameters:
symlink- the symbolic link to check, cannot benullside- the side to which symbolic link relates to, cannotnull- Returns:
trueif the symbolic link is within the input scope,falseotherwise
-
getEClassById
public org.eclipse.emf.ecore.EClass getEClassById(int id) Description copied from interface:IComparisonSessionGetsEClassby its identifier returned byIComparisonSession.getEClassId(org.eclipse.emf.ecore.EClass)method.- Specified by:
getEClassByIdin interfaceIComparisonSession- Parameters:
id- the identifier to getEClassby.- Returns:
- the
EClassidentified by the specified id ornullif doesn't exist
-
getEClassId
public int getEClassId(org.eclipse.emf.ecore.EClass eClass) Description copied from interface:IComparisonSessionGets identifier assigned to the specifiedEClass.- Specified by:
getEClassIdin interfaceIComparisonSession- Parameters:
eClass- theEClassto get identifier for, cannot benull- Returns:
- the identifier assigned to the
EClass
-
getMatchedObjectsEClass
public org.eclipse.emf.ecore.EClass getMatchedObjectsEClass(long nodeId) Description copied from interface:IComparisonSessionReturnsEClassof model objects the node relates to.- Specified by:
getMatchedObjectsEClassin interfaceIComparisonSession- Parameters:
nodeId- the nodeId to returnEClassfor- Returns:
- the
EClassornullif the node doesn't relate to any model object
-
getMatchedObjectsEClass
Description copied from interface:IComparisonSessionReturnsEClassof model objects the node relates to.- Specified by:
getMatchedObjectsEClassin interfaceIComparisonSession- Parameters:
node- the node to return feature for, may benull- Returns:
- the
EClassornullif the node is null or doesn't relate to any model object
-
getRelatedFeature
public org.eclipse.emf.ecore.EStructuralFeature getRelatedFeature(long nodeId) Description copied from interface:IComparisonSessionReturnsEStructuralFeaturethe node relates to.- Specified by:
getRelatedFeaturein interfaceIComparisonSession- Parameters:
nodeId- the nodeId to return feature for- Returns:
- the feature or
nullif the node doesn't relate to any feature
-
getRelatedFeature
Description copied from interface:IComparisonSessionReturnsEStructuralFeaturethe node relates to.- Specified by:
getRelatedFeaturein interfaceIComparisonSession- Parameters:
node- the node to return feature for, may benull- Returns:
- the feature or
nullif the node doesn't relate to any feature
-
getParentCollectionFeature
Description copied from interface:IComparisonSessionReturnsEStructuralFeatureof the collection containing the object related to the given comparison node.- Specified by:
getParentCollectionFeaturein interfaceIComparisonSession- Parameters:
node- the node related to the collection element, may be benull- Returns:
- the parent collection feature or
nullif the node doesn't relate to any collection element
-
isFeatureExcludedFromComparison
public boolean isFeatureExcludedFromComparison(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects) Description copied from interface:IComparisonSessionTells whether the feature is excluded from the comparison process.- Specified by:
isFeatureExcludedFromComparisonin interfaceIComparisonSession- Parameters:
feature- the feature to check, cannot benullcomparedContextObjects- the triple of compared objects, cannot benull- Returns:
trueif the feature is excluded,falseotherwise
-
buildFinalMergeSettings
public void buildFinalMergeSettings(ComparisonSession session, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Calculates and sets final comparison flags and merge settings to all tree nodes. Must be run after building the comparison tree as a final stage of the comparison process.- Parameters:
session-progressMonitor- the monitor of the progress. May not benull
-
skipBuildFinalMergeSettings
public void skipBuildFinalMergeSettings()Tells that building of final merge settings will be skipped. This clears cached map of top nodes to build merge settings for. -
buildNodeMergeSettings
public void buildNodeMergeSettings(TopComparisonNode node, List<Long> childrenToCompareLater, ComparisonContext comparisonContext) Calculates and sets comparison flags and merge settings to the specified top node and all its children. Must be run under active transaction.- Parameters:
node- the top node which settings to modify, cannot benullchildrenToCompareLater- the list of node's children to be compared later, cannot benullcomparisonContex- context of the current object comparison, cannot benull
-
getId
public int getId()Description copied from interface:IComparisonSessionGets the id of this comparison session.- Specified by:
getIdin interfaceIComparisonSession- Returns:
- the comparison session id
-
getProjectName
Description copied from interface:IComparisonSessionReturns the given side project name.- Specified by:
getProjectNamein interfaceIComparisonSession- Parameters:
side- the comparison side, can not benull- Returns:
- the given side project name, may be
null
-
setIntegrationContext
Description copied from interface:IComparisonSessionSets the integration settings context for the comparison session- Specified by:
setIntegrationContextin interfaceIComparisonSession- Parameters:
integrationContext- The integration settings context. Could benull
-
getIntegrationContext
Description copied from interface:IComparisonSessionGets the integration settings context being associated with the comparison session- Specified by:
getIntegrationContextin interfaceIComparisonSession- Returns:
- The associated integration settings context, if any.
nullotherwise
-
hasExtendedComparisonSettings
Description copied from interface:IComparisonSessionChecks if the provided symlink has an extended comparison settings associated with it. Extended settings are being supplied with external comparison configuration.- Specified by:
hasExtendedComparisonSettingsin interfaceIComparisonSession- Parameters:
symlink- The target symlink, can benull- Returns:
- True if the object pointed with the symlink has an extended comparison settings
-
adoptMainSideFeature
public org.eclipse.emf.ecore.EStructuralFeature adoptMainSideFeature(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature) Description copied from interface:IComparisonSessionConverts, if possible, the main side feature into a other supported by the other side object. Returns the given main side feature if no convert was found.- Specified by:
adoptMainSideFeaturein interfaceIComparisonSession- Parameters:
mainSideFeature- the main side feature to convert, cannot benull- Returns:
- the converted feature applicable for other side object or given main side feature
if no convert was found, never
null
-
hasPotentialMergeProblems
public boolean hasPotentialMergeProblems(long nodeId) Description copied from interface:IComparisonSessionTells whether the node may break the configuration if it is merged.- Specified by:
hasPotentialMergeProblemsin interfaceIComparisonSession- Parameters:
nodeId- the node Id to check- Returns:
trueif the node may break the configuration,falseotherwise
-
getPotentialMergeProblemsDescriptions
public List<PotentialMergeProblemDescription> getPotentialMergeProblemsDescriptions(long nodeId, ComparisonContext comparisonContext) Description copied from interface:IComparisonSessionReturns human-readable descriptions of merge problems of the specified node.- Specified by:
getPotentialMergeProblemsDescriptionsin interfaceIComparisonSessioncomparisonContext- the comparison context, cannot benull- Returns:
- the list of descriptions, never
null, can be empty if the node doesn't bring any merge problems
-
getPotentialMergeProblemsSourceNodes
Description copied from interface:IComparisonSessionReturns collection of nodes that cause potential merge problems.- Specified by:
getPotentialMergeProblemsSourceNodesin interfaceIComparisonSession- Returns:
- the collection of such nodes, can be empty, never
null
-
checkForOverload
public void checkForOverload()Checks the comparison for the memory overload. Throws aComparisonMemoryOverloadExceptionin case of check failure and the strict mode is being enabled. -
setStrictOverloadCheckMode
public void setStrictOverloadCheckMode(boolean strict) Sets/resets the strict mode for the memory overload checks- Parameters:
strict- The strict mode
-
getTracer
Gets the tracer if enabled- Returns:
- The tracer instance if applicable;
nullotherwise
-
setTracer
Sets the internal debug tracer- Parameters:
tracer- The tracer to set. Cannot benull
-
getComparedObjectsCorrespondences
Description copied from interface:IComparisonSessionReturns a collection of correspondences between compared objects.- Specified by:
getComparedObjectsCorrespondencesin interfaceIComparisonSession- Returns:
- general list of correspondences in the form of pairs (main symlink, other symlink), never
null
-
getNodesWithChangedMergeSettings
Description copied from interface:IComparisonSessionReturns a comparison tree node with serializable merge settings.- Specified by:
getNodesWithChangedMergeSettingsin interfaceIComparisonSession- Returns:
- Collection of node BM identifiers, never
null
-
getSerializableNodeMergeSettings
Description copied from interface:IComparisonSessionReturns container of serializable merge settings of the given node.- Specified by:
getSerializableNodeMergeSettingsin interfaceIComparisonSession- Parameters:
node- the node to get container for, cannot benull- Returns:
- the container of serializable merge settings, never
null
-
clearRestoredMergeSettings
public void clearRestoredMergeSettings()Removes the restored merge settings used in the comparison process. It is necessary to call upon completion of the process of clearing to clear the memory. -
notifyNodesUpdated
Notifies external listeners that the specified nodes have been updated.- Parameters:
nodeIds- the identifiers of the nodes that have been updated, cannot benull
-
isFailedOnMergeUsingExternalTool
public boolean isFailedOnMergeUsingExternalTool(long nodeId) Description copied from interface:IComparisonSessionTells whether the merge using external tool failed for the specified node.- Specified by:
isFailedOnMergeUsingExternalToolin interfaceIComparisonSession- Parameters:
nodeId- the node id to check- Returns:
trueif the merge using external tool failed,falseotherwise
-
getMergeProblems
Returns a list of all found merge problems for this comparison session.- Returns:
- the list of all found merge problems for this comparison session, never
null
-
addMergeProblems
Adds a collection of merge problems.- Parameters:
mergeProblems- the collections of merge problems, cannot benull
-
clearMergeProblems
public void clearMergeProblems()Cleares all found merge problems for this comparison session. -
getBmEngine
Gets BM engien.- Returns:
- the bmEngine.
-