@Transactional
  public void remove(AlertTargetEntity alertTarget) {
    List<AlertGroupUpdate> alertGroupUpdates = new ArrayList<>();
    for (AlertGroupEntity alertGroupEntity : alertTarget.getAlertGroups()) {
      AlertGroupUpdate alertGroupUpdate = new AlertGroupUpdate(alertGroupEntity);
      alertGroupUpdate.getTargets().remove(alertTarget.getTargetId());
      alertGroupUpdates.add(alertGroupUpdate);
    }
    STOMPUpdatePublisher.publish(new AlertGroupsUpdateEvent(alertGroupUpdates, UpdateEventType.UPDATE));
    entityManagerProvider.get().remove(alertTarget);
  }
Removes the specified alert target from the database.

@param alertTarget
         the target to remove.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java