use of org.apache.atlas.listener.EntityChangeListener in project incubator-atlas by apache.
the class AtlasEntityChangeNotifier method onClassificationUpdatedToEntity.
public void onClassificationUpdatedToEntity(String entityId, List<AtlasClassification> classifications) throws AtlasBaseException {
// Since the classification attributes are updated in the graph, we need to recursively remap the entityText
doFullTextMapping(entityId);
ITypedReferenceableInstance entity = toITypedReferenceable(entityId);
List<ITypedStruct> traits = toITypedStructs(classifications);
if (entity == null || CollectionUtils.isEmpty(traits)) {
return;
}
for (EntityChangeListener listener : entityChangeListeners) {
try {
listener.onTraitsUpdated(entity, traits);
} catch (AtlasException e) {
throw new AtlasBaseException(AtlasErrorCode.NOTIFICATION_FAILED, e, getListenerName(listener), "TraitUpdate");
}
}
}
use of org.apache.atlas.listener.EntityChangeListener in project incubator-atlas by apache.
the class AtlasEntityChangeNotifier method onClassificationDeletedFromEntity.
public void onClassificationDeletedFromEntity(String entityId, List<String> traitNames) throws AtlasBaseException {
// Since the entity has already been modified in the graph, we need to recursively remap the entity
doFullTextMapping(entityId);
ITypedReferenceableInstance entity = toITypedReferenceable(entityId);
if (entity == null || CollectionUtils.isEmpty(traitNames)) {
return;
}
for (EntityChangeListener listener : entityChangeListeners) {
try {
listener.onTraitsDeleted(entity, traitNames);
} catch (AtlasException e) {
throw new AtlasBaseException(AtlasErrorCode.NOTIFICATION_FAILED, e, getListenerName(listener), "TraitDelete");
}
}
}
Aggregations