public abstract class DefaultModelObjectMerger
extends java.lang.Object
Constructor and Description |
---|
DefaultModelObjectMerger() |
Modifier and Type | Method and Description |
---|---|
protected void |
addModelDiffVisitor(ModelDiffVisitor visitor)
Adds a
ModelDiffVisitor instance to the registry list |
ModelCompareResultType |
compare(Resource resourceNew,
Resource resourceOld)
Compares the two resources and returns the changes
|
ModelCompareResultType |
compare(Resource resourceNew,
Resource resourceOld,
java.util.List<EStructuralFeature> ignoreFeatures)
Compares the two resources and returns the changes
|
ModelCompareResultType |
compareAndMerge(Resource resourceNew,
Resource resourceOld)
Compares the two resources and merges them into the right, the old object
|
ModelCompareResultType |
compareAndMerge(Resource resourceNew,
Resource resourceOld,
java.util.List<EStructuralFeature> ignoreFeatures)
Compares the two resources and merges them into the right, the old object
|
Comparison |
compareRaw(Resource resourceNew,
Resource resourceOld,
java.util.List<EStructuralFeature> ignoreFeatures)
Compares the two resources and returns the changes
|
protected void |
fireFinishedVisiting(Resource resource)
Executes the finished visiting call to all visitors
|
void |
fireVisitorChanges(Resource resource)
Fires finished visiting call to all visitors.
|
protected abstract java.lang.String |
getName() |
protected void |
initialize()
Activate method called by OSG DS on activation of a component
|
boolean |
merge(java.util.List<Diff> differences)
Merges differences
|
protected void |
removeModelDiffVisitor(ModelDiffVisitor visitor)
Removed a visitor from the registry list
|
protected void |
setComparisonFactory(IComparisonFactory comparison)
Sets a
IComparisonFactory instance |
protected void |
visitAttributeChanges(AttributeChange change)
Executes the visit for attribute changes
|
protected void |
visitReferenceChanges(ReferenceChange change)
Executes the visit for reference changes
|
public ModelCompareResultType compareAndMerge(Resource resourceNew, Resource resourceOld)
resourceNew
- the resource with the new object versionresourceOld
- the resource with the old, current object versiontrue
, on success otherwise false
public ModelCompareResultType compareAndMerge(Resource resourceNew, Resource resourceOld, java.util.List<EStructuralFeature> ignoreFeatures)
resourceNew
- the resource with the new object versionresourceOld
- the resource with the old, current object versionignoreFeatures
- a list of EStructuralFeature
to be ignored during comparetrue
, on success otherwise false
public ModelCompareResultType compare(Resource resourceNew, Resource resourceOld)
resourceNew
- the resource with the new object versionresourceOld
- the resource with the old, current object versionpublic ModelCompareResultType compare(Resource resourceNew, Resource resourceOld, java.util.List<EStructuralFeature> ignoreFeatures)
resourceNew
- the resource with the new object versionresourceOld
- the resource with the old, current object versionignoreFeatures
- a list of EStructuralFeature
to be ignored during comparepublic Comparison compareRaw(Resource resourceNew, Resource resourceOld, java.util.List<EStructuralFeature> ignoreFeatures)
resourceNew
- the resource with the new object versionresourceOld
- the resource with the old, current object versionignoreFeatures
- a list of EStructuralFeature
to be ignored during comparepublic boolean merge(java.util.List<Diff> differences)
differences
- the compare differences to mergetrue
, if merge was successful, otherwise false
public void fireVisitorChanges(Resource resource)
resource
- the changed, merged resourceprotected abstract java.lang.String getName()
protected void initialize()
protected void addModelDiffVisitor(ModelDiffVisitor visitor)
ModelDiffVisitor
instance to the registry listvisitor
- the visitor to addprotected void removeModelDiffVisitor(ModelDiffVisitor visitor)
visitor
- the visitor to be removedprotected void setComparisonFactory(IComparisonFactory comparison)
IComparisonFactory
instancecomparison
- the the comparison factory instanceprotected void visitAttributeChanges(AttributeChange change)
change
- the attribute changeprotected void visitReferenceChanges(ReferenceChange change)
change
- the reference changeprotected void fireFinishedVisiting(Resource resource)
resource
- the new resourceData In Motion Consulting