Search in sources :

Example 1 with EntityNotificationV2

use of org.apache.atlas.v1.model.notification.EntityNotificationV2 in project atlas by apache.

the class EntityNotificationListenerV2 method notifyEntityEvents.

private void notifyEntityEvents(List<AtlasEntity> entities, OperationType operationType) throws AtlasBaseException {
    List<EntityNotificationV2> messages = new ArrayList<>();
    for (AtlasEntity entity : entities) {
        if (isInternalType(entity.getTypeName())) {
            continue;
        }
        filterNotificationAttributes(entity);
        messages.add(new EntityNotificationV2(entity, operationType, getAllClassifications(entity)));
    }
    if (!messages.isEmpty()) {
        try {
            notificationInterface.send(ENTITIES, messages);
        } catch (NotificationException e) {
            throw new AtlasBaseException(AtlasErrorCode.ENTITY_NOTIFICATION_FAILED, e, operationType.name());
        }
    }
}
Also used : EntityNotificationV2(org.apache.atlas.v1.model.notification.EntityNotificationV2) AtlasBaseException(org.apache.atlas.exception.AtlasBaseException) AtlasEntity(org.apache.atlas.model.instance.AtlasEntity) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)1 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)1 EntityNotificationV2 (org.apache.atlas.v1.model.notification.EntityNotificationV2)1