Class ManifestComparisonParticipant

    • Constructor Detail

      • ManifestComparisonParticipant

        public ManifestComparisonParticipant()
    • Method Detail

      • supports

        public boolean supports​(ComparisonTreeNode node)
        Description copied from interface: IComparisonParticipant
        Indicates whether the participant supports comparison and merging of the specified node.
        Specified by:
        supports in interface IComparisonParticipant
        Parameters:
        node - the node, not null
        Returns:
        true if the participant supports comparison and merging, false otherwise
      • compare

        public List<Long> compare​(ComparisonTreeNode node,
                                  ComparisonContext comparisonContext,
                                  org.eclipse.core.runtime.IProgressMonitor monitor)
        Description copied from interface: IComparisonParticipant
        Compares objects contained in the specified model node and returns a list of child nodes to be compared.
        Specified by:
        compare in interface IComparisonParticipant
        Parameters:
        node - the node, not null
        comparisonContext - the comparison context, not null
        monitor - the progress monitor, can be null. The clients are not supposed to report work to the monitor, except for the top object matching phase
        Returns:
        a list of model node identifiers, never null
      • merge

        public org.eclipse.core.runtime.IStatus merge​(ComparisonTreeNode node,
                                                      MergeContext context,
                                                      org.eclipse.core.runtime.IProgressMonitor monitor)
        Description copied from interface: IComparisonParticipant
        Merges the differences in the specified node in the specified merge session. This may include deletion of the main object if the other object is absent, or, conversely, import ("copying") of the other object if the main object is absent.
        Specified by:
        merge in interface IComparisonParticipant
        Parameters:
        node - the node, not null
        context - the current merge context, not null
        monitor - the progress monitor, not null
        Returns:
        the result of the merge operation
      • getForcedDDRebuildScope

        public Map<String,​IBmObject> getForcedDDRebuildScope​(BmTopComparisonNode topNode,
                                                                   MergeContext context)
        Description copied from interface: IComparisonParticipant
        In case if the merge process changes the top object it should supply information about affected DDs.
        Specified by:
        getForcedDDRebuildScope in interface IComparisonParticipant
        Parameters:
        topNode - The top node of the comparison model representing the merged object, never null
        context - Current merge operation context, not null
        Returns:
        The map of the affected DD segments and corresponding objects, could be null or empty
      • getPotentialCorrespondingNodes

        public List<ComparisonTreeNode> getPotentialCorrespondingNodes​(ComparisonTreeNode node,
                                                                       ComparisonSide sourceSide)
        Description copied from interface: IComparisonParticipant
        Returns a list of candidate nodes for setting as corresponding to the specified node.
        Specified by:
        getPotentialCorrespondingNodes in interface IComparisonParticipant
        Parameters:
        node - the comparison result node to find potential correspondences for, not null
        sourceSide - the source side of the correspondence, not null
        Returns:
        a list of comparison result nodes or null if this kind of nodes is not supported by this participant
      • breakCorrespondence

        public boolean breakCorrespondence​(ComparisonContext comparisonContext,
                                           ComparisonTreeNode node)
        Description copied from interface: IComparisonParticipant
        Asks the participant to break correspondence represented by the specified model node. The participant may refuse to break correspondence if it does not support this kind of node.
        Specified by:
        breakCorrespondence in interface IComparisonParticipant
        Parameters:
        comparisonContext - the comparison context, not null
        node - the node with the correspondence to break, not null
        Returns:
        true if the participant supported the operation, and false otherwise
      • updateComparison

        public boolean updateComparison​(ComparisonContext comparisonContext,
                                        ComparisonTreeNode node,
                                        List<Long> newNodeIds)
        Description copied from interface: IComparisonParticipant
        Updates comparison for the given result node. Participants could introduce their own specific logic for managing internal states on comparison update.
        Specified by:
        updateComparison in interface IComparisonParticipant
        Parameters:
        comparisonContext - the comparison context, not null
        node - the node to update comparison for, not null
        newNodeIds - the list of created new node Ids to fill, not null
        Returns:
        true if the participant supported the operation, and false otherwise
      • addNewTopObjectToComparison

        public ComparisonTreeNode addNewTopObjectToComparison​(IComparisonSession comparisonSession,
                                                              String mainSymlink,
                                                              org.eclipse.emf.ecore.EClass eClass)
        Description copied from interface: IComparisonParticipant
        Adds a new node to the comparison for the top object. Participants could introduce their own specific logic for managing internal states on comparison update.
        Specified by:
        addNewTopObjectToComparison in interface IComparisonParticipant
        Parameters:
        comparisonSession - the comparison session hosting the model, not null
        mainSymlink - the symlink for the top object to add, not null
        eClass - of the object ot add, not null
        Returns:
        The created result node for the object if supports. null otherwise.
      • combineOneSideNodes

        public boolean combineOneSideNodes​(ComparisonContext comparisonContext,
                                           ComparisonTreeNode mainNode,
                                           ComparisonTreeNode otherNode,
                                           List<Long> newNodeIds)
        Description copied from interface: IComparisonParticipant
        Asks the participant to combine the specified two one-side nodes. The participant may refuse to do it if it does not support this kind of nodes. The participant fills array of new node Ids created while combining the specified nodes. These node Ids must be scheduled for comparison in the external code.
        Specified by:
        combineOneSideNodes in interface IComparisonParticipant
        Parameters:
        comparisonContext - the comparison context, not null
        mainNode - the one-side MAIN node to be combined, not null
        otherNode - the one-side OTHER node to be combined, not null
        newNodeIds - the list of new node Ids to fill, not null
        Returns:
        true if the participant supported the operation, and false otherwise
      • ableToBreakCorrespondence

        public boolean ableToBreakCorrespondence​(ComparisonTreeNode node)
        Description copied from interface: IComparisonParticipant
        Checks if this participant is able to break a correspondence stored in the specified node.
        Specified by:
        ableToBreakCorrespondence in interface IComparisonParticipant
        Parameters:
        node - the node to check if its correspondence can be broken by this participant, not null
        Returns:
        true if this participant is able to break the correspondence, and false otherwise
      • breakMainSideCorrespondence

        public boolean breakMainSideCorrespondence​(IComparisonSession comparisonSession,
                                                   ComparisonTreeNode node)
        Description copied from interface: IComparisonParticipant
        Asks the participant to break main side correspondence represented by the specified model node. The participant may refuse to break main side correspondence if it does not support this kind of node.
        Specified by:
        breakMainSideCorrespondence in interface IComparisonParticipant
        Parameters:
        comparisonSession - the comparison session hosting the model, can not be null
        node - the node with the correspondence to break, can not be null
        Returns:
        true if the participant supported the operation and false otherwise
      • isExcludedFromComparison

        public boolean isExcludedFromComparison​(org.eclipse.emf.ecore.EStructuralFeature feature,
                                                AbstractComparedEmfObjects<?> comparedContextObjects,
                                                IComparisonSession session)
        Description copied from interface: IComparisonParticipant
        Checks whether the feature must be excluded from the comparison.
        Specified by:
        isExcludedFromComparison in interface IComparisonParticipant
        Parameters:
        feature - the feature to check, cannot be null
        comparedContextObjects - the triple of compared objects, cannot be null
        session - the comparison session, cannot be null
        Returns:
        true if the feature must be excluded, false otherwise
      • adoptMainSideFeature

        public org.eclipse.emf.ecore.EStructuralFeature adoptMainSideFeature​(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature,
                                                                             IComparisonSession session)
        Description copied from interface: IComparisonParticipant
        Converts, if possible, the main side feature into a other supported by the other side object.
        Specified by:
        adoptMainSideFeature in interface IComparisonParticipant
        Parameters:
        mainSideFeature - the main side feature to convert, cannot be null
        session - the comparison session, cannot be null
        Returns:
        the converted feature applicable for other side object or null
      • mergeUsingExternalTool

        public ExternalMergeToolResult mergeUsingExternalTool​(ComparisonTreeNode node,
                                                              ComparisonContext comparisonContext,
                                                              org.eclipse.core.runtime.IProgressMonitor monitor)
        Description copied from interface: IComparisonParticipant
        Merges nodes using an external tool that are supported by this participant.
        Specified by:
        mergeUsingExternalTool in interface IComparisonParticipant
        Parameters:
        node - the comparison node, cannot be null
        comparisonContext - the comparison context, cannot be null
        monitor - the progress monitor, cannot be null
        Returns:
        the external merge tool result or null if no nodes were merged