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 TypeMethodDescriptionvoid
addChild
(ComparisonNode parentNode, ComparisonNode childNode, IComparedObjects<?> comparedObjects) Adds the specified child node to the specified parent node.void
Adds a comparison result listener.void
addMergeProblems
(Collection<? extends MergeProblem> mergeProblems) Adds a collection of merge problems.void
addProgressMonitor
(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Adds the specified progress monitor working in the UI-less thread.void
addProgressMonitor
(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.boolean
adoptExternalProperty
(ExternalPropertyComparisonData extPropData) Adopts the given external property if possible.org.eclipse.emf.ecore.EStructuralFeature
adoptMainSideFeature
(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature) Converts, if possible, the main side feature into a other supported by the other side object.boolean
areExplicitCorrespondencesSet
(ComparisonSide sourceSide, ComparisonSide targetSide) An optimization flag indicating whether explicit correspondence settings are set for the specified direction.void
buildFinalMergeSettings
(ComparisonSession session, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Calculates and sets final comparison flags and merge settings to all tree nodes.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.void
Checks the comparison for the memory overload.void
clearCaches
(ComparisonNode node) Clears compared object cache for the specified node.void
Cleares all found merge problems for this comparison session.void
Removes 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.EClass
getEClassById
(int id) GetsEClass
by its identifier returned byIComparisonSession.getEClassId(org.eclipse.emf.ecore.EClass)
method.int
getEClassId
(org.eclipse.emf.ecore.EClass eClass) Gets identifier assigned to the specifiedEClass
.Returns the handle of the comparison process this session is associated with.int
getId()
Gets the id of this comparison session.Gets the integration settings context being associated with the comparison sessionorg.eclipse.emf.ecore.EClass
getMatchedObjectsEClass
(long nodeId) ReturnsEClass
of model objects the node relates to.org.eclipse.emf.ecore.EClass
ReturnsEClass
of 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.EStructuralFeature
ReturnsEStructuralFeature
of 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.EStructuralFeature
getRelatedFeature
(long nodeId) ReturnsEStructuralFeature
the node relates to.org.eclipse.emf.ecore.EStructuralFeature
ReturnsEStructuralFeature
the 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.IProgressMonitor
Returns 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 enabledboolean
hasExtendedComparisonSettings
(String symlink) Checks if the provided symlink has an extended comparison settings associated with it.boolean
hasPotentialMergeProblems
(long nodeId) Tells whether the node may break the configuration if it is merged.boolean
isExcluded
(String source, ComparisonSide sourceSide, ComparisonSide targetSide) Checks if the specified symbolic link is explicitly excluded from matching in the specified direction.boolean
isFailedOnMergeUsingExternalTool
(long nodeId) Tells whether the merge using external tool failed for the specified node.boolean
isFeatureExcludedFromComparison
(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects) Tells whether the feature is excluded from the comparison process.boolean
Checks whether the scope of comparison of the session is global, that is, its settings do not specify any scope object on any side.boolean
isInInputScope
(ComparisonNode node) Checks whether the specified node lies within the input comparison scope (before the scope was extended) of this session.boolean
isInInputScope
(String symlink, ComparisonSide side) Checks whether the specified symbolic link satisfies the input comparison scope (before the scope was extended) on the specified side.boolean
isInScope
(ComparisonNode node) Checks whether the specified node lies within the scope of comparison of this session.boolean
isInScope
(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.boolean
Checks whether the comparison session is three-way.void
mainTopObjectRemoved
(String mainSymlink) Processes removing the a top object from the MAIN side.void
mainTopObjectRenamed
(String oldMainSymlink, String newMainSymlink) Processes renaming of a top object from the MAIN side.void
mainTopObjectUpdated
(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.void
notifyNodeCompared
(long id) Notifies external listeners that the specified node has been compared.void
notifyNodesUpdated
(List<Long> nodeIds) Notifies external listeners that the specified nodes have been updated.void
prioritize
(List<Long> nodeIds) Asks the session to prioritize the comparison of the specified list of nodes.void
removeChild
(ComparisonNode parentNode, ComparisonNode childNode) Removes the specified child from the specified parent node.void
removeChildren
(ComparisonNode node) Recursively removes all children of the specified node.void
Removes a comparison result listener.void
removeProgressMonitor
(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Removes the specified progress monitor from the container.<T> T
runComparisonTreeReadonlyTask
(IBmTask<T> task) Executes the given read-only BM task for a comparison tree of the specified session.void
scheduleComparing
(TopComparisonNode node, boolean prioritize) Schedules top node comparing.boolean
setCorrespondence
(String mainSymlink, String otherSymlink, String ancestorSymlink) Sets correspondence between two symbolic links and common ancestor (optional).void
setCustomMergeSettings
(long nodeId, CustomMergeSettings settings, ComparisonContext comparisonContext) Sets node's custom merge settings.void
setIntegrationContext
(IntegrationContext integrationContext) Sets the integration settings context for the comparison sessionboolean
setMergeRule
(long nodeId, MergeRule rule, ComparisonContext comparisonContext) Sets the given merge rule to the specified node.boolean
setMustBeMerged
(long nodeId, boolean mustBeMerged, boolean force) Sets the "Merge" flag value to the specified node and to all its children.boolean
setOrderSide
(long nodeId, ComparisonSide orderSide, ComparisonContext comparisonContext) Sets the order side to be used for children ordering for the specified node.void
setRootNode
(RootComparisonNode rootNode) Sets the root node of the comparison tree related to this session.void
setStatus
(ComparisonProcessStatus status) void
setStrictOverloadCheckMode
(boolean strict) Sets/resets the strict mode for the memory overload checksvoid
Sets the internal debug tracervoid
Tells 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 benull
comparisonManager
- the comparison managerresourceStore
- the resource storesettings
- the settings of the comparison processsupplySettingsManager
- the supply settings manager reference, can't benull
comparisonDataSourceFactory
- 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:IComparisonSession
Returns the handle of the comparison process this session is associated with.- Specified by:
getHandle
in interfaceIComparisonSession
- Returns:
- the handle, never
null
-
getStatus
Description copied from interface:IComparisonSession
Returns the status of the comparison process.- Specified by:
getStatus
in 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:IComparisonSession
Asks the session to prioritize the comparison of the specified list of nodes.- Specified by:
prioritize
in interfaceIComparisonSession
- Parameters:
nodeIds
- the ids of the nodes to prioritize their comparison, notnull
-
getDataSource
Description copied from interface:IComparisonSession
Returns the comparison data source by its side.- Specified by:
getDataSource
in interfaceIComparisonSession
- Parameters:
side
- the side of the data source, notnull
- Returns:
- the data source, may be
null
when trying to get the common ancestor of a two-way comparison
-
getTopNodeOf
Description copied from interface:IComparisonSession
Returns a top-level parent node of the node with the specified id.- Specified by:
getTopNodeOf
in interfaceIComparisonSession
- Parameters:
nodeId
- the node id to find top parent for- Returns:
- the top node or
null
if no such node found
-
getTopNodeOf
Description copied from interface:IComparisonSession
Returns a top-level parent node of the given node.- Specified by:
getTopNodeOf
in interfaceIComparisonSession
- Parameters:
node
- the node to find top parent for- Returns:
- the top node or
null
if no such node found
-
getNode
Description copied from interface:IComparisonSession
Returns a result node by the specified id.- Specified by:
getNode
in interfaceIComparisonSession
- Parameters:
nodeId
- the node id- Returns:
- the node or
null
if no node exists with such id in the model
-
getNode
Description copied from interface:IComparisonSession
Returns a result node by the specified id.- Specified by:
getNode
in interfaceIComparisonSession
- Parameters:
comparisonContext
- the comparison context, notnull
nodeId
- the node id- Returns:
- the node or
null
if no node exists with such id in the model
-
getTopNode
Description copied from interface:IComparisonSession
Returns a top node by the specified symbolic link.- Specified by:
getTopNode
in interfaceIComparisonSession
- Parameters:
symlink
- the symbolic link, notnull
side
- the side to search at, can not benull
- Returns:
- the top node or
null
if didn't find it
-
getRootNode
Description copied from interface:IComparisonSession
Returns the root of the comparison result tree.- Specified by:
getRootNode
in interfaceIComparisonSession
- Returns:
- the root of the comparison result tree.
-
getMatchingStrategy
Description copied from interface:IComparisonSession
Returns the matching strategy used between the specified sides.The method is symmetrical, i. e.
getMatchingStrategy(a, b) == getMatchingStrategy(b, a)
.- Specified by:
getMatchingStrategy
in interfaceIComparisonSession
- Parameters:
firstSide
- the first side of the comparison, notnull
secondSide
- 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:IComparisonSession
Returns the symbolic link corresponding to the given source symbolic link in the direction defined by the specified comparison sides.The method will always return
null
if 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:
getDirectCorrespondence
in interfaceIComparisonSession
- Parameters:
source
- the string with the source symbolic link, notnull
sourceSide
- the source side, notnull
targetSide
- the target side, notnull
- Returns:
- the string with the target symbolic link or
null
if no direct correspondence is set
-
isExcluded
Description copied from interface:IComparisonSession
Checks if the specified symbolic link is explicitly excluded from matching in the specified direction.- Specified by:
isExcluded
in interfaceIComparisonSession
- Parameters:
source
- the source symbolic link, notnull
sourceSide
- the source side, notnull
targetSide
- the target side, notnull
- Returns:
true
if the link is excluded from matching, andfalse
otherwise
-
isThreeWay
public boolean isThreeWay()Description copied from interface:IComparisonSession
Checks whether the comparison session is three-way.- Specified by:
isThreeWay
in interfaceIComparisonSession
- Returns:
true
if the comparison session is three-way, andfalse
if it is two-way
-
areExplicitCorrespondencesSet
Description copied from interface:IComparisonSession
An optimization flag indicating whether explicit correspondence settings are set for the specified direction.- Specified by:
areExplicitCorrespondencesSet
in interfaceIComparisonSession
- Parameters:
sourceSide
- the source side of the directiontargetSide
- the target side of the direction- Returns:
true
if explicit correspondence are set, andfalse
otherwise
-
addChild
public void addChild(ComparisonNode parentNode, ComparisonNode childNode, IComparedObjects<?> comparedObjects) Description copied from interface:IComparisonSession
Adds 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:
addChild
in interfaceIComparisonSession
- Parameters:
parentNode
- the parent node, cannot benull
childNode
- the child node to be added, cannot benull
comparedObjects
- 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:IComparisonSession
Sets 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:
setMustBeMerged
in interfaceIComparisonSession
- Parameters:
nodeId
- the node idmustBeMerged
- the value to setforce
-true
if we want to force change even if merge rule forbids this- Returns:
true
if the flag set successfully,false
otherwise
-
setMergeRule
Description copied from interface:IComparisonSession
Sets the given merge rule to the specified node. The rule can be set only when comparison process has been finished.- Specified by:
setMergeRule
in interfaceIComparisonSession
- Parameters:
nodeId
- the node idrule
- the merge rule to set, cannot benull
comparisonContext
- current comparison operation context, cannot benull
- Returns:
true
if the rule set successfully,false
otherwise
-
setOrderSide
public boolean setOrderSide(long nodeId, ComparisonSide orderSide, ComparisonContext comparisonContext) Description copied from interface:IComparisonSession
Sets 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:
setOrderSide
in interfaceIComparisonSession
- Parameters:
nodeId
- the node idorderSide
- the order side to set, can be either MAIN or OTHER, cannot benull
comparisonContext
- current comparison operation context, cannot benull
- Returns:
true
if the side set successfully,false
otherwise
-
setCustomMergeSettings
public void setCustomMergeSettings(long nodeId, CustomMergeSettings settings, ComparisonContext comparisonContext) Description copied from interface:IComparisonSession
Sets node's custom merge settings.- Specified by:
setCustomMergeSettings
in interfaceIComparisonSession
- Parameters:
nodeId
- the node idsettings
- the custom merge settings to set, cannot benull
comparisonContext
- current comparison operation context, cannot benull
-
scheduleComparing
Schedules top node comparing.- Parameters:
node
- the node to compareprioritize
-true
if need to prioritize the node's comparison
-
addComparisonTreeListener
Description copied from interface:IComparisonSession
Adds a comparison result listener.- Specified by:
addComparisonTreeListener
in interfaceIComparisonSession
- Parameters:
listener
- the result listener, notnull
-
removeComparisonTreeListener
Description copied from interface:IComparisonSession
Removes a comparison result listener.- Specified by:
removeComparisonTreeListener
in 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:IComparisonSession
Returns the comparison status of the specified top-level node.- Specified by:
getTopNodeStatus
in 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:IComparisonSession
Removes the specified child from the specified parent node.- Specified by:
removeChild
in interfaceIComparisonSession
- Parameters:
parentNode
- the parent node from which to remove the child, notnull
childNode
- the child node to remove from the parent node, notnull
-
removeChildren
Description copied from interface:IComparisonSession
Recursively removes all children of the specified node.- Specified by:
removeChildren
in interfaceIComparisonSession
- Parameters:
node
- the node for which to remove all its children, notnull
-
adoptExternalProperty
Description copied from interface:IComparisonSession
Adopts 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:
adoptExternalProperty
in interfaceIComparisonSession
- Parameters:
extPropData
- the data of the external property to be adopted, cannot benull
- Returns:
true
if adopting is possible,false
otherwise
-
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 benull
or 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 benull
or emptynewMainSymlink
- the new symbolic link of the top object from the MAIN side, cannot benull
or 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 benull
or empty
-
setCorrespondence
Description copied from interface:IComparisonSession
Sets 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:
setCorrespondence
in interfaceIComparisonSession
- Parameters:
mainSymlink
- the main symbolic link, may benull
otherSymlink
- the other symbolic link, may benull
ancestorSymlink
- the ancestor symbolic link (optional), may benull
- Returns:
true
if the correspondence set successfully,false
otherwise
-
addProgressMonitor
public void addProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor, org.eclipse.swt.widgets.Display display) Description copied from interface:IProgressMonitorContainer
Adds the specified progress monitor and display that should be used for asynchronous communication with that monitor to this container.- Specified by:
addProgressMonitor
in 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:IProgressMonitorContainer
Adds the specified progress monitor working in the UI-less thread.- Specified by:
addProgressMonitor
in 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:IProgressMonitorContainer
Removes the specified progress monitor from the container.- Specified by:
removeProgressMonitor
in 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:IComparisonSession
Clears compared object cache for the specified node.- Specified by:
clearCaches
in interfaceIComparisonSession
- Parameters:
node
- the node to clear the compared object cache for
-
runComparisonTreeReadonlyTask
Description copied from interface:IComparisonSession
Executes the given read-only BM task for a comparison tree of the specified session.- Specified by:
runComparisonTreeReadonlyTask
in 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:IComparisonSession
Returns 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:
getComparedObjects
in interfaceIComparisonSession
- Parameters:
node
- the node to get the triple of compared objects for, cannot benull
comparisonContext
- 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:IComparisonSession
Returns 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:
getComparedObjects
in interfaceIComparisonSession
- Parameters:
node
- the node to get the triple of compared objects for, cannot benull
comparisonContext
- the comparison context, notnull
- Returns:
- the compared objects triple, never
null
-
getResourceStore
Description copied from interface:IComparisonSession
Returns the resource store accessible within the session.- Specified by:
getResourceStore
in interfaceIComparisonSession
- Returns:
- the resource store
-
getSymlinkTranslator
Description copied from interface:IComparisonSession
Returns the symbolic link translator serving this session.- Specified by:
getSymlinkTranslator
in interfaceIComparisonSession
- Returns:
- the symbolic link translator
-
getSettings
Description copied from interface:IComparisonSession
Returns the settings that were specified when the session was started.- Specified by:
getSettings
in interfaceIComparisonSession
- Returns:
- the session settings
-
isGlobalScope
public boolean isGlobalScope()Description copied from interface:IComparisonSession
Checks 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:
isGlobalScope
in interfaceIComparisonSession
- Returns:
true
if the session comparison scope is global, andfalse
otherwise
-
isInScope
Description copied from interface:IComparisonSession
Checks whether the specified node lies within the scope of comparison of this session.- Specified by:
isInScope
in interfaceIComparisonSession
- Parameters:
node
- the node to check, cannot benull
- Returns:
true
if the node is within scope, andfalse
otherwise
-
isInScope
Description copied from interface:IComparisonSession
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.- Specified by:
isInScope
in interfaceIComparisonSession
- Parameters:
symlink
- the symbolic link to checkside
- the side to which symbolic link relates to, notnull
- Returns:
true
if the symbolic link is within scope,false
otherwise
-
isInInputScope
Description copied from interface:IComparisonSession
Checks whether the specified node lies within the input comparison scope (before the scope was extended) of this session.- Specified by:
isInInputScope
in interfaceIComparisonSession
- Parameters:
node
- the node to check, cannot benull
- Returns:
true
if the node is within the input scope, andfalse
otherwise
-
isInInputScope
Description copied from interface:IComparisonSession
Checks whether the specified symbolic link satisfies the input comparison scope (before the scope was extended) on the specified side.- Specified by:
isInInputScope
in interfaceIComparisonSession
- Parameters:
symlink
- the symbolic link to check, cannot benull
side
- the side to which symbolic link relates to, cannotnull
- Returns:
true
if the symbolic link is within the input scope,false
otherwise
-
getEClassById
public org.eclipse.emf.ecore.EClass getEClassById(int id) Description copied from interface:IComparisonSession
GetsEClass
by its identifier returned byIComparisonSession.getEClassId(org.eclipse.emf.ecore.EClass)
method.- Specified by:
getEClassById
in interfaceIComparisonSession
- Parameters:
id
- the identifier to getEClass
by.- Returns:
- the
EClass
identified by the specified id ornull
if doesn't exist
-
getEClassId
public int getEClassId(org.eclipse.emf.ecore.EClass eClass) Description copied from interface:IComparisonSession
Gets identifier assigned to the specifiedEClass
.- Specified by:
getEClassId
in interfaceIComparisonSession
- Parameters:
eClass
- theEClass
to 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:IComparisonSession
ReturnsEClass
of model objects the node relates to.- Specified by:
getMatchedObjectsEClass
in interfaceIComparisonSession
- Parameters:
nodeId
- the nodeId to returnEClass
for- Returns:
- the
EClass
ornull
if the node doesn't relate to any model object
-
getMatchedObjectsEClass
Description copied from interface:IComparisonSession
ReturnsEClass
of model objects the node relates to.- Specified by:
getMatchedObjectsEClass
in interfaceIComparisonSession
- Parameters:
node
- the node to return feature for, may benull
- Returns:
- the
EClass
ornull
if 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:IComparisonSession
ReturnsEStructuralFeature
the node relates to.- Specified by:
getRelatedFeature
in interfaceIComparisonSession
- Parameters:
nodeId
- the nodeId to return feature for- Returns:
- the feature or
null
if the node doesn't relate to any feature
-
getRelatedFeature
Description copied from interface:IComparisonSession
ReturnsEStructuralFeature
the node relates to.- Specified by:
getRelatedFeature
in interfaceIComparisonSession
- Parameters:
node
- the node to return feature for, may benull
- Returns:
- the feature or
null
if the node doesn't relate to any feature
-
getParentCollectionFeature
Description copied from interface:IComparisonSession
ReturnsEStructuralFeature
of the collection containing the object related to the given comparison node.- Specified by:
getParentCollectionFeature
in interfaceIComparisonSession
- Parameters:
node
- the node related to the collection element, may be benull
- Returns:
- the parent collection feature or
null
if 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:IComparisonSession
Tells whether the feature is excluded from the comparison process.- Specified by:
isFeatureExcludedFromComparison
in interfaceIComparisonSession
- Parameters:
feature
- the feature to check, cannot benull
comparedContextObjects
- the triple of compared objects, cannot benull
- Returns:
true
if the feature is excluded,false
otherwise
-
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 benull
childrenToCompareLater
- the list of node's children to be compared later, cannot benull
comparisonContex
- context of the current object comparison, cannot benull
-
getId
public int getId()Description copied from interface:IComparisonSession
Gets the id of this comparison session.- Specified by:
getId
in interfaceIComparisonSession
- Returns:
- the comparison session id
-
getProjectName
Description copied from interface:IComparisonSession
Returns the given side project name.- Specified by:
getProjectName
in interfaceIComparisonSession
- Parameters:
side
- the comparison side, can not benull
- Returns:
- the given side project name, may be
null
-
setIntegrationContext
Description copied from interface:IComparisonSession
Sets the integration settings context for the comparison session- Specified by:
setIntegrationContext
in interfaceIComparisonSession
- Parameters:
integrationContext
- The integration settings context. Could benull
-
getIntegrationContext
Description copied from interface:IComparisonSession
Gets the integration settings context being associated with the comparison session- Specified by:
getIntegrationContext
in interfaceIComparisonSession
- Returns:
- The associated integration settings context, if any.
null
otherwise
-
hasExtendedComparisonSettings
Description copied from interface:IComparisonSession
Checks if the provided symlink has an extended comparison settings associated with it. Extended settings are being supplied with external comparison configuration.- Specified by:
hasExtendedComparisonSettings
in 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:IComparisonSession
Converts, 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:
adoptMainSideFeature
in 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:IComparisonSession
Tells whether the node may break the configuration if it is merged.- Specified by:
hasPotentialMergeProblems
in interfaceIComparisonSession
- Parameters:
nodeId
- the node Id to check- Returns:
true
if the node may break the configuration,false
otherwise
-
getPotentialMergeProblemsDescriptions
public List<PotentialMergeProblemDescription> getPotentialMergeProblemsDescriptions(long nodeId, ComparisonContext comparisonContext) Description copied from interface:IComparisonSession
Returns human-readable descriptions of merge problems of the specified node.- Specified by:
getPotentialMergeProblemsDescriptions
in interfaceIComparisonSession
comparisonContext
- 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:IComparisonSession
Returns collection of nodes that cause potential merge problems.- Specified by:
getPotentialMergeProblemsSourceNodes
in interfaceIComparisonSession
- Returns:
- the collection of such nodes, can be empty, never
null
-
checkForOverload
public void checkForOverload()Checks the comparison for the memory overload. Throws aComparisonMemoryOverloadException
in 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;
null
otherwise
-
setTracer
Sets the internal debug tracer- Parameters:
tracer
- The tracer to set. Cannot benull
-
getComparedObjectsCorrespondences
Description copied from interface:IComparisonSession
Returns a collection of correspondences between compared objects.- Specified by:
getComparedObjectsCorrespondences
in interfaceIComparisonSession
- Returns:
- general list of correspondences in the form of pairs (main symlink, other symlink), never
null
-
getNodesWithChangedMergeSettings
Description copied from interface:IComparisonSession
Returns a comparison tree node with serializable merge settings.- Specified by:
getNodesWithChangedMergeSettings
in interfaceIComparisonSession
- Returns:
- Collection of node BM identifiers, never
null
-
getSerializableNodeMergeSettings
Description copied from interface:IComparisonSession
Returns container of serializable merge settings of the given node.- Specified by:
getSerializableNodeMergeSettings
in 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:IComparisonSession
Tells whether the merge using external tool failed for the specified node.- Specified by:
isFailedOnMergeUsingExternalTool
in interfaceIComparisonSession
- Parameters:
nodeId
- the node id to check- Returns:
true
if the merge using external tool failed,false
otherwise
-
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.
-