Commit b6bbe7d8 by Sarath Subramanian

ATLAS-2633: Tag Propagation , V2 notifications : When propagate value is…

ATLAS-2633: Tag Propagation , V2 notifications : When propagate value is switched from False to True , 'CLASSIFICATION_UPDATE' notification is sent instead of 'CLASSIFICATION_ADD'
parent efe0935e
......@@ -18,6 +18,7 @@
package org.apache.atlas.notification;
import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.RequestContextV1;
import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.listener.EntityChangeListenerV2;
import org.apache.atlas.model.instance.AtlasClassification;
......@@ -85,7 +86,14 @@ public class EntityNotificationListenerV2 implements EntityChangeListenerV2 {
@Override
public void onClassificationsUpdated(AtlasEntity entity, List<AtlasClassification> classifications) throws AtlasBaseException {
notifyEntityEvents(Collections.singletonList(entity), CLASSIFICATION_UPDATE);
Map<String, List<AtlasClassification>> addedPropagations = RequestContextV1.get().getAddedPropagations();
Map<String, List<AtlasClassification>> removedPropagations = RequestContextV1.get().getRemovedPropagations();
if (addedPropagations.containsKey(entity.getGuid())) {
notifyEntityEvents(Collections.singletonList(entity), CLASSIFICATION_ADD);
} else if (!removedPropagations.containsKey(entity.getGuid())) {
notifyEntityEvents(Collections.singletonList(entity), CLASSIFICATION_UPDATE);
}
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment