private void resolveConflict(ConflictType conflictType, NodeState conflictInfo) {
PropertyConflictHandler propertyConflictHandler = propertyConflictHandlers.get(conflictType);
if (propertyConflictHandler != null) {
for (PropertyState ours : conflictInfo.getProperties()) {
PropertyState theirs = parent.getProperty(ours.getName());
Resolution resolution = propertyConflictHandler.resolve(ours, theirs);
applyResolution(resolution, conflictType, ours);
}
}
else {
NodeConflictHandler nodeConflictHandler = nodeConflictHandlers.get(conflictType);
if (nodeConflictHandler != null) {
for (ChildNodeEntry oursCNE : conflictInfo.getChildNodeEntries()) {
String name = oursCNE.getName();
NodeState ours = oursCNE.getNodeState();
NodeState theirs = parent.getChildNode(name);
Resolution resolution = nodeConflictHandler.resolve(name, ours, theirs);
applyResolution(resolution, conflictType, name, ours);
}
}
else {
LOG.warn("Ignoring unknown conflict '" + conflictType + '\'');