Class NotificationResourceHandler

java.lang.Object
org.graylog.events.notifications.NotificationResourceHandler

public class NotificationResourceHandler extends Object
  • Constructor Details

  • Method Details

    • create

      public NotificationDto create(NotificationDto unsavedDto, Optional<User> user)
      Creates a new notification definition and a corresponding scheduler job definition.
      Parameters:
      unsavedDto - the notification definition to save
      user -
      Returns:
      the created event definition
    • update

      public NotificationDto update(NotificationDto updatedDto)
      Updates an existing notification definition and its corresponding scheduler job definition.
      Parameters:
      updatedDto - the notification definition to update
      Returns:
      the updated notification definition
    • delete

      public boolean delete(String dtoId)
      Deletes an existing notification definition and its corresponding scheduler job definition and trigger.
      Parameters:
      dtoId - the notification definition to delete
      Returns:
      true if the notification definition got deleted, false otherwise
    • test

      public void test(NotificationDto notificationDto, String userName) throws javax.ws.rs.NotFoundException, javax.ws.rs.InternalServerErrorException
      Tests a notification definition by executing it with a dummy event.
      Parameters:
      notificationDto - the notification definition to test
      userName - the name of the user that triggered the test
      Throws:
      javax.ws.rs.NotFoundException - if the notification definition or the notification factory cannot be found
      javax.ws.rs.InternalServerErrorException - if the notification definition failed to be executed