public class NotificationResourceHandler extends Object
Constructor and Description |
---|
NotificationResourceHandler(DBNotificationService notificationService,
DBJobDefinitionService jobDefinitionService,
DBEventDefinitionService eventDefinitionService,
Map<String,EventNotification.Factory> eventNotificationFactories) |
Modifier and Type | Method and Description |
---|---|
NotificationDto |
create(NotificationDto unsavedDto,
Optional<User> user)
Creates a new notification definition and a corresponding scheduler job definition.
|
boolean |
delete(String dtoId)
Deletes an existing notification definition and its corresponding scheduler job definition and trigger.
|
void |
test(NotificationDto notificationDto,
String userName)
Tests a notification definition by executing it with a dummy event.
|
NotificationDto |
update(NotificationDto updatedDto)
Updates an existing notification definition and its corresponding scheduler job definition.
|
@Inject public NotificationResourceHandler(DBNotificationService notificationService, DBJobDefinitionService jobDefinitionService, DBEventDefinitionService eventDefinitionService, Map<String,EventNotification.Factory> eventNotificationFactories)
public NotificationDto create(NotificationDto unsavedDto, Optional<User> user)
unsavedDto
- the notification definition to saveuser
- public NotificationDto update(NotificationDto updatedDto)
updatedDto
- the notification definition to updatepublic boolean delete(String dtoId)
dtoId
- the notification definition to deletepublic void test(NotificationDto notificationDto, String userName) throws javax.ws.rs.NotFoundException, javax.ws.rs.InternalServerErrorException
notificationDto
- the notification definition to testuserName
- the name of the user that triggered the testjavax.ws.rs.NotFoundException
- if the notification definition or the notification factory cannot be foundjavax.ws.rs.InternalServerErrorException
- if the notification definition failed to be executedCopyright © 2012–2021 Graylog, Inc.. All rights reserved.