Search in sources :

Example 1 with DeleteTableMessage

use of com.netflix.metacat.common.dto.notifications.sns.messages.DeleteTableMessage in project metacat by Netflix.

the class SNSNotificationServiceImpl method notifyOfTableDeletion.

/**
     * {@inheritDoc}
     */
@Override
@EventListener
public void notifyOfTableDeletion(@NonNull final MetacatDeleteTablePostEvent event) {
    log.debug("Received DeleteTableEvent {}", event);
    DeleteTableMessage message = null;
    try {
        message = new DeleteTableMessage(UUID.randomUUID().toString(), event.getRequestContext().getTimestamp(), event.getRequestContext().getId(), event.getName().toString(), event.getTable());
        this.publishNotification(this.tableTopicArn, message);
        this.registry.counter(this.registry.createId(Metrics.CounterSNSNotificationTableDelete.name()).withTags(Metrics.statusSuccessMap)).increment();
    } catch (final Exception e) {
        this.handleException(event.getName(), "Unable to publish delete table notification", Metrics.CounterSNSNotificationTableDelete.name(), message, e);
    }
}
Also used : DeleteTableMessage(com.netflix.metacat.common.dto.notifications.sns.messages.DeleteTableMessage) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) EventListener(org.springframework.context.event.EventListener)

Aggregations

JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 DeleteTableMessage (com.netflix.metacat.common.dto.notifications.sns.messages.DeleteTableMessage)1 IOException (java.io.IOException)1 EventListener (org.springframework.context.event.EventListener)1